Skip to content

Commit

Permalink
#2 Added reading of AdditionalItemProperty in XmlConverterUblToCii
Browse files Browse the repository at this point in the history
#2 Added reading of AdditionalItemProperty in XmlConverterUblToCii
  • Loading branch information
horstoeko authored Dec 10, 2024
2 parents accf3c8 + 0456ef4 commit f9cc1ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/XmlConverterUblToCii.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,25 @@ function ($invoiceLineNoteNode) {
$this->destination->element('ram:Name', $this->source->queryValue('./cac:Item/cbc:Name', $invoiceLineNode));
$this->destination->element('ram:Description', $this->source->queryValue('./cac:Item/cbc:Description', $invoiceLineNode));

$this->source->queryAll('./cac:Item/cac:AdditionalItemProperty', $invoiceLineNode)->forEach(
function ($invoiceLineAdditionalItemPropertyNode) {
$this->destination->element('ram:Description', $this->source->queryValue('./cbc:Name', $invoiceLineAdditionalItemPropertyNode));
$this->destination->element('ram:Value', $this->source->queryValue('./cbc:Value', $invoiceLineAdditionalItemPropertyNode));
},
function () {
// Do nothing here
},
function () {
// Do nothing here
},
function () {
$this->destination->startElement('ram:ApplicableProductCharacteristic');
},
function () {
$this->destination->endElement();
}
);

$this->source->queryAll('./cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode', $invoiceLineNode)->forEach(
function ($invoiceLineItemClassificationCode) {
$this->destination->elementWithMultipleAttributes('ram:ClassCode', $invoiceLineItemClassificationCode->nodeValue, ['listID' => $invoiceLineItemClassificationCode->getAttribute('listID'), 'listVersionID' => $invoiceLineItemClassificationCode->getAttribute('listVersionID')]);
Expand Down

0 comments on commit f9cc1ca

Please sign in to comment.