From 6aa55b8fdc02d08540160fea1fa108672329dbad Mon Sep 17 00:00:00 2001 From: ruff Date: Thu, 6 Jun 2024 06:19:21 +0200 Subject: [PATCH] Fix CardAccount and PaymentTerms --- src/XmlConverterCiiToUbl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/XmlConverterCiiToUbl.php b/src/XmlConverterCiiToUbl.php index d9d8812..d4ff7c1 100644 --- a/src/XmlConverterCiiToUbl.php +++ b/src/XmlConverterCiiToUbl.php @@ -1114,6 +1114,7 @@ function ($paymentMeansTypeCodeNode) use ($peymentMeansNode) { function ($paymentMeansFinancialCardNode) { $this->destination->startElement('cac:CardAccount'); $this->destination->element('cbc:PrimaryAccountNumberID', $this->source->queryValue('./ram:ID', $paymentMeansFinancialCardNode)); + $this->destination->element('cbc:NetworkID', 'mapped-from-cii'); $this->destination->element('cbc:HolderName', $this->source->queryValue('./ram:CardholderName', $paymentMeansFinancialCardNode)); $this->destination->endElement(); } @@ -1172,11 +1173,11 @@ private function convertPaymentTerms(): void $invoiceHeaderSettlement = $this->source->query('./ram:ApplicableHeaderTradeSettlement', $invoiceSuppyChainTradeTransaction)->item(0); $this->source->whenExists( - './ram:SpecifiedTradePaymentTerms', + './ram:SpecifiedTradePaymentTerms/ram:Description[string-length(text()) > 0]', $invoiceHeaderSettlement, - function ($peymentTermsNode) { + function ($peymentTermsDescriptionNode, $peymentTermsNode) { $this->destination->startElement('cac:PaymentTerms'); - $this->destination->element('cbc:Note', $this->source->queryValue('./ram:Description', $peymentTermsNode)); + $this->destination->element('cbc:Note', $peymentTermsDescriptionNode->nodeValue); $this->destination->endElement(); } );