Fix Bug Intracomm

This commit is contained in:
sparkyx 2026-01-26 13:45:20 +01:00
parent 4b804a6426
commit 4835d163c5

View file

@ -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
<cac:Delivery>
<cbc:ActualDeliveryDate>
2026-01-06
</cbc:ActualDeliveryDate>
</cac:Delivery>
*/
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());