Skip to content

Commit

Permalink
Merge pull request #358 from ConnectingEurope/validation-1.3.11
Browse files Browse the repository at this point in the history
Validation 1.3.11
  • Loading branch information
oriol authored Oct 4, 2023
2 parents d94c022 + 52b3b43 commit 8d3664d
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 55 deletions.
3 changes: 2 additions & 1 deletion cii/schematron/CII/EN16931-CII-model.sch
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<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-65" value="normalize-space(ram:ClassCode/@listID) != '' or not (ram:ClassCode)"/>
<param name="BR-66" value="(ram:ChargeIndicator)"/>

<!--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'))"/-->
Expand Down Expand Up @@ -267,6 +267,7 @@
<param name="Tax_Total " value="//ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]"/>
<param name="Document_totals " value="//ram:SpecifiedTradeSettlementHeaderMonetarySummation"/>
<param name="SpecifiedTradeAllowanceCharge" value="//ram:SpecifiedTradeAllowanceCharge"/>
<param name="DesignatedProductClassification" value="//ram:DesignatedProductClassification"/>

<param name="VATS_Line " value="//rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode = 'S'][upper-case(ram:TypeCode) = 'VAT']"/>
<param name="VATS " value="//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode[.='S']"/>
Expand Down
15 changes: 13 additions & 2 deletions cii/schematron/CII/EN16931-CII-syntax.sch
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@
<param name="CII-SR-218" value="not(ram:PurchaseSpecifiedTradeAccountingAccount)"/>
<param name="CII-SR-219" value="not(ram:SalesSpecifiedTradeAccountingAccount)"/>
<param name="CII-SR-220" value="not(ram:SpecifiedTradeSettlementFinancialCard)"/>
<param name="CII-SR-454" value="count(ram:ApplicableTradeTax) = 1"/>

<!-- ApplicableHeaderTradeAgreement -->
<param name="CII-SR-442" value="not(ram:Reference)"/>
<param name="CII-SR-222" value="not(ram:SellerTradeParty/ram:RoleCode)"/>
Expand All @@ -264,6 +266,9 @@
<param name="CII-SR-229" value="not(ram:SellerTradeParty/ram:DefinedTradeContact/ram:JobTitle)"/>
<param name="CII-SR-230" value="not(ram:SellerTradeParty/ram:DefinedTradeContact/ram:Responsibility)"/>
<param name="CII-SR-231" value="not(ram:SellerTradeParty/ram:DefinedTradeContact/ram:PersonID)"/>




<param name="CII-SR-232" value="not(ram:SellerTradeParty/ram:DefinedTradeContact/ram:TelephoneUniversalCommunication/ram:URIID)"/>
<param name="CII-SR-233" value="not(ram:SellerTradeParty/ram:DefinedTradeContact/ram:TelephoneUniversalCommunication/ram:ChannelCode)"/>
Expand Down Expand Up @@ -351,6 +356,10 @@
<param name="CII-SR-307" value="not(ram:SpecifiedProcuringProject/ram:Description)"/>
<param name="CII-SR-448" value="not(ram:UltimateCustomerOrderReferencedDocument)"/>
<param name="CII-SR-450" value="(not(ram:BuyerTradeParty/ram:ID) and ram:BuyerTradeParty/ram:GlobalID) or (ram:BuyerTradeParty/ram:ID and not(ram:BuyerTradeParty/ram:GlobalID)) or (not(ram:BuyerTradeParty/ram:ID) and not(ram:BuyerTradeParty/ram:GlobalID))"/>
<param name="CII-SR-455" value="( count(ram:SellerTradeParty/ram:DefinedTradeContact) &lt;= 1)"/>
<param name="CII-SR-456" value="( count(ram:BuyerTradeParty/ram:DefinedTradeContact) &lt;= 1)"/>
<param name="CII-SR-457" value="( count(ram:AdditionalReferencedDocument[ram:TypeCode='50']) &lt;= 1)"/>
<param name="CII-SR-458" value="( count(ram:AdditionalReferencedDocument[ram:TypeCode='130']) &lt;= 1)"/>

