Skip to content

Commit

Permalink
Fix CardAccount and PaymentTerms
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jun 6, 2024
1 parent 51a8944 commit 6aa55b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
);
Expand Down

0 comments on commit 6aa55b8

Please sign in to comment.