Skip to content

Commit

Permalink
Fix SLO
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jun 6, 2024
1 parent 86627e7 commit 7f40f5f
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,16 @@ function ($DirectDebitMandateNode) use ($invoiceHeaderSettlement) {
$this->source->whenExists(
'./ram:Name',
$sellerTradePartyNode,
function ($sellerTradePartyNameNode) {
$this->destination->startElement('cac:PartyName');
$this->destination->element('cbc:Name', $sellerTradePartyNameNode->nodeValue);
$this->destination->endElement();
function ($sellerTradePartyNameNode) use ($sellerTradePartyNode) {
$this->source->whenExists(
'./ram:SpecifiedLegalOrganization/ram:TradingBusinessName',
$sellerTradePartyNode,
function ($sellerTradePartyLegalOrgBusNameNode) {
$this->destination->startElement('cac:PartyName');
$this->destination->element('cbc:Name', $sellerTradePartyLegalOrgBusNameNode->nodeValue);
$this->destination->endElement();
}
);
}
);
$this->source->whenExists(
Expand Down Expand Up @@ -528,15 +534,7 @@ function ($sellerTradePartyTaxRegNode) {
function ($sellerTradePartyLegalOrgNode) use ($sellerTradePartyNode) {
$this->destination->startElement('cac:PartyLegalEntity');
$this->destination->element('cbc:RegistrationName', $this->source->queryValue('./ram:Name', $sellerTradePartyNode));
$this->source->whenExists(
'./ram:ID',
$sellerTradePartyLegalOrgNode,
function ($sellerTradePartyLegalOrgIdNode) {
$this->destination->startElement('cbc:CompanyID', $sellerTradePartyLegalOrgIdNode->nodeValue);
$this->destination->attribute('schemeID', $this->source->queryValue('./@schemeID', $sellerTradePartyLegalOrgIdNode));
$this->destination->endElement();
}
);
$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();
},
Expand Down Expand Up @@ -614,10 +612,16 @@ function ($buyerTradePartyGlobalIdNode) {
$this->source->whenExists(
'./ram:Name',
$buyerTradePartyNode,
function ($buyerTradePartyNameNode) {
$this->destination->startElement('cac:PartyName');
$this->destination->element('cbc:Name', $buyerTradePartyNameNode->nodeValue);
$this->destination->endElement();
function ($buyerTradePartyNameNode) use ($buyerTradePartyNode) {
$this->source->whenExists(
'./ram:SpecifiedLegalOrganization/ram:TradingBusinessName',
$buyerTradePartyNode,
function ($buyerTradePartyLegalOrgBusNameNode) {
$this->destination->startElement('cac:PartyName');
$this->destination->element('cbc:Name', $buyerTradePartyLegalOrgBusNameNode->nodeValue);
$this->destination->endElement();
}
);
}
);
$this->source->whenExists(
Expand Down Expand Up @@ -681,15 +685,7 @@ function ($sellerTradePartyTaxRegNode) {
function ($buyerTradePartyLegalOrgNode) use ($buyerTradePartyNode) {
$this->destination->startElement('cac:PartyLegalEntity');
$this->destination->element('cbc:RegistrationName', $this->source->queryValue('./ram:Name', $buyerTradePartyNode));
$this->source->whenExists(
'./ram:ID',
$buyerTradePartyLegalOrgNode,
function ($buyerTradePartyLegalOrgIdNode) {
$this->destination->startElement('cbc:CompanyID', $buyerTradePartyLegalOrgIdNode->nodeValue);
$this->destination->attribute('schemeID', $this->source->queryValue('./@schemeID', $buyerTradePartyLegalOrgIdNode));
$this->destination->endElement();
}
);
$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', $buyerTradePartyNode));
$this->destination->endElement();
},
Expand Down

0 comments on commit 7f40f5f

Please sign in to comment.