<!-- ApplicableHeaderTradeDelivery -->
<param name="CII-SR-308" value="not(ram:RelatedSupplyChainConsignment)"/>
Expand Down Expand Up @@ -486,9 +495,11 @@
<param name="CII-SR-435" value="not(ram:SpecifiedTradeSettlementFinancialCard)"/>
<param name="CII-SR-436" value="not(ram:SpecifiedAdvancePayment)"/>
<param name="CII-SR-437" value="not(ram:UltimatePayeeTradeParty)"/>

<param name="CII-SR-452" value="count(ram:SpecifiedTradePaymentTerms) &lt;= 1"/>
<param name="CII-SR-453" value="count(ram:SpecifiedTradePaymentTerms/ram:Description) &lt;= 1"/>

<!-- Invoice -->
<param name="CII-SR-438" value="not(ram:ValuationBreakdownStatement)"/>
<param name="CII-SR-438" value="not(ram:ValuationBreakdownStatement)"/>

<!-- SpecifiedTradeSettlementHeaderMonetarySummation -->

Expand Down
5 changes: 4 additions & 1 deletion cii/schematron/abstract/EN16931-CII-model.sch
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<rule context="$SpecifiedTradeAllowanceCharge">
<assert test="$BR-66" flag="fatal" id="BR-66">[BR-66]-Each Specified Trade Allowance Charge (BG-20)(BG-21) shall contain a Charge Indicator.</assert>
</rule>
<rule context="$DesignatedProductClassification">
<assert test="$BR-65" flag="fatal" id="BR-65">[BR-65]-The Item classification identifier (BT-158) shall have a Scheme identifier.</assert>
</rule>

<rule context="$Additional_supporting_documents ">
<assert test="$BR-52" flag="fatal" id="BR-52">[BR-52]-Each Additional supporting document (BG-24) shall contain a Supporting document reference (BT-122).</assert>
</rule>
Expand Down Expand Up @@ -101,7 +105,6 @@
<assert test="$BR-27" flag="fatal" id="BR-27">[BR-27]-The Item net price (BT-146) shall NOT be negative.</assert>
<assert test="$BR-28" flag="fatal" id="BR-28">[BR-28]-The Item gross price (BT-148) shall NOT be negative.</assert>
<assert test="$BR-64" flag="fatal" id="BR-64">[BR-64]-The Item standard identifier (BT-157) shall have a Scheme identifier.</assert>
<assert test="$BR-65" flag="fatal" id="BR-65">[BR-65]-The Item classification identifier (BT-158) shall have a Scheme identifier.</assert>
<assert test="$BR-CO-04" flag="fatal" id="BR-CO-04">[BR-CO-04]-Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).</assert>
<assert test="$BR-CO-18" flag="fatal" id="BR-CO-18">[BR-CO-18]-An Invoice shall at least have one VAT breakdown group (BG-23).</assert>
<assert test="$BR-DEC-23" flag="fatal" id="BR-DEC-23">[BR-DEC-23]-The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.</assert>
Expand Down
8 changes: 8 additions & 0 deletions cii/schematron/abstract/EN16931-CII-syntax.sch
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
<assert test="$CII-SR-218" flag="warning" id="CII-SR-218">[CII-SR-218] - PurchaseSpecifiedTradeAccountingAccount should not be present</assert>
<assert test="$CII-SR-219" flag="warning" id="CII-SR-219">[CII-SR-219] - SalesSpecifiedTradeAccountingAccount should not be present</assert>
<assert test="$CII-SR-220" flag="warning" id="CII-SR-220">[CII-SR-220] - SpecifiedTradeSettlementFinancialCard should not be present</assert>
<assert test="$CII-SR-454" flag="warning" id="CII-SR-454">[CII-SR-454] - Only one ApplicableTradeTax should be present</assert>

