Skip to content

Commit

Permalink
merge validation 1.3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
oriol committed Oct 3, 2024
2 parents 4f2a818 + bef4697 commit 018fb98
Show file tree
Hide file tree
Showing 11 changed files with 1,621 additions and 124 deletions.
2 changes: 1 addition & 1 deletion cii/schematron/CII/EN16931-CII-model.sch
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<param name="BR-AG-02" value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']"/>
<param name="BR-AG-03" value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']"/>
<param name="BR-AG-04" value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']"/>
<param name="BR-AG-05" value="ram:RateApplicablePercent &gt; 0"/>
<param name="BR-AG-05" value="ram:RateApplicablePercent &gt;= 0"/>
<param name="BR-AG-06" value="ram:RateApplicablePercent &gt; 0"/>
<param name="BR-AG-07" value="ram:RateApplicablePercent &gt; 0"/>
<param name="BR-AG-08" value="every $rate in ../ram:RateApplicablePercent/xs:decimal(.) satisfies (../ram:BasisAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement[ram:ApplicableTradeTax/ram:CategoryCode = 'M' and ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate]/ram:SpecifiedTradeSettlementLineMonetarySummation/xs:decimal(ram:LineTotalAmount)) * 10 * 10) div 100 + round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true() and ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate]/xs:decimal(ram:ActualAmount)) * 10 * 10) div 100 - round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false() and ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate]/xs:decimal(ram:ActualAmount)) * 10 * 10) div 100))"/>
Expand Down
11 changes: 7 additions & 4 deletions cii/schematron/CII/EN16931-CII-syntax.sch
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@
value="not(ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:CategoryTradeTax)"/>
<param name="CII-SR-131"
value="not(ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:ActualTradeCurrencyExchange)"/>
<param name="CII-SR-440"
value="count(ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:ActualAmount) &lt;= 1"/>

<param name="CII-SR-445" value="not(ram:GrossPriceProductTradePrice/ram:IncludedTradeTax)"/>
<param name="CII-SR-132"
value="not(ram:GrossPriceProductTradePrice/ram:ValiditySpecifiedPeriod)"/>
Expand Down Expand Up @@ -207,6 +204,11 @@
<param name="CII-SR-150" value="not(ram:IncludedSpecifiedMarketplace)"/>
<param name="CII-SR-447" value="not(ram:UltimateCustomerOrderReferencedDocument)"/>

<!-- AppliedTradeAllowanceCharge -->
<param name="CII-SR-440"
value="count(ram:ActualAmount) &lt;= 1"/>


<!-- SpecifiedLineTradeDelivery -->
<param name="CII-SR-151" value="not(ram:RequestedQuantity)"/>
<param name="CII-SR-152" value="not(ram:ReceivedQuantity)"/>
Expand Down Expand Up @@ -631,7 +633,7 @@
<param name="CII-SR-459" value="count(ram:SellerTradeParty/ram:URIUniversalCommunication) &lt;= 1"/>
<param name="CII-SR-460" value="count(ram:BuyerTradeParty/ram:URIUniversalCommunication) &lt;= 1"/>
<param name="CII-SR-461" value="count(ram:ApplicableTradeTax/ram:TaxPointDate) &lt;= 1"/>
<param name="CII-SR-462" value="count(ram:ApplicableTradeTax/ram:DueDateTypeCode) &lt;= 1"/>
<param name="CII-SR-462" value="count(//ram:ApplicableTradeTax/ram:DueDateTypeCode) = 0 or count(distinct-values(//ram:ApplicableTradeTax/ram:DueDateTypeCode)) = 1"/>

<!-- Invoice -->
<param name="CII-SR-438" value="not(ram:ValuationBreakdownStatement)"/>
Expand Down Expand Up @@ -815,4 +817,5 @@
<param name="SpecifiedTradeSettlementHeaderMonetarySummation"
value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation"/>
<param name="DateTimeString" value="//udt:DateTimeString[@format = '102']"/>
<param name="AppliedTradeAllowanceCharge" value="//ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge"/>
</pattern>
8 changes: 5 additions & 3 deletions cii/schematron/abstract/EN16931-CII-syntax.sch
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
<assert test="$CII-SR-129" flag="warning" id="CII-SR-129">[CII-SR-129] - TypeCode should not be present</assert>
<assert test="$CII-SR-130" flag="warning" id="CII-SR-130">[CII-SR-130] - CategoryTradeTax should not be present</assert>
<assert test="$CII-SR-131" flag="warning" id="CII-SR-131">[CII-SR-131] - ActualTradeCurrencyExchange should not be present</assert>
<assert test="$CII-SR-440" flag="fatal" id="CII-SR-440">[CII-SR-440] - ActualAmount should exist maximum once</assert>

<assert test="$CII-SR-445" flag="warning" id="CII-SR-445">[CII-SR-445] - IncludedTradeTax should not be present</assert>
<assert test="$CII-SR-132" flag="warning" id="CII-SR-132">[CII-SR-132] - ValiditySpecifiedPeriod should not be present</assert>
Expand Down Expand Up @@ -189,6 +188,9 @@
<assert test="$CII-SR-447" flag="warning" id="CII-SR-447">[CII-SR-447] - UltimateCustomerOrderReferencedDocument should not be present</assert>

</rule>
<rule context="$AppliedTradeAllowanceCharge">
<assert test="$CII-SR-440" flag="fatal" id="CII-SR-440">[CII-SR-440] - ActualAmount should exist maximum once</assert>
</rule>
<rule context="$SpecifiedLineTradeDelivery">
<assert test="$CII-SR-151" flag="warning" id="CII-SR-151">[CII-SR-151] - RequestedQuantity should not be present</assert>
<assert test="$CII-SR-152" flag="warning" id="CII-SR-152">[CII-SR-152] - ReceivedQuantity should not be present</assert>
Expand Down Expand Up @@ -373,8 +375,8 @@
<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>
<assert test="$CII-SR-459" flag="warning" id="CII-SR-459">[CII-SR-459] - SellerTradeParty URIUniversalCommunication should exist maximum once</assert>
<assert test="$CII-SR-460" flag="warning" id="CII-SR-460">[CII-SR-460] - BuyerTradeParty URIUniversalCommunication should exist maximum once</assert>
<assert test="$CII-SR-459" flag="fatal" id="CII-SR-459">[CII-SR-459] - SellerTradeParty URIUniversalCommunication should exist maximum once</assert>
<assert test="$CII-SR-460" flag="fatal" id="CII-SR-460">[CII-SR-460] - BuyerTradeParty URIUniversalCommunication 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
Loading

0 comments on commit 018fb98

Please sign in to comment.