Skip to content

Commit

Permalink
Fix XmlConverterCiiToUbl::checkValidSource
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Nov 12, 2024
1 parent bde10d0 commit 419425d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ protected function checkValidSource()
$invoiceElement = $this->source->query('//rsm:CrossIndustryInvoice')->item(0);
$invoiceExchangeDocumentContext = $this->source->query('./rsm:ExchangedDocumentContext', $invoiceElement)->item(0);

if (is_null($invoiceExchangeDocumentContext)) {
throw new \RuntimeException('The document is not a valid CII document');
}

$submittedProfile = $this->source->queryValue('./ram:GuidelineSpecifiedDocumentContextParameter/ram:ID', $invoiceExchangeDocumentContext);

if ($this->isSupportedProfile($submittedProfile) !== true) {
Expand Down

0 comments on commit 419425d

Please sign in to comment.