</rule>
<rule context="$ApplicableHeaderTradeAgreement ">
Expand Down Expand Up @@ -369,6 +370,11 @@
<assert test="$CII-SR-307" flag="warning" id="CII-SR-307">[CII-SR-307] - Description should not be present</assert>
<assert test="$CII-SR-448" flag="warning" id="CII-SR-448">[CII-SR-448] - UltimateCustomerOrderReferencedDocument should not be present</assert>
<assert test="$CII-SR-450" flag="warning" id="CII-SR-450">[CII-SR-450] - Only one buyer identifier should be present (either the ID or the Global ID)</assert>
<assert test="$CII-SR-455" flag="fatal" id="CII-SR-455">[CII-SR-455] - DefinedTradeContact of SellerTradeParty shall exist maximum once</assert>
<assert test="$CII-SR-456" flag="fatal" id="CII-SR-456">[CII-SR-456] - DefinedTradeContact of BuyerTradeParty shall exist maximum once</assert>
<assert test="$CII-SR-457" flag="warning" id="CII-SR-457">[CII-SR-457] - IssuerAssignedID with TypeCode 50 should exist maximum once</assert>
<assert test="$CII-SR-458" flag="warning" id="CII-SR-458">[CII-SR-458] - IssuerAssignedID with TypeCode 130 should exist maximum once</assert>

</rule>
<rule context="$ApplicableHeaderTradeDelivery ">
<assert test="$CII-SR-308" flag="warning" id="CII-SR-308">[CII-SR-308] - RelatedSupplyChainConsignment should not be present</assert>
Expand Down Expand Up @@ -506,6 +512,8 @@
<assert test="$CII-SR-435" flag="warning" id="CII-SR-435">[CII-SR-435] - SpecifiedTradeSettlementFinancialCard should not be present</assert>
<assert test="$CII-SR-436" flag="warning" id="CII-SR-436">[CII-SR-436] - SpecifiedAdvancePayment should not be present</assert>
<assert test="$CII-SR-437" flag="warning" id="CII-SR-437">[CII-SR-437] - UltimatePayeeTradeParty should not be present</assert>
<assert test="$CII-SR-452" flag="warning" id="CII-SR-452">[CII-SR-452] - Only one SpecifiedTradePaymentTerms should be present</assert>
<assert test="$CII-SR-453" flag="warning" id="CII-SR-453">[CII-SR-453] - Only one SpecifiedTradePaymentTerms Description should be present</assert>

</rule>
<rule context="$SpecifiedTradeSettlementHeaderMonetarySummation ">
Expand Down
6 changes: 3 additions & 3 deletions cii/schematron/codelist/EN16931-CII-codes.sch
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

<rule context="ram:TaxTotalAmount[@currencyID]" flag="fatal">
<assert
test="((not(contains(normalize-space(@currencyID), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(@currencyID), ' '))))"
test="((not(contains(normalize-space(@currencyID), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UYW UZS VES VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(@currencyID), ' '))))"
flag="fatal"
id="BR-CL-03">[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3</assert>
</rule>

<rule context="ram:InvoiceCurrencyCode" flag="fatal">
<assert
test="((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))"
test="((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UYW UZS VES VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))"
flag="fatal"
id="BR-CL-04">[BR-CL-04]-Invoice currency code MUST be coded using ISO code list 4217 alpha-3</assert>
</rule>

<rule context="ram:TaxCurrencyCode" flag="fatal">
<assert
test="((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))"
test="((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SLL SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UYW UZS VES VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))"
flag="fatal"
id="BR-CL-05">[BR-CL-05]-Tax currency code MUST be coded using ISO code list 4217 alpha-3</assert>
</rule>
Expand Down
Loading

0 comments on commit 8d3664d

Please sign in to comment.