Skip to content

Commit

Permalink
Include the proposed fixes from ConnectingEurope/eInvoicing-EN16931#332
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelte Jansen committed Oct 28, 2022
1 parent 468ccff commit 4482bd5
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 132 deletions.
38 changes: 19 additions & 19 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="normalize-space(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID) != ''"/>
<param name="BR-02" value="normalize-space(rsm:ExchangedDocument/ram:ID) != ''"/>
<param name="BR-03" value="normalize-space(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']) != ''"/>
<param name="BR-04" value="normalize-space(rsm:ExchangedDocument/ram:TypeCode) != ''"/>
<param name="BR-05" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode) != ''"/>
<param name="BR-06" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) != ''"/>
<param name="BR-07" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name) != ''"/>
<param name="BR-01" value="normalize-space(string-join(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID)) != ''"/>
<param name="BR-02" value="normalize-space(string-join(rsm:ExchangedDocument/ram:ID)) != ''"/>
<param name="BR-03" value="normalize-space(string-join(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102'])) != ''"/>
<param name="BR-04" value="normalize-space(string-join(rsm:ExchangedDocument/ram:TypeCode)) != ''"/>
<param name="BR-05" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode)) != ''"/>
<param name="BR-06" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name)) != ''"/>
<param name="BR-07" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name)) != ''"/>
<param name="BR-08" value="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress"/>
<param name="BR-09" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) != ''"/>
<param name="BR-09" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID)) != ''"/>
<param name="BR-10" value="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress"/>
<param name="BR-11" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID) != ''"/>
<param name="BR-11" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID)) != ''"/>
<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="normalize-space(ram:AssociatedDocumentLineDocument/ram:LineID) != ''"/>
<param name="BR-21" value="normalize-space(string-join(ram:AssociatedDocumentLineDocument/ram:LineID)) != ''"/>
<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="normalize-space(ram:SpecifiedTradeProduct/ram:Name) != ''"/>
<param name="BR-25" value="normalize-space(string-join(ram:SpecifiedTradeProduct/ram:Name)) != ''"/>
<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="normalize-space(ram:IssuerAssignedID) != ''"/>
<param name="BR-52" value="normalize-space(string-join(ram:IssuerAssignedID)) != ''"/>
<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="normalize-space(ram:IssuerAssignedID) != ''"/>
<param name="BR-56" value="normalize-space(ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']) != ''"/>
<param name="BR-57" value="(ram:ShipToTradeParty/ram:PostalTradeAddress and normalize-space(ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID) != '') or not (ram:ShipToTradeParty/ram:PostalTradeAddress)"/>
<param name="BR-55" value="normalize-space(string-join(ram:IssuerAssignedID)) != ''"/>
<param name="BR-56" value="normalize-space(string-join(ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA'])) != ''"/>
<param name="BR-57" value="(ram:ShipToTradeParty/ram:PostalTradeAddress and normalize-space(string-join(ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID)) != '') or not (ram:ShipToTradeParty/ram:PostalTradeAddress)"/>
<param name="BR-61" value="(ram:IBANID) or (ram:ProprietaryID)"/>
<param name="BR-62" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-63" value="normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-64" value="normalize-space(ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID) != '' or not (ram:SpecifiedTradeProduct/ram:GlobalID)"/>
<param name="BR-65" value="normalize-space(ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID) != '' or not (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification)"/>
<param name="BR-62" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication))"/>
<param name="BR-63" value="normalize-space(string-join(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID/@schemeID)) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication)"/>
<param name="BR-64" value="normalize-space(string-join(ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID)) != '' or not (ram:SpecifiedTradeProduct/ram:GlobalID)"/>
<param name="BR-65" value="normalize-space(string-join(ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID)) != '' 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
30 changes: 15 additions & 15 deletions schematron/si-ubl-2.0/CenPC434/UBL/EN16931-UBL-model.sch
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
-->
<!-- Data binding to UBL syntax for model -->
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" is-a="model" id="UBL-model">
<param name="BR-01" value="normalize-space(cbc:CustomizationID) != ''"/>
<param name="BR-02" value="normalize-space(cbc:ID) != ''"/>
<param name="BR-03" value="normalize-space(cbc:IssueDate) != ''"/>
<param name="BR-04" value="normalize-space(cbc:InvoiceTypeCode) != '' or normalize-space(cbc:CreditNoteTypeCode) !=''"/>
<param name="BR-05" value="normalize-space(cbc:DocumentCurrencyCode) != ''"/>
<param name="BR-06" value="normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) != ''"/>
<param name="BR-07" value="normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) != ''"/>
<param name="BR-01" value="normalize-space(string-join(cbc:CustomizationID)) != ''"/>
<param name="BR-02" value="normalize-space(string-join(cbc:ID)) != ''"/>
<param name="BR-03" value="normalize-space(string-join(cbc:IssueDate)) != ''"/>
<param name="BR-04" value="normalize-space(string-join(cbc:InvoiceTypeCode)) != '' or normalize-space(cbc:CreditNoteTypeCode) !=''"/>
<param name="BR-05" value="normalize-space(string-join(cbc:DocumentCurrencyCode)) != ''"/>
<param name="BR-06" value="normalize-space(string-join(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)) != ''"/>
<param name="BR-07" value="normalize-space(string-join(cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)) != ''"/>
<param name="BR-08" value="exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress)"/>
<param name="BR-09" value="normalize-space(cac:Country/cbc:IdentificationCode) != ''"/>
<param name="BR-09" value="normalize-space(string-join(cac:Country/cbc:IdentificationCode)) != ''"/>
<param name="BR-10" value="exists(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress)"/>
<param name="BR-11" value="normalize-space(cac:Country/cbc:IdentificationCode) != ''"/>
<param name="BR-11" value="normalize-space(string-join(cac:Country/cbc:IdentificationCode)) != ''"/>
<param name="BR-12" value="exists(cbc:LineExtensionAmount)"/>
<param name="BR-13" value="exists(cbc:TaxExclusiveAmount)"/>
<param name="BR-14" value="exists(cbc:TaxInclusiveAmount)"/>
<param name="BR-15" value="exists(cbc:PayableAmount)"/>
<param name="BR-16" value="exists(cac:InvoiceLine) or exists(cac:CreditNoteLine)"/>
<param name="BR-17" value="exists(cac:PartyName/cbc:Name) and (not(cac:PartyName/cbc:Name = ../cac:AccountingSupplierParty/cac:Party/cac:PartyName/cbc:Name) and not(cac:PartyIdentification/cbc:ID = ../cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID) )"/>
<param name="BR-18" value="normalize-space(cac:PartyName/cbc:Name) != ''"/>
<param name="BR-18" value="normalize-space(string-join(string-join(cac:PartyName/cbc:Name))) != ''"/>
<param name="BR-19" value="exists(cac:PostalAddress)"/>
<param name="BR-20" value="normalize-space(cac:Country/cbc:IdentificationCode) != ''"/>
<param name="BR-21" value="normalize-space(cbc:ID) != ''"/>
<param name="BR-20" value="normalize-space(string-join(cac:Country/cbc:IdentificationCode)) != ''"/>
<param name="BR-21" value="normalize-space(string-join(cbc:ID)) != ''"/>
<param name="BR-22" value="exists(cbc:InvoicedQuantity) or exists(cbc:CreditedQuantity)"/>
<param name="BR-23" value="exists(cbc:InvoicedQuantity/@unitCode) or exists(cbc:CreditedQuantity/@unitCode)"/>
<param name="BR-24" value="exists(cbc:LineExtensionAmount)"/>
<param name="BR-25" value="normalize-space(cac:Item/cbc:Name) != ''"/>
<param name="BR-25" value="normalize-space(string-join(cac:Item/cbc:Name)) != ''"/>
<param name="BR-26" value="exists(cac:Price/cbc:PriceAmount)"/>
<param name="BR-27" value="(cac:Price/cbc:PriceAmount) &gt;= 0"/>
<param name="BR-28" value="(cac:Price/cac:AllowanceCharge/cbc:BaseAmount) &gt;= 0 or not(exists(cac:Price/cac:AllowanceCharge/cbc:BaseAmount))"/>
Expand All @@ -50,9 +50,9 @@
<param name="BR-47" value="exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID)"/>
<param name="BR-48" value="exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:Percent) or (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/normalize-space(cbc:ID)='O')"/>
<param name="BR-49" value="exists(cbc:PaymentMeansCode)"/>
<param name="BR-50" value="normalize-space(cbc:ID) != ''"/>
<param name="BR-50" value="normalize-space(string-join(cbc:ID)) != ''"/>
<param name="BR-51" value="string-length(cbc:PrimaryAccountNumberID)&lt;=10"/>
<param name="BR-52" value="normalize-space(cbc:ID) != ''"/>
<param name="BR-52" value="normalize-space(string-join(cbc:ID)) != ''"/>
<param name="BR-53" value="every $taxcurrency in cbc:TaxCurrencyCode satisfies exists(//cac:TaxTotal/cbc:TaxAmount[@currencyID=$taxcurrency])"/>
<param name="BR-54" value="exists(cbc:Name) and exists(cbc:Value)"/>
<param name="BR-55" value="exists(cac:InvoiceDocumentReference/cbc:ID)"/>
Expand Down
Loading

0 comments on commit 4482bd5

Please sign in to comment.