Skip to content

Commit

Permalink
+ Add SpecifiedTradeAllowanceCharge to IncludedSupplyChainTradeLineIt…
Browse files Browse the repository at this point in the history
…em->SpecifiedLineTradeSettlement
  • Loading branch information
MarvinG92 committed Dec 17, 2024
1 parent a82ab53 commit d953181
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/XmlConverterUblToCii.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ function ($invoiceLineAccountingCostNode) {
}
);

$this->source->queryAll('./cac:AllowanceCharge', $invoiceLineNode)->forEach(
function ($allowanceChargeNode) {
$this->destination->startElement('ram:SpecifiedTradeAllowanceCharge');

$this->source->whenExists(
'./cbc:ChargeIndicator',
$allowanceChargeNode,
function ($chargeIndicatorNode) {
$this->destination->startElement('ram:ChargeIndicator');
$this->destination->element('udt:Indicator', $chargeIndicatorNode->nodeValue);
$this->destination->endElement();
}
);

$this->destination->element('ram:CalculationPercent', $this->source->queryValue('./cbc:MultiplierFactorNumeric', $allowanceChargeNode));
$this->destination->element('ram:BasisAmount', $this->source->queryValue('./cbc:BaseAmount', $allowanceChargeNode));
$this->destination->element('ram:ActualAmount', $this->source->queryValue('./cbc:Amount', $allowanceChargeNode));
$this->destination->element('ram:ReasonCode', $this->source->queryValue('./cbc:AllowanceChargeReasonCode', $allowanceChargeNode));
$this->destination->element('ram:Reason', $this->source->queryValue('./cbc:AllowanceChargeReason', $allowanceChargeNode));

$this->destination->endElement();
}
);

$this->destination->endElement();

$this->destination->endElement();
Expand Down

0 comments on commit d953181

Please sign in to comment.