Skip to content

Commit

Permalink
Pull in additional commits from upstream PR 333
Browse files Browse the repository at this point in the history
ConnectingEurope/eInvoicing-EN16931#333

- Fixed an issue introduced in 2.0.3.5. This version contained an
  additional change in checks for empty values for a number rules. This
  change added a check for whitespace-only as well, but contained an
  issue where the entire check was skipped if the checked XML element
  is not present. This issue has been fixed in this version, by
  explicitely checking both existence and white-space aware emptiness.
  • Loading branch information
tjeb committed Feb 28, 2023
1 parent 2ec46cf commit 119790b
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 1,135 deletions.
8 changes: 7 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
Scheduled for next release
--------------------------

No changes as of yet.
SI-UBL 2.0.3.X:
- Fixed an issue introduced in 2.0.3.5. This version contained an
additional change in checks for empty values for a number rules. This
change added a check for whitespace-only as well, but contained an
issue where the entire check was skipped if the checked XML element
is not present. This issue has been fixed in this version, by
explicitely checking both existence and white-space aware emptiness.

==========================
= Published releases =
Expand Down
36 changes: 18 additions & 18 deletions schematron/nlcius-cii/CenPC434/CII/EN16931-CII-model.sch
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<!-- Schematron binding rules generated by Andreas Pelekies -->
<!-- Data binding to CII syntax for EN16931 -->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" is-a="EN16931" id="EN16931-CII-Model">
<param name="BR-01" value="every $node in (rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID) satisfies (normalize-space($node) != '')"/>
<param name="BR-02" value="every $node in (rsm:ExchangedDocument/ram:ID) satisfies (normalize-space($node) != '')"/>
<param name="BR-03" value="every $node in (rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']) satisfies (normalize-space($node) != '')"/>
<param name="BR-04" value="every $node in (rsm:ExchangedDocument/ram:TypeCode) satisfies (normalize-space($node) != '')"/>
<param name="BR-05" value="every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode) satisfies (normalize-space($node) != '')"/>
<param name="BR-06" value="every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) satisfies (normalize-space($node) != '')"/>
<param name="BR-07" value="every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name) satisfies (normalize-space($node) != '')"/>
<param name="BR-01" value="exists(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID) and (every $node in (rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-02" value="exists(rsm:ExchangedDocument/ram:ID) and (every $node in (rsm:ExchangedDocument/ram:ID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-03" value="exists(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']) and (every $node in (rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']) satisfies (normalize-space($node) != ''))"/>
<param name="BR-04" value="exists(rsm:ExchangedDocument/ram:TypeCode) and (every $node in (rsm:ExchangedDocument/ram:TypeCode) satisfies (normalize-space($node) != ''))"/>
<param name="BR-05" value="exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode) satisfies (normalize-space($node) != ''))"/>
<param name="BR-06" value="exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) satisfies (normalize-space($node) != ''))"/>
<param name="BR-07" value="exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name) satisfies (normalize-space($node) != ''))"/>
<param name="BR-08" value="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress"/>
<param name="BR-09" value="every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) satisfies (normalize-space($node) != '')"/>
<param name="BR-09" value="exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-10" value="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress"/>
<param name="BR-11" value="every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID) satisfies (normalize-space($node) != '')"/>
<param name="BR-11" value="exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-12" value="(ram:LineTotalAmount)"/>
<param name="BR-13" value="(ram:TaxBasisTotalAmount)"/>
<param name="BR-14" value="(ram:GrandTotalAmount)"/>
Expand All @@ -26,11 +26,11 @@
<param name="BR-18" value="(ram:Name)"/>
<param name="BR-19" value="(ram:PostalTradeAddress)"/>
<param name="BR-20" value="(ram:PostalTradeAddress/ram:CountryID)"/>
<param name="BR-21" value="every $node in (ram:AssociatedDocumentLineDocument/ram:LineID) satisfies (normalize-space($node) != '')"/>
<param name="BR-21" value="exists(ram:AssociatedDocumentLineDocument/ram:LineID) and (every $node in (ram:AssociatedDocumentLineDocument/ram:LineID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-22" value="(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity)"/>
<param name="BR-23" value="(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode)"/>
<param name="BR-24" value="(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)"/>
<param name="BR-25" value="every $node in (ram:SpecifiedTradeProduct/ram:Name) satisfies (normalize-space($node) != '')"/>
<param name="BR-25" value="exists(ram:SpecifiedTradeProduct/ram:Name) and (every $node in (ram:SpecifiedTradeProduct/ram:Name) satisfies (normalize-space($node) != ''))"/>
<param name="BR-26" value="(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:ChargeAmount)"/>
<param name="BR-27" value="(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:ChargeAmount) &gt;= 0"/>
<param name="BR-28" value="(ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount &gt;= 0) or not(ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:ChargeAmount)"/>
Expand All @@ -53,17 +53,17 @@
<param name="BR-49" value="(ram:TypeCode)"/>
<param name="BR-50" value="(ram:IBANID) or (ram:ProprietaryID)"/>
<param name="BR-51" value="string-length(ram:ID)&lt;=10"/>
<param name="BR-52" value="every $node in (ram:IssuerAssignedID) satisfies (normalize-space($node) != '')"/>
<param name="BR-52" value="exists(ram:IssuerAssignedID) and (every $node in (ram:IssuerAssignedID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-53" value="not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) or (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and (ram:TaxTotalAmount/@currencyID = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode))"/>
<param name="BR-54" value="(ram:Description) and (ram:Value)"/>
<param name="BR-55" value="every $node in (ram:IssuerAssignedID) satisfies (normalize-space($node) != '')"/>
<param name="BR-56" value="every $node in (ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']) satisfies (normalize-space($node) != '')"/>
<param name="BR-55" value="exists(ram:IssuerAssignedID) and (every $node in (ram:IssuerAssignedID) satisfies (normalize-space($node) != ''))"/>
<param name="BR-56" value="exists(ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']) and (every $node in (ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']) satisfies (normalize-space($node) != ''))"/>
<param name="BR-57" value="(ram:ShipToTradeParty/ram:PostalTradeAddress and (every $node in (ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID) satisfies (normalize-space($node) != ''))) or not (ram:ShipToTradeParty/ram:PostalTradeAddress)"/>
<param name="BR-61" value="(ram:IBANID) or (ram:ProprietaryID)"/>
<param name="BR-62" value="(every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) satisfies (normalize-space($node) != '')) or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-63" value="(every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) satisfies (normalize-space($node) != '')) or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-64" value="(every $node in (ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID) satisfies (normalize-space($node) != '')) or not (ram:SpecifiedTradeProduct/ram:GlobalID)"/>
<param name="BR-65" value="(every $node in (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID) satisfies (normalize-space($node) != '')) or not (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification)"/>
<param name="BR-62" value="(exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) satisfies (normalize-space($node) != ''))) or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-63" value="(exists(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) and (every $node in (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) satisfies (normalize-space($node) != ''))) or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-64" value="(exists(ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID) and (every $node in (ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID) satisfies (normalize-space($node) != ''))) or not (ram:SpecifiedTradeProduct/ram:GlobalID)"/>
<param name="BR-65" value="(exists(ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID) and (every $node in (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID) satisfies (normalize-space($node) != ''))) or not (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification)"/>
<!--param name="BR-CO-02" value="((ram:TypeCode = ('30','57')) and (ram:PayeePartyCreditorFinancialAccount/ram:IBANID or ram:PayeePartyCreditorFinancialAccount/ram:ProprietaryID)) or not(ram:TypeCode = ('30','57'))"/-->
<param name="BR-CO-03" value="((//ram:TaxPointDate) and not(//ram:DueDateTypeCode)) or (not (//ram:TaxPointDate) and (//ram:DueDateTypeCode)) or (not (//ram:TaxPointDate) and not (//ram:DueDateTypeCode))"/>
<param name="BR-CO-04" value="(ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)"/>
Expand Down
Loading

0 comments on commit 119790b

Please sign in to comment.