|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<xsl:transform xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
xmlns:error="https://doi.org/10.5281/zenodo.1495494#error"
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
xmlns:sch="http://purl.oclc.org/dsdl/schematron"
|
|
xmlns:schxslt="https://doi.org/10.5281/zenodo.1495494"
|
|
xmlns:schxslt-api="https://doi.org/10.5281/zenodo.1495494#api"
|
|
xmlns:u="utils"
|
|
xmlns:ubl-creditnote="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
|
|
xmlns:ubl-invoice="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
version="2.0">
|
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
xmlns:dct="http://purl.org/dc/terms/"
|
|
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
|
|
<dct:creator>
|
|
<dct:Agent>
|
|
<skos:prefLabel>SchXslt/1.9.5 SAXON/PE 11.5</skos:prefLabel>
|
|
<schxslt.compile.typed-variables xmlns="https://doi.org/10.5281/zenodo.1495494#">true</schxslt.compile.typed-variables>
|
|
</dct:Agent>
|
|
</dct:creator>
|
|
<dct:created>2023-06-02T12:19:52.561+02:00</dct:created>
|
|
</rdf:Description>
|
|
<xsl:output indent="yes"/>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:gln"
|
|
as="xs:boolean">
|
|
<param name="val"/>
|
|
<variable name="length" select="string-length($val) - 1"/>
|
|
<variable name="digits"
|
|
select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
|
<variable name="weightedSum"
|
|
select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (1 + ((($i + 1) mod 2) * 2)))"/>
|
|
<value-of select="(10 - ($weightedSum mod 10)) mod 10 = number(substring($val, $length + 1, 1))"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:slack"
|
|
as="xs:boolean">
|
|
<param name="exp" as="xs:decimal"/>
|
|
<param name="val" as="xs:decimal"/>
|
|
<param name="slack" as="xs:decimal"/>
|
|
<value-of select="xs:decimal($exp + $slack) >= $val and xs:decimal($exp - $slack) <= $val"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:mod11"
|
|
as="xs:boolean">
|
|
<param name="val"/>
|
|
<variable name="length" select="string-length($val) - 1"/>
|
|
<variable name="digits"
|
|
select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
|
<variable name="weightedSum"
|
|
select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (($i mod 6) + 2))"/>
|
|
<value-of select="number($val) > 0 and (11 - ($weightedSum mod 11)) mod 11 = number(substring($val, $length + 1, 1))"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:mod97-0208"
|
|
as="xs:boolean">
|
|
<param name="val"/>
|
|
<variable name="checkdigits" select="substring($val,9,2)"/>
|
|
<variable name="calculated_digits"
|
|
select="xs:string(97 - (xs:integer(substring($val,1,8)) mod 97))"/>
|
|
<value-of select="number($checkdigits) = number($calculated_digits)"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:checkCodiceIPA"
|
|
as="xs:boolean">
|
|
<param name="arg" as="xs:string?"/>
|
|
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</variable>
|
|
<sequence select="if ( (string-length(translate($arg, $allowed-characters, '')) = 0) and (string-length($arg) = 6) ) then true() else false()"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:checkCF"
|
|
as="xs:boolean">
|
|
<param name="arg" as="xs:string?"/>
|
|
<sequence select=" if ( (string-length($arg) = 16) or (string-length($arg) = 11) ) then ( if ((string-length($arg) = 16)) then ( if (u:checkCF16($arg)) then ( true() ) else ( false() ) ) else ( if(($arg castable as xs:integer)) then true() else false() ) ) else ( false() ) "/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:checkCF16"
|
|
as="xs:boolean">
|
|
<param name="arg" as="xs:string?"/>
|
|
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</variable>
|
|
<sequence select=" if ( (string-length(translate(substring($arg,1,6), $allowed-characters, '')) = 0) and (substring($arg,7,2) castable as xs:integer) and (string-length(translate(substring($arg,9,1), $allowed-characters, '')) = 0) and (substring($arg,10,2) castable as xs:integer) and (substring($arg,12,3) castable as xs:string) and (substring($arg,15,1) castable as xs:integer) and (string-length(translate(substring($arg,16,1), $allowed-characters, '')) = 0) ) then true() else false() "/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:checkPIVAseIT"
|
|
as="xs:boolean">
|
|
<param name="arg" as="xs:string"/>
|
|
<variable name="paese" select="substring($arg,1,2)"/>
|
|
<variable name="codice" select="substring($arg,3)"/>
|
|
<sequence select=" if ( $paese = 'IT' or $paese = 'it' ) then ( if ( ( string-length($codice) = 11 ) and ( if (u:checkPIVA($codice)!=0) then false() else true() )) then ( true() ) else ( false() ) ) else ( true() ) "/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:checkPIVA"
|
|
as="xs:integer">
|
|
<param name="arg" as="xs:string?"/>
|
|
<sequence select=" if (not($arg castable as xs:integer)) then 1 else ( u:addPIVA($arg,xs:integer(0)) mod 10 )"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:addPIVA"
|
|
as="xs:integer">
|
|
<param name="arg" as="xs:string"/>
|
|
<param name="pari" as="xs:integer"/>
|
|
<variable name="tappo"
|
|
select="if (not($arg castable as xs:integer)) then 0 else 1"/>
|
|
<variable name="mapper"
|
|
select="if ($tappo = 0) then 0 else ( if ($pari = 1) then ( xs:integer(substring('0246813579', ( xs:integer(substring($arg,1,1)) +1 ) ,1)) ) else ( xs:integer(substring($arg,1,1) ) ) )"/>
|
|
<sequence select="if ($tappo = 0) then $mapper else ( xs:integer($mapper) + u:addPIVA(substring(xs:string($arg),2), (if($pari=0) then 1 else 0) ) )"/>
|
|
</function>
|
|
<function xmlns="http://www.w3.org/1999/XSL/Transform"
|
|
name="u:abn"
|
|
as="xs:boolean">
|
|
<param name="val"/>
|
|
<value-of select="( ((string-to-codepoints(substring($val,1,1)) - 49) * 10) + ((string-to-codepoints(substring($val,2,1)) - 48) * 1) + ((string-to-codepoints(substring($val,3,1)) - 48) * 3) + ((string-to-codepoints(substring($val,4,1)) - 48) * 5) + ((string-to-codepoints(substring($val,5,1)) - 48) * 7) + ((string-to-codepoints(substring($val,6,1)) - 48) * 9) + ((string-to-codepoints(substring($val,7,1)) - 48) * 11) + ((string-to-codepoints(substring($val,8,1)) - 48) * 13) + ((string-to-codepoints(substring($val,9,1)) - 48) * 15) + ((string-to-codepoints(substring($val,10,1)) - 48) * 17) + ((string-to-codepoints(substring($val,11,1)) - 48) * 19)) mod 89 = 0 "/>
|
|
</function>
|
|
<xsl:param name="profile"
|
|
select=" if (/*/cbc:ProfileID and matches(normalize-space(/*/cbc:ProfileID), 'urn:fdc:peppol.eu:2017:poacc:billing:([0-9]{2}):1.0')) then tokenize(normalize-space(/*/cbc:ProfileID), ':')[7] else 'Unknown'"/>
|
|
<xsl:param name="supplierCountry"
|
|
select=" if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
|
<xsl:param name="customerCountry"
|
|
select=" if (/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
|
<xsl:param name="documentCurrencyCode" select="/*/cbc:DocumentCurrencyCode"/>
|
|
<xsl:param name="isGreekSender"
|
|
select="($supplierCountry ='GR') or ($supplierCountry ='EL')"/>
|
|
<xsl:param name="isGreekReceiver"
|
|
select="($customerCountry ='GR') or ($customerCountry ='EL')"/>
|
|
<xsl:param name="isGreekSenderandReceiver"
|
|
select="$isGreekSender and $isGreekReceiver"/>
|
|
<xsl:param name="accountingSupplierCountry"
|
|
select=" if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
|
<xsl:variable name="DKSupplierCountry"
|
|
select="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
|
<xsl:variable name="DKCustomerCountry"
|
|
select="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
|
<xsl:variable name="dateRegExp"
|
|
select="'^(0?[1-9]|[12][0-9]|3[01])[-\\/ ]?(0?[1-9]|1[0-2])[-\\/ ]?(19|20)[0-9]{2}'"/>
|
|
<xsl:variable name="greekDocumentType"
|
|
select="tokenize('1.1 1.2 1.3 1.4 1.5 1.6 2.1 2.2 2.3 2.4 3.1 3.2 4 5.1 5.2 6.1 6.2 7.1 8.1 8.2 11.1 11.2 11.3 11.4 11.5','\s')"/>
|
|
<xsl:variable name="tokenizedUblIssueDate" select="tokenize(/*/cbc:IssueDate,'-')"/>
|
|
<xsl:variable name="SupplierCountry"
|
|
select="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
|
<xsl:variable name="CustomerCountry"
|
|
select="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
|
<xsl:variable name="supplierCountryIsNL"
|
|
select="(upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
|
<xsl:variable name="customerCountryIsNL"
|
|
select="(upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
|
<xsl:variable name="taxRepresentativeCountryIsNL"
|
|
select="(upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
|
<xsl:variable name="ISO3166"
|
|
select="tokenize('AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW 1A XI', '\s')"/>
|
|
<xsl:variable name="ISO4217"
|
|
select="tokenize('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 SLL SOS SRD SSP STN 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', '\s')"/>
|
|
<xsl:variable name="MIMECODE"
|
|
select="tokenize('application/pdf image/png image/jpeg text/csv application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet', '\s')"/>
|
|
<xsl:variable name="UNCL2005" select="tokenize('3 35 432', '\s')"/>
|
|
<xsl:variable name="UNCL5189"
|
|
select="tokenize('41 42 60 62 63 64 65 66 67 68 70 71 88 95 100 102 103 104 105', '\s')"/>
|
|
<xsl:variable name="UNCL7161"
|
|
select="tokenize('AA AAA AAC AAD AAE AAF AAH AAI AAS AAT AAV AAY AAZ ABA ABB ABC ABD ABF ABK ABL ABN ABR ABS ABT ABU ACF ACG ACH ACI ACJ ACK ACL ACM ACS ADC ADE ADJ ADK ADL ADM ADN ADO ADP ADQ ADR ADT ADW ADY ADZ AEA AEB AEC AED AEF AEH AEI AEJ AEK AEL AEM AEN AEO AEP AES AET AEU AEV AEW AEX AEY AEZ AJ AU CA CAB CAD CAE CAF CAI CAJ CAK CAL CAM CAN CAO CAP CAQ CAR CAS CAT CAU CAV CAW CAX CAY CAZ CD CG CS CT DAB DAC DAD DAF DAG DAH DAI DAJ DAK DAL DAM DAN DAO DAP DAQ DL EG EP ER FAA FAB FAC FC FH FI GAA HAA HD HH IAA IAB ID IF IR IS KO L1 LA LAA LAB LF MAE MI ML NAA OA PA PAA PC PL RAB RAC RAD RAF RE RF RH RV SA SAA SAD SAE SAI SG SH SM SU TAB TAC TT TV V1 V2 WH XAA YY ZZZ', '\s')"/>
|
|
<xsl:variable name="UNCL5305" select="tokenize('AE E S Z G O K L M', '\s')"/>
|
|
<xsl:variable name="eaid"
|
|
select="tokenize('0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0151 0183 0184 0188 0190 0191 0192 0193 0195 0196 0198 0199 0200 0201 0202 0204 0208 0209 0210 0211 0212 0213 0215 0216 9901 9910 9913 9914 9915 9918 9919 9920 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9955 9957 9959', '\s')"/>
|
|
<xsl:template match="root()">
|
|
<xsl:variable name="metadata" as="element()?">
|
|
<svrl:metadata xmlns:dct="http://purl.org/dc/terms/"
|
|
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
|
|
xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<dct:creator>
|
|
<dct:Agent>
|
|
<skos:prefLabel>
|
|
<xsl:value-of separator="/"
|
|
select="(system-property('xsl:product-name'), system-property('xsl:product-version'))"/>
|
|
</skos:prefLabel>
|
|
</dct:Agent>
|
|
</dct:creator>
|
|
<dct:created>
|
|
<xsl:value-of select="current-dateTime()"/>
|
|
</dct:created>
|
|
<dct:source>
|
|
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
<dct:creator>
|
|
<dct:Agent>
|
|
<skos:prefLabel>SchXslt/1.9.5 SAXON/PE 11.5</skos:prefLabel>
|
|
<schxslt.compile.typed-variables xmlns="https://doi.org/10.5281/zenodo.1495494#">true</schxslt.compile.typed-variables>
|
|
</dct:Agent>
|
|
</dct:creator>
|
|
<dct:created>2023-06-02T12:19:52.561+02:00</dct:created>
|
|
</rdf:Description>
|
|
</dct:source>
|
|
</svrl:metadata>
|
|
</xsl:variable>
|
|
<xsl:variable name="report" as="element(schxslt:report)">
|
|
<schxslt:report>
|
|
<xsl:call-template name="d13e149"/>
|
|
</schxslt:report>
|
|
</xsl:variable>
|
|
<xsl:variable name="schxslt:report" as="node()*">
|
|
<xsl:sequence select="$metadata"/>
|
|
<xsl:for-each select="$report/schxslt:document">
|
|
<xsl:for-each select="schxslt:pattern">
|
|
<xsl:sequence select="node()"/>
|
|
<xsl:sequence select="../schxslt:rule[@pattern = current()/@id]/node()"/>
|
|
</xsl:for-each>
|
|
</xsl:for-each>
|
|
</xsl:variable>
|
|
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
schemaVersion="iso"
|
|
title="Rules for Peppol BIS 3.0 Billing">
|
|
<svrl:ns-prefix-in-attribute-values prefix="cbc"
|
|
uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"/>
|
|
<svrl:ns-prefix-in-attribute-values prefix="cac"
|
|
uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"/>
|
|
<svrl:ns-prefix-in-attribute-values prefix="ubl-creditnote"
|
|
uri="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"/>
|
|
<svrl:ns-prefix-in-attribute-values prefix="ubl-invoice"
|
|
uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"/>
|
|
<svrl:ns-prefix-in-attribute-values prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
|
|
<svrl:ns-prefix-in-attribute-values prefix="u" uri="utils"/>
|
|
<xsl:sequence select="$schxslt:report"/>
|
|
</svrl:schematron-output>
|
|
</xsl:template>
|
|
<xsl:template match="text() | @*" mode="#all" priority="-10"/>
|
|
<xsl:template match="/" mode="#all" priority="-10">
|
|
<xsl:apply-templates mode="#current" select="node()"/>
|
|
</xsl:template>
|
|
<xsl:template match="*" mode="#all" priority="-10">
|
|
<xsl:apply-templates mode="#current" select="@*"/>
|
|
<xsl:apply-templates mode="#current" select="node()"/>
|
|
</xsl:template>
|
|
<xsl:template name="d13e149">
|
|
<schxslt:document>
|
|
<schxslt:pattern id="d13e149">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e160">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e169">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e405">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e421">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e492">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e516">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e608">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e734">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e755">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e801">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<schxslt:pattern id="d13e887">
|
|
<xsl:if test="exists(base-uri(root()))">
|
|
<xsl:attribute name="documents" select="base-uri(root())"/>
|
|
</xsl:if>
|
|
<xsl:for-each select="root()">
|
|
<svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="documents" select="base-uri(.)"/>
|
|
</svrl:active-pattern>
|
|
</xsl:for-each>
|
|
</schxslt:pattern>
|
|
<xsl:apply-templates mode="d13e149" select="root()"/>
|
|
</schxslt:document>
|
|
</xsl:template>
|
|
<xsl:template match="//*[not(*) and not(normalize-space())]"
|
|
priority="80"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e149']">
|
|
<schxslt:rule pattern="d13e149">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//*[not(*) and not(normalize-space())]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//*[not(*) and not(normalize-space())]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e149">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//*[not(*) and not(normalize-space())]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(false())">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R008">
|
|
<xsl:attribute name="test">false()</xsl:attribute>
|
|
<svrl:text>Document MUST not contain empty elements.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e149')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote" priority="79" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e160']">
|
|
<schxslt:rule pattern="d13e160">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e160">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not((count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='50']) <= 1))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R080">
|
|
<xsl:attribute name="test">(count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='50']) <= 1)</xsl:attribute>
|
|
<svrl:text>Only one project reference is allowed on document level</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e160')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote | ubl-invoice:Invoice"
|
|
priority="78"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote | ubl-invoice:Invoice" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote | ubl-invoice:Invoice</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote | ubl-invoice:Invoice</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:ProfileID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R001">
|
|
<xsl:attribute name="test">cbc:ProfileID</xsl:attribute>
|
|
<svrl:text>Business process MUST be provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not($profile != 'Unknown')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R007">
|
|
<xsl:attribute name="test">$profile != 'Unknown'</xsl:attribute>
|
|
<svrl:text>Business process MUST be in the format 'urn:fdc:peppol.eu:2017:poacc:billing:NN:1.0' where NN indicates the process number.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(count(cbc:Note) <= 1)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R002">
|
|
<xsl:attribute name="test">count(cbc:Note) <= 1</xsl:attribute>
|
|
<svrl:text>No more than one note is allowed on document level.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(cbc:BuyerReference or cac:OrderReference/cbc:ID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R003">
|
|
<xsl:attribute name="test">cbc:BuyerReference or cac:OrderReference/cbc:ID</xsl:attribute>
|
|
<svrl:text>A buyer reference or purchase order reference MUST be provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R004">
|
|
<xsl:attribute name="test">starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0')</xsl:attribute>
|
|
<svrl:text>Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(count(cac:TaxTotal[cac:TaxSubtotal]) = 1)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R053">
|
|
<xsl:attribute name="test">count(cac:TaxTotal[cac:TaxSubtotal]) = 1</xsl:attribute>
|
|
<svrl:text>Only one tax total with tax subtotals MUST be provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R054">
|
|
<xsl:attribute name="test">count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0)</xsl:attribute>
|
|
<svrl:text>Only one tax total without tax subtotals MUST be provided when tax currency code is provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not(cbc:TaxCurrencyCode) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] <= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] <= 0) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] >= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] >= 0) )">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R055">
|
|
<xsl:attribute name="test">not(cbc:TaxCurrencyCode) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] <= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] <= 0) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] >= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] >= 0) </xsl:attribute>
|
|
<svrl:text>Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='130']) <= 1))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R006">
|
|
<xsl:attribute name="test">(count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='130']) <= 1)</xsl:attribute>
|
|
<svrl:text>Only one invoiced object is allowed on document level</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:TaxCurrencyCode" priority="77" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:TaxCurrencyCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:TaxCurrencyCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:TaxCurrencyCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(not(normalize-space(text()) = normalize-space(../cbc:DocumentCurrencyCode/text())))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R005">
|
|
<xsl:attribute name="test">not(normalize-space(text()) = normalize-space(../cbc:DocumentCurrencyCode/text()))</xsl:attribute>
|
|
<svrl:text>VAT accounting currency code MUST be different from invoice currency code when provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty/cac:Party"
|
|
priority="76"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty/cac:Party" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:EndpointID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R010">
|
|
<xsl:attribute name="test">cbc:EndpointID</xsl:attribute>
|
|
<svrl:text>Buyer electronic address MUST be provided</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party"
|
|
priority="75"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:EndpointID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R020">
|
|
<xsl:attribute name="test">cbc:EndpointID</xsl:attribute>
|
|
<svrl:text>Seller electronic address MUST be provided</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]"
|
|
priority="74"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(false())">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R041">
|
|
<xsl:attribute name="test">false()</xsl:attribute>
|
|
<svrl:text>Allowance/charge base amount MUST be provided when allowance/charge percentage is provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]"
|
|
priority="73"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(false())">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R042">
|
|
<xsl:attribute name="test">false()</xsl:attribute>
|
|
<svrl:text>Allowance/charge percentage MUST be provided when allowance/charge base amount is provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge"
|
|
priority="72"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then cbc:Amount else 0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, 0.02))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R040">
|
|
<xsl:attribute name="test"> not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then cbc:Amount else 0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, 0.02)</xsl:attribute>
|
|
<svrl:text>Allowance/charge amount must equal base amount * percentage/100 if base amount and percentage exists</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(normalize-space(cbc:ChargeIndicator/text()) = 'true' or normalize-space(cbc:ChargeIndicator/text()) = 'false')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R043">
|
|
<xsl:attribute name="test">normalize-space(cbc:ChargeIndicator/text()) = 'true' or normalize-space(cbc:ChargeIndicator/text()) = 'false'</xsl:attribute>
|
|
<svrl:text>Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match=" cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]"
|
|
priority="71"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context " cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context"> cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context"> cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cac:PaymentMandate/cbc:ID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R061">
|
|
<xsl:attribute name="test">cac:PaymentMandate/cbc:ID</xsl:attribute>
|
|
<svrl:text>Mandate reference MUST be provided for direct debit.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount"
|
|
priority="70"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(@currencyID = $documentCurrencyCode)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R051">
|
|
<xsl:attribute name="test">@currencyID = $documentCurrencyCode</xsl:attribute>
|
|
<svrl:text>All currencyID attributes must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate"
|
|
priority="69"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(xs:date(text()) >= xs:date(../../../cac:InvoicePeriod/cbc:StartDate))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R110">
|
|
<xsl:attribute name="test">xs:date(text()) >= xs:date(../../../cac:InvoicePeriod/cbc:StartDate)</xsl:attribute>
|
|
<svrl:text>Start date of line period MUST be within invoice period.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate"
|
|
priority="68"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(xs:date(text()) <= xs:date(../../../cac:InvoicePeriod/cbc:EndDate))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R111">
|
|
<xsl:attribute name="test">xs:date(text()) <= xs:date(../../../cac:InvoicePeriod/cbc:EndDate)</xsl:attribute>
|
|
<svrl:text>End date of line period MUST be within invoice period.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:InvoiceLine | cac:CreditNoteLine"
|
|
priority="67"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:variable name="lineExtensionAmount"
|
|
select=" if (cbc:LineExtensionAmount) then xs:decimal(cbc:LineExtensionAmount) else 0"/>
|
|
<xsl:variable name="quantity"
|
|
select=" if (/ubl-invoice:Invoice) then (if (cbc:InvoicedQuantity) then xs:decimal(cbc:InvoicedQuantity) else 1) else (if (cbc:CreditedQuantity) then xs:decimal(cbc:CreditedQuantity) else 1)"/>
|
|
<xsl:variable name="priceAmount"
|
|
select=" if (cac:Price/cbc:PriceAmount) then xs:decimal(cac:Price/cbc:PriceAmount) else 0"/>
|
|
<xsl:variable name="baseQuantity"
|
|
select=" if (cac:Price/cbc:BaseQuantity and xs:decimal(cac:Price/cbc:BaseQuantity) != 0) then xs:decimal(cac:Price/cbc:BaseQuantity) else 1"/>
|
|
<xsl:variable name="allowancesTotal"
|
|
select=" if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']) then round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100 else 0"/>
|
|
<xsl:variable name="chargesTotal"
|
|
select=" if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']) then round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100 else 0"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:InvoiceLine | cac:CreditNoteLine" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:InvoiceLine | cac:CreditNoteLine</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:InvoiceLine | cac:CreditNoteLine</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R120">
|
|
<xsl:attribute name="test">u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)</xsl:attribute>
|
|
<svrl:text>Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not(cac:Price/cbc:BaseQuantity) or xs:decimal(cac:Price/cbc:BaseQuantity) > 0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R121">
|
|
<xsl:attribute name="test">not(cac:Price/cbc:BaseQuantity) or xs:decimal(cac:Price/cbc:BaseQuantity) > 0</xsl:attribute>
|
|
<svrl:text>Base quantity MUST be a positive number above zero.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((count(cac:DocumentReference) <= 1))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R100">
|
|
<xsl:attribute name="test">(count(cac:DocumentReference) <= 1)</xsl:attribute>
|
|
<svrl:text>Only one invoiced object is allowed pr line</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130')))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R101">
|
|
<xsl:attribute name="test">(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))</xsl:attribute>
|
|
<svrl:text>Element Document reference can only be used for Invoice line object</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:Price/cac:AllowanceCharge" priority="66" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:Price/cac:AllowanceCharge" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:Price/cac:AllowanceCharge</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:Price/cac:AllowanceCharge</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ChargeIndicator) = 'false')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R044">
|
|
<xsl:attribute name="test">normalize-space(cbc:ChargeIndicator) = 'false'</xsl:attribute>
|
|
<svrl:text>Charge on price level is NOT allowed. Only value 'false' allowed.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R046">
|
|
<xsl:attribute name="test">not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount)</xsl:attribute>
|
|
<svrl:text>Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:Price/cbc:BaseQuantity[@unitCode]"
|
|
priority="65"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:variable name="hasQuantity"
|
|
select="../../cbc:InvoicedQuantity or ../../cbc:CreditedQuantity"/>
|
|
<xsl:variable name="quantity"
|
|
select=" if (/ubl-invoice:Invoice) then ../../cbc:InvoicedQuantity else ../../cbc:CreditedQuantity"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:Price/cbc:BaseQuantity[@unitCode]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:Price/cbc:BaseQuantity[@unitCode]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:Price/cbc:BaseQuantity[@unitCode]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(not($hasQuantity) or @unitCode = $quantity/@unitCode)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-R130">
|
|
<xsl:attribute name="test">not($hasQuantity) or @unitCode = $quantity/@unitCode</xsl:attribute>
|
|
<svrl:text>Unit code of price base quantity MUST be same as invoiced quantity.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']"
|
|
priority="64"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(normalize-space(), '^[0-9]+$') and u:gln(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-COMMON-R040">
|
|
<xsl:attribute name="test">matches(normalize-space(), '^[0-9]+$') and u:gln(normalize-space())</xsl:attribute>
|
|
<svrl:text>GLN must have a valid format according to GS1 rules.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']"
|
|
priority="63"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(normalize-space(), '^[0-9]{9}$') and u:mod11(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-COMMON-R041">
|
|
<xsl:attribute name="test">matches(normalize-space(), '^[0-9]{9}$') and u:mod11(normalize-space())</xsl:attribute>
|
|
<svrl:text>Norwegian organization number MUST be stated in the correct format.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']"
|
|
priority="62"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not((string-length(text()) = 10) and (substring(text(), 1, 2) = 'DK') and (string-length(translate(substring(text(), 3, 8), '1234567890', '')) = 0))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-COMMON-R042">
|
|
<xsl:attribute name="test">(string-length(text()) = 10) and (substring(text(), 1, 2) = 'DK') and (string-length(translate(substring(text(), 3, 8), '1234567890', '')) = 0)</xsl:attribute>
|
|
<svrl:text>Danish organization number (CVR) MUST be stated in the correct format.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']"
|
|
priority="61"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(normalize-space(), '^[0-9]{10}$') and u:mod97-0208(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-COMMON-R043">
|
|
<xsl:attribute name="test">matches(normalize-space(), '^[0-9]{10}$') and u:mod97-0208(normalize-space())</xsl:attribute>
|
|
<svrl:text>Belgian enterprise number MUST be stated in the correct format.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']"
|
|
priority="60"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(u:checkCodiceIPA(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="PEPPOL-COMMON-R044">
|
|
<xsl:attribute name="test">u:checkCodiceIPA(normalize-space())</xsl:attribute>
|
|
<svrl:text>IPA Code (Codice Univoco Unità Organizzativa) must be stated in the correct format</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']"
|
|
priority="59"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(u:checkCF(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="PEPPOL-COMMON-R045">
|
|
<xsl:attribute name="test">u:checkCF(normalize-space())</xsl:attribute>
|
|
<svrl:text>Tax Code (Codice Fiscale) must be stated in the correct format</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '9907']"
|
|
priority="58"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '9907']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '9907']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '9907']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(u:checkCF(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="PEPPOL-COMMON-R046">
|
|
<xsl:attribute name="test">u:checkCF(normalize-space())</xsl:attribute>
|
|
<svrl:text>Tax Code (Codice Fiscale) must be stated in the correct format</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']"
|
|
priority="57"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(u:checkPIVAseIT(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="PEPPOL-COMMON-R047">
|
|
<xsl:attribute name="test">u:checkPIVAseIT(normalize-space())</xsl:attribute>
|
|
<svrl:text>Italian VAT Code (Partita Iva) must be stated in the correct format</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']"
|
|
priority="56"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-COMMON-R049">
|
|
<xsl:attribute name="test">string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN'</xsl:attribute>
|
|
<svrl:text>Swedish organization number MUST be stated in the correct format.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']"
|
|
priority="55"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e169']">
|
|
<schxslt:rule pattern="d13e169">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e169">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(normalize-space(), '^[0-9]{11}$') and u:abn(normalize-space()))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="PEPPOL-COMMON-R050">
|
|
<xsl:attribute name="test">matches(normalize-space(), '^[0-9]{11}$') and u:abn(normalize-space())</xsl:attribute>
|
|
<svrl:text>Australian Business Number (ABN) MUST be stated in the correct format.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e169')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']"
|
|
priority="54"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e405']">
|
|
<schxslt:rule pattern="d13e405">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e405">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'TAX']/cbc:CompanyID) = 'Foretaksregisteret')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="NO-R-002">
|
|
<xsl:attribute name="test">normalize-space(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'TAX']/cbc:CompanyID) = 'Foretaksregisteret'</xsl:attribute>
|
|
<svrl:text>For Norwegian suppliers, most invoice issuers are required to append "Foretaksregisteret" to their
|
|
invoice. "Dersom selger er aksjeselskap, allmennaksjeselskap eller filial av utenlandsk
|
|
selskap skal også ordet «Foretaksregisteret» fremgå av salgsdokumentet, jf.
|
|
foretaksregisterloven § 10-2."</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO' and matches(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID,3), '^[0-9]{9}MVA$') and u:mod11(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID, 3, 9)) or not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO'))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NO-R-001">
|
|
<xsl:attribute name="test">cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO' and matches(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID,3), '^[0-9]{9}MVA$') and u:mod11(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID, 3, 9)) or not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO')</xsl:attribute>
|
|
<svrl:text>For Norwegian suppliers, a VAT number MUST be the country code prefix NO followed by a valid Norwegian organization number (nine numbers) followed by the letters MVA.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e405')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']"
|
|
priority="53"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e421']">
|
|
<schxslt:rule pattern="d13e421">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e421">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not((normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/text()) != ''))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-002">
|
|
<xsl:attribute name="test">(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/text()) != '')</xsl:attribute>
|
|
<svrl:text>Danish suppliers MUST provide legal entity (CVR-number)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not(((boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID)) and (normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID) != '0184')) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-014">
|
|
<xsl:attribute name="test">not(((boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID)) and (normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID) != '0184')) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers it is mandatory to specify schemeID as "0184" (DK CVR-number) when PartyLegalEntity/CompanyID is used for AccountingSupplierParty</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-016">
|
|
<xsl:attribute name="test">not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers, a Credit note cannot have a negative total (PayableAmount)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e421')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification"
|
|
priority="52"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e421']">
|
|
<schxslt:rule pattern="d13e421">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e421">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(not((boolean(cbc:ID)) and (normalize-space(cbc:ID/@schemeID) = '') ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-013">
|
|
<xsl:attribute name="test">not((boolean(cbc:ID)) and (normalize-space(cbc:ID/@schemeID) = '') )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers it is mandatory to use schemeID when PartyIdentification/ID is used for AccountingCustomerParty or AccountingSupplierParty</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e421')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans"
|
|
priority="51"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e421']">
|
|
<schxslt:rule pattern="d13e421">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e421">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', cbc:PaymentMeansCode, ' ')))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-005">
|
|
<xsl:attribute name="test">contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', cbc:PaymentMeansCode, ' '))</xsl:attribute>
|
|
<svrl:text>For Danish suppliers the following Payment means codes are allowed: 1, 10, 31, 42, 48, 49, 50, 58, 59, 93 and 97</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not(((cbc:PaymentMeansCode = '31') or (cbc:PaymentMeansCode = '42')) and not((normalize-space(cac:PayeeFinancialAccount/cbc:ID/text()) != '') and (normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID/text()) != '')) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-006">
|
|
<xsl:attribute name="test">not(((cbc:PaymentMeansCode = '31') or (cbc:PaymentMeansCode = '42')) and not((normalize-space(cac:PayeeFinancialAccount/cbc:ID/text()) != '') and (normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID/text()) != '')) )</xsl:attribute>
|
|
<svrl:text>For Danish suppliers bank account and registration account is mandatory if payment means is 31 or 42</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((cbc:PaymentMeansCode = '49') and not((normalize-space(cac:PaymentMandate/cbc:ID/text()) != '') and (normalize-space(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID/text()) != '')) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-007">
|
|
<xsl:attribute name="test">not((cbc:PaymentMeansCode = '49') and not((normalize-space(cac:PaymentMandate/cbc:ID/text()) != '') and (normalize-space(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID/text()) != '')) )</xsl:attribute>
|
|
<svrl:text>For Danish suppliers PaymentMandate/ID and PayerFinancialAccount/ID are mandatory when payment means is 49</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((cbc:PaymentMeansCode = '50') and not(((substring(cbc:PaymentID, 1, 3) = '01#') or (substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 7) ) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-008">
|
|
<xsl:attribute name="test">not((cbc:PaymentMeansCode = '50') and not(((substring(cbc:PaymentID, 1, 3) = '01#') or (substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 7) ) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers PaymentID is mandatory and MUST start with 01#, 04# or 15# (kortartkode), and PayeeFinancialAccount/ID (Giro kontonummer) is mandatory and must be 7 characters long, when payment means equals 50 (Giro)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((cbc:PaymentMeansCode = '50') and ((substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and not(string-length(cbc:PaymentID) = 19) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-009">
|
|
<xsl:attribute name="test">not((cbc:PaymentMeansCode = '50') and ((substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and not(string-length(cbc:PaymentID) = 19) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers if the PaymentID is prefixed with 04# or 15# the 16 digits instruction Id must be added to the PaymentID eg. "04#1234567890123456" when Payment means equals 50 (Giro)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((cbc:PaymentMeansCode = '93') and not(((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '73#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 8) ) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-010">
|
|
<xsl:attribute name="test">not((cbc:PaymentMeansCode = '93') and not(((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '73#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 8) ) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers the PaymentID is mandatory and MUST start with 71#, 73# or 75# (kortartkode) and PayeeFinancialAccount/ID (Kreditornummer) is mandatory and must be exactly 8 characters long, when Payment means equals 93 (FIK)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(not((cbc:PaymentMeansCode = '93') and ((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and not((string-length(cbc:PaymentID) = 18) or (string-length(cbc:PaymentID) = 19)) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-011">
|
|
<xsl:attribute name="test">not((cbc:PaymentMeansCode = '93') and ((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and not((string-length(cbc:PaymentID) = 18) or (string-length(cbc:PaymentID) = 19)) )</xsl:attribute>
|
|
<svrl:text>For Danish Suppliers if the PaymentID is prefixed with 71# or 75# the 15-16 digits instruction Id must be added to the PaymentID eg. "71#1234567890123456" when payment Method equals 93 (FIK)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e421')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine"
|
|
priority="50"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e421']">
|
|
<schxslt:rule pattern="d13e421">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e421">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'TST') and not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.05.01') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.0501') ) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="DK-R-003">
|
|
<xsl:attribute name="test">not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'TST') and not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.05.01') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.0501') ) )</xsl:attribute>
|
|
<svrl:text>If ItemClassification is provided from Danish suppliers, UNSPSC version 19.0501 should be used.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e421')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']"
|
|
priority="49"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e421']">
|
|
<schxslt:rule pattern="d13e421">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e421">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(not((cbc:AllowanceChargeReasonCode = 'ZZZ') and not((string-length(normalize-space(cbc:AllowanceChargeReason/text())) = 4) and (number(cbc:AllowanceChargeReason) >= 0) and (number(cbc:AllowanceChargeReason) <= 9999)) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="DK-R-004">
|
|
<xsl:attribute name="test">not((cbc:AllowanceChargeReasonCode = 'ZZZ') and not((string-length(normalize-space(cbc:AllowanceChargeReason/text())) = 4) and (number(cbc:AllowanceChargeReason) >= 0) and (number(cbc:AllowanceChargeReason) <= 9999)) )</xsl:attribute>
|
|
<svrl:text>When specifying non-VAT Taxes for Danish customers, Danish suppliers MUST use the AllowanceChargeReasonCode="ZZZ" and the 4-digit Tax category MUST be specified in AllowanceChargeReason</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e421')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']"
|
|
priority="48"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e492']">
|
|
<schxslt:rule pattern="d13e492">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e492">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(normalize-space(cbc:CompanyID),'^[A-Z0-9]{11,16}$'))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IT-R-001">
|
|
<xsl:attribute name="test">matches(normalize-space(cbc:CompanyID),'^[A-Z0-9]{11,16}$')</xsl:attribute>
|
|
<svrl:text>[IT-R-001] BT-32 (Seller tax registration identifier) - For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16. Per i fornitori italiani il BT-32 deve avere una lunghezza tra 11 e 16 caratteri</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e492')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']"
|
|
priority="47"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e492']">
|
|
<schxslt:rule pattern="d13e492">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e492">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cac:PostalAddress/cbc:StreetName)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IT-R-002">
|
|
<xsl:attribute name="test">cac:PostalAddress/cbc:StreetName</xsl:attribute>
|
|
<svrl:text>[IT-R-002] BT-35 (Seller address line 1) - Italian suppliers MUST provide the postal address line 1 - I fornitori italiani devono indicare l'indirizzo postale.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(cac:PostalAddress/cbc:CityName)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IT-R-003">
|
|
<xsl:attribute name="test">cac:PostalAddress/cbc:CityName</xsl:attribute>
|
|
<svrl:text>[IT-R-003] BT-37 (Seller city) - Italian suppliers MUST provide the postal address city - I fornitori italiani devono indicare la città di residenza.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(cac:PostalAddress/cbc:PostalZone)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IT-R-004">
|
|
<xsl:attribute name="test">cac:PostalAddress/cbc:PostalZone</xsl:attribute>
|
|
<svrl:text>">[IT-R-004] BT-38 (Seller post code) - Italian suppliers MUST provide the postal address post code - I fornitori italiani devono indicare il CAP di residenza.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e492')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']"
|
|
priority="46"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(normalize-space(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)) = 14)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="SE-R-001">
|
|
<xsl:attribute name="test">string-length(normalize-space(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)) = 14</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers, Swedish VAT-numbers must consist of 14 characters.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="SE-R-002">
|
|
<xsl:attribute name="test">string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN'</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]"
|
|
priority="45"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string(number(cbc:CompanyID)) != 'NaN')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-003">
|
|
<xsl:attribute name="test">string(number(cbc:CompanyID)) != 'NaN'</xsl:attribute>
|
|
<svrl:text>Swedish organisation numbers should be numeric.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space(cbc:CompanyID)) = 10)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-004">
|
|
<xsl:attribute name="test">string-length(normalize-space(cbc:CompanyID)) = 10</xsl:attribute>
|
|
<svrl:text>Swedish organisation numbers consist of 10 characters.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID"
|
|
priority="44"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="SE-R-005">
|
|
<xsl:attribute name="test">normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT'</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']"
|
|
priority="43"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(number(cbc:Percent) = 25 or number(cbc:Percent) = 12 or number(cbc:Percent) = 6)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="SE-R-006">
|
|
<xsl:attribute name="test">number(cbc:Percent) = 25 or number(cbc:Percent) = 12 or number(cbc:Percent) = 6</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers, only standard VAT rate of 6, 12 or 25 are used</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID"
|
|
priority="42"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string(number(normalize-space(.))) != 'NaN')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-007">
|
|
<xsl:attribute name="test">string(number(normalize-space(.))) != 'NaN'</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers using Plusgiro, the Account ID must be numeric </svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-010">
|
|
<xsl:attribute name="test">string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers using Plusgiro, the Account ID must have 2-8 characters</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID"
|
|
priority="41"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string(number(normalize-space(.))) != 'NaN')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-008">
|
|
<xsl:attribute name="test">string(number(normalize-space(.))) != 'NaN'</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers using Bankgiro, the Account ID must be numeric </svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-009">
|
|
<xsl:attribute name="test">string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers using Bankgiro, the Account ID must have 7-8 characters</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]"
|
|
priority="40"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(false())">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-011">
|
|
<xsl:attribute name="test">false()</xsl:attribute>
|
|
<svrl:text>For Swedish suppliers using Swedish Bankgiro or Plusgiro, the proper way to indicate this is to use Code 30 for PaymentMeans and FinancialInstitutionBranch ID with code SE:BANKGIRO or SE:PLUSGIRO</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]"
|
|
priority="39"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e516']">
|
|
<schxslt:rule pattern="d13e516">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e516">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(false())">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="SE-R-012">
|
|
<xsl:attribute name="test">false()</xsl:attribute>
|
|
<svrl:text>For domestic transactions between Swedish trading partners, credit transfer should be indicated by PaymentMeansCode="30"</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e516')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]"
|
|
priority="38"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:variable name="IdSegments" select="tokenize(.,'\|')"/>
|
|
<xsl:variable name="tokenizedIdDate" select="tokenize($IdSegments[2],'/')"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(count($IdSegments) = 6)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-1">
|
|
<xsl:attribute name="test">count($IdSegments) = 6</xsl:attribute>
|
|
<svrl:text> When the Supplier is Greek, the Invoice Id should consist of 6 segments</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space($IdSegments[1])) = 9 and u:TinVerification($IdSegments[1]) and ($IdSegments[1] = /*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) or $IdSegments[1] = /*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-2">
|
|
<xsl:attribute name="test">string-length(normalize-space($IdSegments[1])) = 9 and u:TinVerification($IdSegments[1]) and ($IdSegments[1] = /*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) or $IdSegments[1] = /*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) )</xsl:attribute>
|
|
<svrl:text>When the Supplier is Greek, the Invoice Id first segment must be a valid TIN Number and match either the Supplier's or the Tax Representative's Tin Number</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space($IdSegments[2]))>0 and matches($IdSegments[2],$dateRegExp) and ($tokenizedIdDate[1] = $tokenizedUblIssueDate[3] and $tokenizedIdDate[2] = $tokenizedUblIssueDate[2] and $tokenizedIdDate[3] = $tokenizedUblIssueDate[1]))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-3">
|
|
<xsl:attribute name="test">string-length(normalize-space($IdSegments[2]))>0 and matches($IdSegments[2],$dateRegExp) and ($tokenizedIdDate[1] = $tokenizedUblIssueDate[3] and $tokenizedIdDate[2] = $tokenizedUblIssueDate[2] and $tokenizedIdDate[3] = $tokenizedUblIssueDate[1])</xsl:attribute>
|
|
<svrl:text>When the Supplier is Greek, the Invoice Id second segment must be a valid Date that matches the invoice Issue Date</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space($IdSegments[3]))>0 and string(number($IdSegments[3])) != 'NaN' and xs:integer($IdSegments[3]) >= 0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-4">
|
|
<xsl:attribute name="test">string-length(normalize-space($IdSegments[3]))>0 and string(number($IdSegments[3])) != 'NaN' and xs:integer($IdSegments[3]) >= 0</xsl:attribute>
|
|
<svrl:text>When Supplier is Greek, the Invoice Id third segment must be a positive integer</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length(normalize-space($IdSegments[4]))>0 and (some $c in $greekDocumentType satisfies $IdSegments[4] = $c))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-5">
|
|
<xsl:attribute name="test">string-length(normalize-space($IdSegments[4]))>0 and (some $c in $greekDocumentType satisfies $IdSegments[4] = $c)</xsl:attribute>
|
|
<svrl:text>When Supplier is Greek, the Invoice Id in the fourth segment must be a valid greek document type</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length($IdSegments[5]) > 0 )">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-6">
|
|
<xsl:attribute name="test">string-length($IdSegments[5]) > 0 </xsl:attribute>
|
|
<svrl:text>When Supplier is Greek, the Invoice Id fifth segment must not be empty</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(string-length($IdSegments[6]) > 0 )">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-001-7">
|
|
<xsl:attribute name="test">string-length($IdSegments[6]) > 0 </xsl:attribute>
|
|
<svrl:text>When Supplier is Greek, the Invoice Id sixth segment must not be empty</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty[$isGreekSender]/cac:Party"
|
|
priority="37"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty[$isGreekSender]/cac:Party" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty[$isGreekSender]/cac:Party</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty[$isGreekSender]/cac:Party</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(./cac:PartyName/cbc:Name)>0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-002">
|
|
<xsl:attribute name="test">string-length(./cac:PartyName/cbc:Name)>0</xsl:attribute>
|
|
<svrl:text>Greek Suppliers must provide their full name as they are registered in the Greek Business Registry (G.E.MH.) as a legal entity or in the Tax Registry as a natural person </svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not( count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID) = 1 or count(/ubl-invoice:Invoice/cac:TaxRepresentativeParty) = 1)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-007-1">
|
|
<xsl:attribute name="test"> count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID) = 1 or count(/ubl-invoice:Invoice/cac:TaxRepresentativeParty) = 1</xsl:attribute>
|
|
<svrl:text>When greek supplier does not have a VAT number, the tax representative must be present</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxRepresentativeParty[$isGreekSender]"
|
|
priority="36"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxRepresentativeParty[$isGreekSender]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxRepresentativeParty[$isGreekSender]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxRepresentativeParty[$isGreekSender]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(normalize-space(cac:PartyName/cbc:Name))>0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-007-2">
|
|
<xsl:attribute name="test">string-length(normalize-space(cac:PartyName/cbc:Name))>0</xsl:attribute>
|
|
<svrl:text>If the Greek Suppliers do not have Greek VAT they must provide the full name of their tax representative in Greece</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3)))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-007-3">
|
|
<xsl:attribute name="test">count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))</xsl:attribute>
|
|
<svrl:text>If the Greek Suppliers do not have Greek VAT, they must provide the VAT number of their tax representative</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID"
|
|
priority="35"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3)))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-003">
|
|
<xsl:attribute name="test">substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))</xsl:attribute>
|
|
<svrl:text>For the Greek Suppliers, the VAT must start with 'EL' and must be a valid TIN number</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="/ubl-invoice:Invoice[$isGreekSender] | /ubl-creditnote:CreditNote[$isGreekSender]"
|
|
priority="34"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "/ubl-invoice:Invoice[$isGreekSender] | /ubl-creditnote:CreditNote[$isGreekSender]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">/ubl-invoice:Invoice[$isGreekSender] | /ubl-creditnote:CreditNote[$isGreekSender]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">/ubl-invoice:Invoice[$isGreekSender] | /ubl-creditnote:CreditNote[$isGreekSender]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-004-1">
|
|
<xsl:attribute name="test">count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1</xsl:attribute>
|
|
<svrl:text> When Supplier is Greek, there must be one MARK Number</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##'])=1)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="GR-S-008-1">
|
|
<xsl:attribute name="test">count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##'])=1</xsl:attribute>
|
|
<svrl:text> When Supplier is Greek, there should be one invoice url</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 1 ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-008-2">
|
|
<xsl:attribute name="test">(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 1 )</xsl:attribute>
|
|
<svrl:text> When Supplier is Greek, there should be no more than one invoice url</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID"
|
|
priority="33"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(matches(.,'^[1-9]([0-9]*)'))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-004-2">
|
|
<xsl:attribute name="test">matches(.,'^[1-9]([0-9]*)')</xsl:attribute>
|
|
<svrl:text> When Supplier is Greek, the MARK Number must be a positive integer</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']"
|
|
priority="32"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(normalize-space(cac:Attachment/cac:ExternalReference/cbc:URI))>0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-008-3">
|
|
<xsl:attribute name="test">string-length(normalize-space(cac:Attachment/cac:ExternalReference/cbc:URI))>0</xsl:attribute>
|
|
<svrl:text>When Supplier is Greek and the INVOICE URL Document reference exists, the External Reference URI should be present</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty[$isGreekSender]/cac:Party"
|
|
priority="31"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty[$isGreekSender]/cac:Party" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSender]/cac:Party</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSender]/cac:Party</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(./cac:PartyName/cbc:Name)>0)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-005">
|
|
<xsl:attribute name="test">string-length(./cac:PartyName/cbc:Name)>0</xsl:attribute>
|
|
<svrl:text>Greek Suppliers must provide the full name of the buyer</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID"
|
|
priority="30"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e608']">
|
|
<schxslt:rule pattern="d13e608">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e608">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(./@schemeID='9933' and u:TinVerification(.))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-009">
|
|
<xsl:attribute name="test">./@schemeID='9933' and u:TinVerification(.)</xsl:attribute>
|
|
<svrl:text>Greek suppliers that send an invoice through the PEPPOL network must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (schemeID 9933).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e608')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party"
|
|
priority="29"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e734']">
|
|
<schxslt:rule pattern="d13e734">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e734">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3)))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-006">
|
|
<xsl:attribute name="test">count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))</xsl:attribute>
|
|
<svrl:text>Greek Suppliers must provide the VAT number of the buyer, if the buyer is Greek </svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e734')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID"
|
|
priority="28"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e734']">
|
|
<schxslt:rule pattern="d13e734">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e734">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(./@schemeID='9933' and u:TinVerification(.))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="GR-R-010">
|
|
<xsl:attribute name="test">./@schemeID='9933' and u:TinVerification(.)</xsl:attribute>
|
|
<svrl:text>Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (SchemeID 9933)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e734')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']"
|
|
priority="27"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e755']">
|
|
<schxslt:rule pattern="d13e755">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e755">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(( ( not(contains(normalize-space(cbc:InvoiceTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:InvoiceTypeCode),' ') ) ) ) or ( ( not(contains(normalize-space(cbc:CreditNoteTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:CreditNoteTypeCode),' ') ) ) ))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="warning"
|
|
id="IS-R-001">
|
|
<xsl:attribute name="test">( ( not(contains(normalize-space(cbc:InvoiceTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:InvoiceTypeCode),' ') ) ) ) or ( ( not(contains(normalize-space(cbc:CreditNoteTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:CreditNoteTypeCode),' ') ) ) )</xsl:attribute>
|
|
<svrl:text>[IS-R-001]-If seller is icelandic then invoice type should be 380 or 381 — Ef seljandi er íslenskur þá ætti gerð reiknings (BT-3) að vera sölureikningur (380) eða kreditreikningur (381).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-002">
|
|
<xsl:attribute name="test">exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'</xsl:attribute>
|
|
<svrl:text>[IS-R-002]-If seller is icelandic then it shall contain sellers legal id — Ef seljandi er íslenskur þá skal reikningur innihalda íslenska kennitölu seljanda (BT-30).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-003">
|
|
<xsl:attribute name="test">exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone)</xsl:attribute>
|
|
<svrl:text>[IS-R-003]-If seller is icelandic then it shall contain his address with street name and zip code — Ef seljandi er íslenskur þá skal heimilisfang seljanda innihalda götuheiti og póstnúmer (BT-35 og BT-38).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9'])))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-006">
|
|
<xsl:attribute name="test">exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']))</xsl:attribute>
|
|
<svrl:text>[IS-R-006]-If seller is icelandic and payment means code is 9 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er krafa (kóti 9) þá skal koma fram 12 stafa númer (bankanúmer, höfuðbók 66 og reikningsnúmer) (BT-84)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42'])))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-007">
|
|
<xsl:attribute name="test">exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']))</xsl:attribute>
|
|
<svrl:text>[IS-R-007]-If seller is icelandic and payment means code is 42 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er millifærsla (kóti 42) þá skal koma fram 12 stafa reikningnúmer (BT-84)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and string-length(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) = 10 and (string(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) castable as xs:date)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI'])))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-008">
|
|
<xsl:attribute name="test">(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and string-length(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) = 10 and (string(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) castable as xs:date)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))</xsl:attribute>
|
|
<svrl:text>[IS-R-008]-If seller is icelandic and invoice contains supporting description EINDAGI then the id form must be YYYY-MM-DD — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) vera á forminu YYYY-MM-DD.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and exists(cbc:DueDate)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI'])))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-009">
|
|
<xsl:attribute name="test">(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and exists(cbc:DueDate)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))</xsl:attribute>
|
|
<svrl:text>[IS-R-009]-If seller is icelandic and invoice contains supporting description EINDAGI invoice must have due date — Ef seljandi er íslenskur þá skal reikningur sem inniheldur eindaga (BT-122, DocumentDescription = EINDAGI) einnig hafa gjalddaga (BT-9).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not((exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and (cbc:DueDate) <= (cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI'])))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-010">
|
|
<xsl:attribute name="test">(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and (cbc:DueDate) <= (cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))</xsl:attribute>
|
|
<svrl:text>[IS-R-010]-If seller is icelandic and invoice contains supporting description EINDAGI the id date must be same or later than due date — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) skal vera sami eða síðar en gjalddagi (BT-9) ef eindagi er til staðar.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e755')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty"
|
|
priority="26"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e755']">
|
|
<schxslt:rule pattern="d13e755">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e755">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(exists(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-004">
|
|
<xsl:attribute name="test">exists(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'</xsl:attribute>
|
|
<svrl:text>[IS-R-004]-If seller and buyer are icelandic then the invoice shall contain the buyers icelandic legal identifier — Ef seljandi og kaupandi eru íslenskir þá skal reikningurinn innihalda íslenska kennitölu kaupanda (BT-47).</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
<xsl:if test="not(exists(cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:Party/cac:PostalAddress/cbc:PostalZone))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="IS-R-005">
|
|
<xsl:attribute name="test">exists(cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:Party/cac:PostalAddress/cbc:PostalZone)</xsl:attribute>
|
|
<svrl:text>[IS-R-005]-If seller and buyer are icelandic then the invoice shall contain the buyers address with street name and zip code — Ef seljandi og kaupandi eru íslenskir þá skal heimilisfang kaupanda innihalda götuheiti og póstnúmer (BT-50 og BT-53)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e755')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:CreditNoteTypeCode[$supplierCountryIsNL]"
|
|
priority="25"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:CreditNoteTypeCode[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:CreditNoteTypeCode[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:CreditNoteTypeCode[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(/*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-001">
|
|
<xsl:attribute name="test">/*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID</xsl:attribute>
|
|
<svrl:text>[NL-R-001] For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference (cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]"
|
|
priority="24"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:StreetName and cbc:CityName and cbc:PostalZone)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-002">
|
|
<xsl:attribute name="test">cbc:StreetName and cbc:CityName and cbc:PostalZone</xsl:attribute>
|
|
<svrl:text>[NL-R-002] For suppliers in the Netherlands the supplier's address (cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]"
|
|
priority="23"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not((contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != ''))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-003">
|
|
<xsl:attribute name="test">(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')</xsl:attribute>
|
|
<svrl:text>[NL-R-003] For suppliers in the Netherlands, the legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]"
|
|
priority="22"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:StreetName and cbc:CityName and cbc:PostalZone)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-004">
|
|
<xsl:attribute name="test">cbc:StreetName and cbc:CityName and cbc:PostalZone</xsl:attribute>
|
|
<svrl:text>[NL-R-004] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address (cac:AccountingCustomerParty/cac:Party/cac:PostalAddress) MUST contain the street name (cbc:StreetName), the city (cbc:CityName) and post code (cbc:PostalZone)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]"
|
|
priority="21"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not((contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != ''))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-005">
|
|
<xsl:attribute name="test">(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')</xsl:attribute>
|
|
<svrl:text>[NL-R-005] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]"
|
|
priority="20"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(cbc:StreetName and cbc:CityName and cbc:PostalZone)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-006">
|
|
<xsl:attribute name="test">cbc:StreetName and cbc:CityName and cbc:PostalZone</xsl:attribute>
|
|
<svrl:text>[NL-R-006] For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address (cac:TaxRepresentativeParty/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:LegalMonetaryTotal[$supplierCountryIsNL]"
|
|
priority="19"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:LegalMonetaryTotal[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:LegalMonetaryTotal[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:LegalMonetaryTotal[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(xs:decimal(cbc:PayableAmount) <= 0.0 or (//cac:PaymentMeans))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-007">
|
|
<xsl:attribute name="test">xs:decimal(cbc:PayableAmount) <= 0.0 or (//cac:PaymentMeans)</xsl:attribute>
|
|
<svrl:text>[NL-R-007] For suppliers in the Netherlands, the supplier MUST provide a means of payment (cac:PaymentMeans) if the payment is from customer to supplier</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:PaymentMeans[$supplierCountryIsNL]"
|
|
priority="18"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:PaymentMeans[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:PaymentMeans[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:PaymentMeans[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:PaymentMeansCode) = '30' or normalize-space(cbc:PaymentMeansCode) = '48' or normalize-space(cbc:PaymentMeansCode) = '49' or normalize-space(cbc:PaymentMeansCode) = '57' or normalize-space(cbc:PaymentMeansCode) = '58' or normalize-space(cbc:PaymentMeansCode) = '59')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-008">
|
|
<xsl:attribute name="test">normalize-space(cbc:PaymentMeansCode) = '30' or normalize-space(cbc:PaymentMeansCode) = '48' or normalize-space(cbc:PaymentMeansCode) = '49' or normalize-space(cbc:PaymentMeansCode) = '57' or normalize-space(cbc:PaymentMeansCode) = '58' or normalize-space(cbc:PaymentMeansCode) = '59'</xsl:attribute>
|
|
<svrl:text>[NL-R-008] For suppliers in the Netherlands, the payment means code (cac:PaymentMeans/cbc:PaymentMeansCode) MUST be one of 30, 48, 49, 57, 58 or 59</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]"
|
|
priority="17"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e801']">
|
|
<schxslt:rule pattern="d13e801">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e801">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(exists(/*/cac:OrderReference/cbc:ID))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="NL-R-009">
|
|
<xsl:attribute name="test">exists(/*/cac:OrderReference/cbc:ID)</xsl:attribute>
|
|
<svrl:text>[NL-R-009] For suppliers in the Netherlands, if an order line reference (cac:OrderLineReference/cbc:LineID) is used, there must be an order reference on the document level (cac:OrderReference/cbc:ID)</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e801')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EmbeddedDocumentBinaryObject[@mimeCode]"
|
|
priority="16"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EmbeddedDocumentBinaryObject[@mimeCode]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EmbeddedDocumentBinaryObject[@mimeCode]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EmbeddedDocumentBinaryObject[@mimeCode]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $MIMECODE satisfies @mimeCode = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL001">
|
|
<xsl:attribute name="test"> some $code in $MIMECODE satisfies @mimeCode = $code</xsl:attribute>
|
|
<svrl:text>Mime code must be according to subset of IANA code list.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode"
|
|
priority="15"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $UNCL5189 satisfies normalize-space(text()) = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL002">
|
|
<xsl:attribute name="test"> some $code in $UNCL5189 satisfies normalize-space(text()) = $code</xsl:attribute>
|
|
<svrl:text>Reason code MUST be according to subset of UNCL 5189 D.16B.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode"
|
|
priority="14"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $UNCL7161 satisfies normalize-space(text()) = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL003">
|
|
<xsl:attribute name="test"> some $code in $UNCL7161 satisfies normalize-space(text()) = $code</xsl:attribute>
|
|
<svrl:text>Reason code MUST be according to UNCL 7161 D.16B.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:InvoicePeriod/cbc:DescriptionCode"
|
|
priority="13"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:InvoicePeriod/cbc:DescriptionCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:InvoicePeriod/cbc:DescriptionCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:InvoicePeriod/cbc:DescriptionCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $UNCL2005 satisfies normalize-space(text()) = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL006">
|
|
<xsl:attribute name="test"> some $code in $UNCL2005 satisfies normalize-space(text()) = $code</xsl:attribute>
|
|
<svrl:text>Invoice period description code must be according to UNCL 2005 D.16B.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount"
|
|
priority="12"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $ISO4217 satisfies @currencyID = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL007">
|
|
<xsl:attribute name="test"> some $code in $ISO4217 satisfies @currencyID = $code</xsl:attribute>
|
|
<svrl:text>Currency code must be according to ISO 4217:2005</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:InvoiceTypeCode" priority="11" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:InvoiceTypeCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:InvoiceTypeCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:InvoiceTypeCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( $profile != '01' or (some $code in tokenize('71 80 82 84 102 218 219 331 380 382 383 386 388 393 395 553 575 623 780 817 870 875 876 877', '\s') satisfies normalize-space(text()) = $code))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0100">
|
|
<xsl:attribute name="test"> $profile != '01' or (some $code in tokenize('71 80 82 84 102 218 219 331 380 382 383 386 388 393 395 553 575 623 780 817 870 875 876 877', '\s') satisfies normalize-space(text()) = $code)</xsl:attribute>
|
|
<svrl:text>Invoice type code MUST be set according to the profile.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:CreditNoteTypeCode" priority="10" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:CreditNoteTypeCode" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:CreditNoteTypeCode</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:CreditNoteTypeCode</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( $profile != '01' or (some $code in tokenize('381 396 81 83 532', '\s') satisfies normalize-space(text()) = $code))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0101">
|
|
<xsl:attribute name="test"> $profile != '01' or (some $code in tokenize('381 396 81 83 532', '\s') satisfies normalize-space(text()) = $code)</xsl:attribute>
|
|
<svrl:text>Credit note type code MUST be set according to the profile.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate"
|
|
priority="9"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(string-length(text()) = 10 and (string(.) castable as xs:date))">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-F001">
|
|
<xsl:attribute name="test">string-length(text()) = 10 and (string(.) castable as xs:date)</xsl:attribute>
|
|
<svrl:text>A date
|
|
MUST be formatted YYYY-MM-DD.</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cbc:EndpointID[@schemeID]" priority="8" mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:EndpointID[@schemeID]" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID]</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cbc:EndpointID[@schemeID]</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not( some $code in $eaid satisfies @schemeID = $code)">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-CL008">
|
|
<xsl:attribute name="test"> some $code in $eaid satisfies @schemeID = $code</xsl:attribute>
|
|
<svrl:text>Electronic address identifier scheme must be from the codelist "Electronic Address Identifier Scheme"</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']"
|
|
priority="7"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='G')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0104">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='G'</xsl:attribute>
|
|
<svrl:text>Tax Category G MUST be used when exemption reason code is VATEX-EU-G</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']"
|
|
priority="6"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='O')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0105">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='O'</xsl:attribute>
|
|
<svrl:text>Tax Category O MUST be used when exemption reason code is VATEX-EU-O</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']"
|
|
priority="5"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='K')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0106">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='K'</xsl:attribute>
|
|
<svrl:text>Tax Category K MUST be used when exemption reason code is VATEX-EU-IC</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']"
|
|
priority="4"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='AE')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0107">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='AE'</xsl:attribute>
|
|
<svrl:text>Tax Category AE MUST be used when exemption reason code is VATEX-EU-AE</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']"
|
|
priority="3"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='E')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0108">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='E'</xsl:attribute>
|
|
<svrl:text>Tax Category E MUST be used when exemption reason code is VATEX-EU-D</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']"
|
|
priority="2"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='E')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0109">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='E'</xsl:attribute>
|
|
<svrl:text>Tax Category E MUST be used when exemption reason code is VATEX-EU-F</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']"
|
|
priority="1"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='E')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0110">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='E'</xsl:attribute>
|
|
<svrl:text>Tax Category E MUST be used when exemption reason code is VATEX-EU-I</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template match="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']"
|
|
priority="0"
|
|
mode="d13e149">
|
|
<xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
|
|
<xsl:choose>
|
|
<xsl:when test="$schxslt:patterns-matched[. = 'd13e887']">
|
|
<schxslt:rule pattern="d13e887">
|
|
<xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']" shadowed by preceding rule</xsl:comment>
|
|
<svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']</xsl:attribute>
|
|
</svrl:suppressed-rule>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="$schxslt:patterns-matched"/>
|
|
</xsl:next-match>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<schxslt:rule pattern="d13e887">
|
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
|
|
<xsl:attribute name="context">cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']</xsl:attribute>
|
|
</svrl:fired-rule>
|
|
<xsl:if test="not(normalize-space(cbc:ID)='E')">
|
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
location="{schxslt:location(.)}"
|
|
flag="fatal"
|
|
id="PEPPOL-EN16931-P0111">
|
|
<xsl:attribute name="test">normalize-space(cbc:ID)='E'</xsl:attribute>
|
|
<svrl:text>Tax Category E MUST be used when exemption reason code is VATEX-EU-J</svrl:text>
|
|
</svrl:failed-assert>
|
|
</xsl:if>
|
|
</schxslt:rule>
|
|
<xsl:next-match>
|
|
<xsl:with-param name="schxslt:patterns-matched"
|
|
as="xs:string*"
|
|
select="($schxslt:patterns-matched, 'd13e887')"/>
|
|
</xsl:next-match>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:function name="schxslt:location" as="xs:string">
|
|
<xsl:param name="node" as="node()"/>
|
|
<xsl:variable name="segments" as="xs:string*">
|
|
<xsl:for-each select="($node/ancestor-or-self::node())">
|
|
<xsl:variable name="position">
|
|
<xsl:number level="single"/>
|
|
</xsl:variable>
|
|
<xsl:choose>
|
|
<xsl:when test=". instance of element()">
|
|
<xsl:value-of select="concat('Q{', namespace-uri(.), '}', local-name(.), '[', $position, ']')"/>
|
|
</xsl:when>
|
|
<xsl:when test=". instance of attribute()">
|
|
<xsl:value-of select="concat('@Q{', namespace-uri(.), '}', local-name(.))"/>
|
|
</xsl:when>
|
|
<xsl:when test=". instance of processing-instruction()">
|
|
<xsl:value-of select="concat('processing-instruction("', name(.), '")[', $position, ']')"/>
|
|
</xsl:when>
|
|
<xsl:when test=". instance of comment()">
|
|
<xsl:value-of select="concat('comment()[', $position, ']')"/>
|
|
</xsl:when>
|
|
<xsl:when test=". instance of text()">
|
|
<xsl:value-of select="concat('text()[', $position, ']')"/>
|
|
</xsl:when>
|
|
<xsl:otherwise/>
|
|
</xsl:choose>
|
|
</xsl:for-each>
|
|
</xsl:variable>
|
|
<xsl:value-of select="concat('/', string-join($segments, '/'))"/>
|
|
</xsl:function>
|
|
</xsl:transform>
|