Skip to content

Commit

Permalink
Fixes for PartyLegalEntity (CII to UBL)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jul 23, 2024
1 parent 7a2d7a8 commit f09b576
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ function ($sellerTradePartyLegalOrgNode) use ($sellerTradePartyNode) {
$this->destination->elementWithAttribute('cbc:CompanyID', $this->source->queryValue('./ram:ID', $sellerTradePartyLegalOrgNode), 'schemeID', $this->source->queryValue('./ram:ID/@schemeID', $sellerTradePartyLegalOrgNode));
$this->destination->element('cbc:CompanyLegalForm', $this->source->queryValue('./ram:Description', $sellerTradePartyNode));
$this->destination->endElement();
}, function () use ($sellerTradePartyNode) {
$this->destination->startElement('cac:PartyLegalEntity');
$this->destination->element('cbc:RegistrationName', $this->source->queryValue('./ram:Name', $sellerTradePartyNode));
$this->destination->endElement();
}
);
$this->source->whenExists(
Expand Down Expand Up @@ -1008,6 +1012,23 @@ function ($sellerTradePartyTaxRegNode) {
$this->destination->endElement();
}
);
$this->source->whenExists(
'./ram:SpecifiedLegalOrganization',
$sellerTaxRepresentativePartyNode,
function ($buyerTradePartyLegalOrgNode) use ($sellerTaxRepresentativePartyNode) {
$this->destination->startElement('cac:PartyLegalEntity');
$this->source->whenExists(
'./ram:TradingBusinessName', $buyerTradePartyLegalOrgNode, function ($tradingBusinessName) {
$this->destination->element('cbc:RegistrationName', $tradingBusinessName->nodeValue);
}, function () use ($sellerTaxRepresentativePartyNode) {
$this->destination->element('cbc:RegistrationName', $this->source->queryValue('./ram:Name', $sellerTaxRepresentativePartyNode));
}
);
$this->destination->elementWithAttribute('cbc:CompanyID', $this->source->queryValue('./ram:ID', $buyerTradePartyLegalOrgNode), 'schemeID', $this->source->queryValue('./ram:ID/@schemeID', $buyerTradePartyLegalOrgNode));
$this->destination->element('cbc:CompanyLegalForm', $this->source->queryValue('./ram:Description', $sellerTaxRepresentativePartyNode));
$this->destination->endElement();
}
);
$this->source->whenExists(
'./ram:DefinedTradeContact',
$sellerTaxRepresentativePartyNode,
Expand Down

0 comments on commit f09b576

Please sign in to comment.