diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php index 0d7fa1605..546da3074 100644 --- a/include/XMLDocument/invoiceubl21.class.php +++ b/include/XMLDocument/invoiceubl21.class.php @@ -245,6 +245,31 @@ class InvoiceUBL21 extends XMLInvoice { $customer->appendChild($customer_party); return $customer; } + /** + * @brief Delivery Date is mandatory for INTRACOMM , so by default + * we set the invoice date + + + 2026-01-06 + + + */ + function build_deliveryDate() + { + $delivery=$this->createElement("cac:Delivery"); + $delivery->appendChild($this->createElement("cbc:ActualDeliveryDate",$this->data['issue_date'])); + //(cac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode// + $loc= $this->createElement("cac:DeliveryLocation"); + $addr=$this->createElement('cac:Address'); + $country=$this->createElement("cac:Country"); + $country->appendChild($this->createElement("cbc:IdentificationCode", $this->data['customer']['country'])); + $addr->appendChild($country); + $loc->appendChild($addr); + $delivery->appendChild($loc); + + return $delivery; + } + /** /** * @brief Build XML Block for payment * @code @@ -659,6 +684,9 @@ class InvoiceUBL21 extends XMLInvoice { // add the customer $root->appendChild($this->build_customer()); + // add delivery date + $root->appendChild($this->build_deliveryDate()); + // add the payment if there is a bank account if ( $company['COMPANY_BANK_IBAN'] != "") $root->appendChild($this->build_paymentInfo());