zatca 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zatca/version.rb +1 -1
  3. data/zatca.gemspec +1 -1
  4. metadata +1 -154
  5. data/einvoicing-sdk/Apps/fatoora +0 -12
  6. data/einvoicing-sdk/Apps/fatoora.bat +0 -16
  7. data/einvoicing-sdk/Apps/global.json +0 -1
  8. data/einvoicing-sdk/Apps/jq.exe +0 -0
  9. data/einvoicing-sdk/Apps/zatca-einvoicing-sdk-238-R3.2.7.jar +0 -0
  10. data/einvoicing-sdk/Configuration/config.json +0 -11
  11. data/einvoicing-sdk/Configuration/defaults.json +0 -11
  12. data/einvoicing-sdk/Configuration/jq.exe +0 -0
  13. data/einvoicing-sdk/Configuration/usage.txt +0 -16
  14. data/einvoicing-sdk/Data/Certificates/cert.pem +0 -1
  15. data/einvoicing-sdk/Data/Certificates/ec-secp256k1-priv-key.pem +0 -1
  16. data/einvoicing-sdk/Data/Input/csr-config-example-AR-VAT-Group.properties +0 -9
  17. data/einvoicing-sdk/Data/Input/csr-config-example-AR.properties +0 -9
  18. data/einvoicing-sdk/Data/Input/csr-config-example-EN-VAT-group.properties +0 -9
  19. data/einvoicing-sdk/Data/Input/csr-config-example-EN.properties +0 -9
  20. data/einvoicing-sdk/Data/Input/csr-config-template.properties +0 -9
  21. data/einvoicing-sdk/Data/PIH/pih.txt +0 -1
  22. data/einvoicing-sdk/Data/Rules/schematrons/20210819_ZATCA_E-invoice_Validation_Rules.xsl +0 -2844
  23. data/einvoicing-sdk/Data/Rules/schematrons/CEN-EN16931-UBL.xsl +0 -1973
  24. data/einvoicing-sdk/Data/Samples/PDF-A3/Simplified Debit Note.pdf +0 -0
  25. data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Credit Note.pdf +0 -0
  26. data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Debit Note.pdf +0 -0
  27. data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Invoice.pdf +0 -0
  28. data/einvoicing-sdk/Data/Samples/PDF-A3/Tax_Invoice_USD.pdf +0 -0
  29. data/einvoicing-sdk/Data/Samples/Simplified/Credit/Simplified_Credit_Note.xml +0 -300
  30. data/einvoicing-sdk/Data/Samples/Simplified/Credit/Simplified_Credit_Note_Error.xml +0 -225
  31. data/einvoicing-sdk/Data/Samples/Simplified/Debit/Simplified_Debit_Note.xml +0 -211
  32. data/einvoicing-sdk/Data/Samples/Simplified/Debit/Simplified_Debit_Note_Error.xml +0 -226
  33. data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Additional_Simplified_Invoices/Out_Of_Scope_Simplified_Invoice.xml +0 -207
  34. data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Additional_Simplified_Invoices/Simplified_Invoice_USD.xml +0 -246
  35. data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Simplified_Invoice.xml +0 -246
  36. data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Simplified_Invoice_Error.xml +0 -228
  37. data/einvoicing-sdk/Data/Samples/Standard/Credit/Standard_Credit_Note.xml +0 -227
  38. data/einvoicing-sdk/Data/Samples/Standard/Credit/Standard_Credit_Note_Error.xml +0 -224
  39. data/einvoicing-sdk/Data/Samples/Standard/Debit/Standard_Debit_Note.xml +0 -227
  40. data/einvoicing-sdk/Data/Samples/Standard/Debit/Standard_Debit_Note_Error.xml +0 -226
  41. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Exempt_Standard_Invoice.xml +0 -227
  42. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Standard_Invoice_USD.xml +0 -227
  43. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Zero_Rate_Standard_Invoice.xml +0 -227
  44. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Sample Invoice[Advance Payements] - 1.xml +0 -294
  45. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Sample Invoice[Advance Payements] - 2.xml +0 -432
  46. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Standard_Invoice.xml +0 -222
  47. data/einvoicing-sdk/Data/Samples/Standard/Invoice/Standard_Invoice_Error.xml +0 -228
  48. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/CCTS_CCT_SchemaModule-2.1.xsd +0 -731
  49. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonAggregateComponents-2.1.xsd +0 -44365
  50. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonBasicComponents-2.1.xsd +0 -5389
  51. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonExtensionComponents-2.1.xsd +0 -223
  52. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonSignatureComponents-2.1.xsd +0 -101
  53. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CoreComponentParameters-2.1.xsd +0 -63
  54. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-ExtensionContentDataType-2.1.xsd +0 -89
  55. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-QualifiedDataTypes-2.1.xsd +0 -69
  56. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-SignatureAggregateComponents-2.1.xsd +0 -138
  57. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-SignatureBasicComponents-2.1.xsd +0 -78
  58. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-UnqualifiedDataTypes-2.1.xsd +0 -553
  59. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-XAdESv132-2.1.xsd +0 -476
  60. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-XAdESv141-2.1.xsd +0 -25
  61. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-xmldsig-core-schema-2.1.xsd +0 -330
  62. data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/maindoc/UBL-Invoice-2.1.xsd +0 -1002
  63. data/einvoicing-sdk/Dockerfile +0 -26
  64. data/einvoicing-sdk/LICENSE.txt +0 -56
  65. data/einvoicing-sdk/Lib/.Net/DLL/BouncyCastle.Crypto.dll +0 -0
  66. data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Core.dll +0 -0
  67. data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Text.dll +0 -0
  68. data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Util.dll +0 -0
  69. data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.XML.API.dll +0 -0
  70. data/einvoicing-sdk/Lib/.Net/DLL/IKVM.Runtime.dll +0 -0
  71. data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.dll +0 -0
  72. data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.dll.config +0 -43
  73. data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.pdb +0 -0
  74. data/einvoicing-sdk/Lib/.Net/DLL/System.Net.Http.dll +0 -0
  75. data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-10.8.dll +0 -0
  76. data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-api-10.8.dll +0 -0
  77. data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-api-10.8.xml +0 -11759
  78. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/3f204b7a-faba-42d8-8288-8b6fe516555c.vsidx +0 -0
  79. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/f95b6f91-c110-4b7a-bb49-3fc6bde85b13.vsidx +0 -0
  80. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/read.lock +0 -0
  81. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/v17/.suo +0 -0
  82. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/App.config +0 -14
  83. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/BouncyCastle.Crypto.dll +0 -0
  84. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/CSRGeneratorOpenSSL.cs +0 -58
  85. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Core.dll +0 -0
  86. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Text.dll +0 -0
  87. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Util.dll +0 -0
  88. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.XML.API.dll +0 -0
  89. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.Runtime.dll +0 -0
  90. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Program.cs +0 -194
  91. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Properties/AssemblyInfo.cs +0 -36
  92. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Readme.txt +0 -8
  93. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.dll +0 -0
  94. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.dll.config +0 -43
  95. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.pdb +0 -0
  96. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.csproj +0 -120
  97. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.exe +0 -0
  98. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.exe.config +0 -20
  99. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.pdb +0 -0
  100. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.sln +0 -25
  101. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/BouncyCastle.Crypto.dll +0 -0
  102. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/certificate.txt +0 -1
  103. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/pih.txt +0 -1
  104. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/privateKey.txt +0 -1
  105. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Core.dll +0 -0
  106. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Text.dll +0 -0
  107. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Util.dll +0 -0
  108. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.XML.API.dll +0 -0
  109. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.Runtime.dll +0 -0
  110. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.dll +0 -0
  111. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.dll.config +0 -43
  112. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.pdb +0 -0
  113. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.exe +0 -0
  114. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.exe.config +0 -20
  115. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.pdb +0 -0
  116. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/System.Net.Http.dll +0 -0
  117. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-10.8.dll +0 -0
  118. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-api-10.8.dll +0 -0
  119. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-api-10.8.xml +0 -11759
  120. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs +0 -4
  121. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
  122. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
  123. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.AssemblyReference.cache +0 -0
  124. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.CopyComplete +0 -0
  125. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.CoreCompileInputs.cache +0 -1
  126. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.FileListAbsolute.txt +0 -22
  127. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.SuggestedBindingRedirects.cache +0 -0
  128. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.exe +0 -0
  129. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.pdb +0 -0
  130. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-10.8.dll +0 -0
  131. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-api-10.8.dll +0 -0
  132. data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-api-10.8.xml +0 -11759
  133. data/einvoicing-sdk/Lib/.Net/Test/BouncyCastle.Crypto.dll +0 -0
  134. data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Core.dll +0 -0
  135. data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Text.dll +0 -0
  136. data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Util.dll +0 -0
  137. data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.XML.API.dll +0 -0
  138. data/einvoicing-sdk/Lib/.Net/Test/IKVM.Runtime.dll +0 -0
  139. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.dll +0 -0
  140. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.dll.config +0 -43
  141. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.pdb +0 -0
  142. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.exe +0 -0
  143. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.exe.config +0 -20
  144. data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.pdb +0 -0
  145. data/einvoicing-sdk/Lib/.Net/Test/saxon-he-10.8.dll +0 -0
  146. data/einvoicing-sdk/Lib/.Net/Test/saxon-he-api-10.8.dll +0 -0
  147. data/einvoicing-sdk/Lib/.Net/Test/saxon-he-api-10.8.xml +0 -11759
  148. data/einvoicing-sdk/README.md +0 -15
  149. data/einvoicing-sdk/Readme/readme.docx +0 -0
  150. data/einvoicing-sdk/Readme/readme.md +0 -674
  151. data/einvoicing-sdk/Readme/readme.pdf +0 -0
  152. data/einvoicing-sdk/Readme/~$readme.docx +0 -0
  153. data/einvoicing-sdk/docker-compose.yml +0 -12
  154. data/einvoicing-sdk/install.bat +0 -74
  155. data/einvoicing-sdk/install.sh +0 -74
@@ -1,1973 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
-
4
- This file is based on the CEN/EN 16931:2017 standard and br-licensed under the LGPL v3 in compliance with the terms granted in the EUPL v1.2 under which the original standard has been published.
5
-
6
- The copyright of CEN/EN 16931:2017 is owned by CEN and its members - the European National Standards Bodies. A copy of CEN/EN 16931-1:2017 may be obtained from any CEN member.
7
-
8
- -->
9
- <xsl:transform xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
10
- xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
11
- xmlns:cn="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
12
- xmlns:warning="https://doi.org/10.5281/zenodo.1495494#warning"
13
- xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
14
- xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
15
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
16
- xmlns:sch="http://purl.oclc.org/dsdl/schematron"
17
- xmlns:schxslt="https://doi.org/10.5281/zenodo.1495494"
18
- xmlns:schxslt-api="https://doi.org/10.5281/zenodo.1495494#api"
19
- xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
20
- xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
21
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
22
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
23
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
24
- xmlns:dct="http://purl.org/dc/terms/"
25
- xmlns:skos="http://www.w3.org/2004/02/skos/core#">
26
- <dct:creator>
27
- <dct:Agent>
28
- <skos:prefLabel>SchXslt/${project.version} SAXON/HE 10.5</skos:prefLabel>
29
- <schxslt.compile.typed-variables xmlns="https://doi.org/10.5281/zenodo.1495494#">true</schxslt.compile.typed-variables>
30
- </dct:Agent>
31
- </dct:creator>
32
- <dct:created>2021-08-31T19:20:00.249319615+02:00</dct:created>
33
- </rdf:Description>
34
- <xsl:output indent="yes"/>
35
- <xsl:variable name="Discount">
36
- <entry key = "2">Amendment commission</entry>
37
- <entry key = "3">Acceptance commission</entry>
38
- <entry key = "4">Commission for obtaining acceptance</entry>
39
- <entry key = "5">Commission on delivery</entry>
40
- <entry key = "6">Advising commission</entry>
41
- <entry key = "7">Confirmation commission</entry>
42
- <entry key = "8">Deferred payment commission</entry>
43
- </xsl:variable>
44
- <xsl:template match="/">
45
- <xsl:variable name="metadata" as="element()?">
46
- <svrl:metadata xmlns:dct="http://purl.org/dc/terms/"
47
- xmlns:skos="http://www.w3.org/2004/02/skos/core#"
48
- xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
49
- <dct:creator>
50
- <dct:Agent>
51
- <skos:prefLabel>
52
- <xsl:variable name="prefix" as="xs:string?" select="if (doc-available('')) then in-scope-prefixes(document('')/*[1])[namespace-uri-for-prefix(., document('')/*[1]) eq 'http://www.w3.org/1999/XSL/Transform'][1] else ()"/>
53
- <xsl:choose>
54
- <xsl:when test="empty($prefix)">Unknown</xsl:when>
55
- <xsl:otherwise>
56
- <xsl:value-of separator="/" select="(system-property(concat($prefix, ':product-name')), system-property(concat($prefix,':product-version')))"/>
57
- </xsl:otherwise>
58
- </xsl:choose>
59
- </skos:prefLabel>
60
- </dct:Agent>
61
- </dct:creator>
62
- <dct:created>
63
- <xsl:value-of select="current-dateTime()"/>
64
- </dct:created>
65
- <dct:source>
66
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/">
67
- <dct:creator>
68
- <dct:Agent>
69
- <skos:prefLabel>SchXslt/${project.version} SAXON/HE 10.5</skos:prefLabel>
70
- <schxslt.compile.typed-variables xmlns="https://doi.org/10.5281/zenodo.1495494#">true</schxslt.compile.typed-variables>
71
- </dct:Agent>
72
- </dct:creator>
73
- <dct:created>2021-08-31T19:20:00.249319615+02:00</dct:created>
74
- </rdf:Description>
75
- </dct:source>
76
- </svrl:metadata>
77
- </xsl:variable>
78
- <xsl:variable name="report" as="element(schxslt:report)">
79
- <schxslt:report>
80
- <xsl:call-template name="d7e42"/>
81
- </schxslt:report>
82
- </xsl:variable>
83
- <xsl:variable name="schxslt:report" as="node()*">
84
- <xsl:sequence select="$metadata"/>
85
- <xsl:for-each select="$report/schxslt:pattern">
86
- <xsl:sequence select="node()"/>
87
- <xsl:sequence select="$report/schxslt:rule[@pattern = current()/@id]/node()"/>
88
- </xsl:for-each>
89
- </xsl:variable>
90
- <svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
91
- <svrl:ns-prefix-in-attribute-values prefix="ext" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"/>
92
- <svrl:ns-prefix-in-attribute-values prefix="cbc" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"/>
93
- <svrl:ns-prefix-in-attribute-values prefix="cac" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"/>
94
- <svrl:ns-prefix-in-attribute-values prefix="qdt" uri="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"/>
95
- <svrl:ns-prefix-in-attribute-values prefix="udt" uri="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"/>
96
- <svrl:ns-prefix-in-attribute-values prefix="cn" uri="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"/>
97
- <svrl:ns-prefix-in-attribute-values prefix="ubl" uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"/>
98
- <svrl:ns-prefix-in-attribute-values prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
99
- <xsl:sequence select="$schxslt:report"/>
100
- </svrl:schematron-output>
101
- </xsl:template>
102
- <xsl:template match="text() | @*" mode="#all" priority="-10"/>
103
- <xsl:template match="*" mode="#all" priority="-10">
104
- <xsl:apply-templates mode="#current" select="@*"/>
105
- <xsl:apply-templates mode="#current" select="node()"/>
106
- </xsl:template>
107
- <xsl:template name="d7e42">
108
- <schxslt:pattern id="d7e42">
109
- <xsl:if test="exists(base-uri(/))">
110
- <xsl:attribute name="documents" select="base-uri(/)"/>
111
- </xsl:if>
112
- <xsl:for-each select="/">
113
- <svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl" id="UBL-model">
114
- <xsl:attribute name="documents" select="base-uri(.)"/>
115
- </svrl:active-pattern>
116
- </xsl:for-each>
117
- </schxslt:pattern>
118
- <schxslt:pattern id="d7e353">
119
- <xsl:if test="exists(base-uri(/))">
120
- <xsl:attribute name="documents" select="base-uri(/)"/>
121
- </xsl:if>
122
- <xsl:for-each select="/">
123
- <svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl" id="CustomRules_documentCurrency">
124
- <xsl:attribute name="documents" select="base-uri(.)"/>
125
- </svrl:active-pattern>
126
- </xsl:for-each>
127
- </schxslt:pattern>
128
- <schxslt:pattern id="d7e362">
129
- <xsl:if test="exists(base-uri(/))">
130
- <xsl:attribute name="documents" select="base-uri(/)"/>
131
- </xsl:if>
132
- <xsl:for-each select="/">
133
- <svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl" id="CustomRules_taxCurrency">
134
- <xsl:attribute name="documents" select="base-uri(.)"/>
135
- </svrl:active-pattern>
136
- </xsl:for-each>
137
- </schxslt:pattern>
138
- <schxslt:pattern id="d7e371">
139
- <xsl:if test="exists(base-uri(/))">
140
- <xsl:attribute name="documents" select="base-uri(/)"/>
141
- </xsl:if>
142
- <xsl:for-each select="/">
143
- <svrl:active-pattern xmlns:svrl="http://purl.oclc.org/dsdl/svrl" id="Codesmodel">
144
- <xsl:attribute name="documents" select="base-uri(.)"/>
145
- </svrl:active-pattern>
146
- </xsl:for-each>
147
- </schxslt:pattern>
148
- <xsl:apply-templates mode="d7e42" select="/"/>
149
- </xsl:template>
150
- <xsl:template match="cac:AdditionalDocumentReference" priority="32" mode="d7e42">
151
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
152
- <xsl:choose>
153
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
154
- <schxslt:rule pattern="d7e42">
155
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cac:AdditionalDocumentReference" shadowed by preceding rule</xsl:comment>
156
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
157
- <xsl:attribute name="context">cac:AdditionalDocumentReference</xsl:attribute>
158
- </svrl:suppressed-rule>
159
- </schxslt:rule>
160
- <xsl:next-match>
161
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
162
- </xsl:next-match>
163
- </xsl:when>
164
- <xsl:otherwise>
165
- <schxslt:rule pattern="d7e42">
166
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
167
- <xsl:attribute name="context">cac:AdditionalDocumentReference</xsl:attribute>
168
- </svrl:fired-rule>
169
- <xsl:if test="not((cbc:ID) != '')">
170
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-52">
171
- <xsl:attribute name="test">(cbc:ID) != ''</xsl:attribute>
172
- <svrl:text>[BR-52]-Each Additional supporting document (BG-24) shall contain a Supporting document reference (BT-122).</svrl:text>
173
- <svrl:message-code>BR-52</svrl:message-code>
174
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
175
- </svrl:failed-assert>
176
- </xsl:if>
177
- </schxslt:rule>
178
- <xsl:next-match>
179
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
180
- </xsl:next-match>
181
- </xsl:otherwise>
182
- </xsl:choose>
183
- </xsl:template>
184
- <xsl:template match="/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" priority="31" mode="d7e42">
185
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
186
- <xsl:choose>
187
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
188
- <schxslt:rule pattern="d7e42">
189
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" shadowed by preceding rule</xsl:comment>
190
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
191
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
192
- </svrl:suppressed-rule>
193
- </schxslt:rule>
194
- <xsl:next-match>
195
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
196
- </xsl:next-match>
197
- </xsl:when>
198
- <xsl:otherwise>
199
- <schxslt:rule pattern="d7e42">
200
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
201
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
202
- </svrl:fired-rule>
203
- <xsl:if test="not(exists(cbc:Amount))">
204
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-31">
205
- <xsl:attribute name="test">exists(cbc:Amount)</xsl:attribute>
206
- <svrl:text>[BR-31]-Each Document level allowance (BG-20) shall have a Document level allowance amount (BT-92).</svrl:text>
207
- <svrl:message-code>BR-31</svrl:message-code>
208
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
209
- </svrl:failed-assert>
210
- </xsl:if>
211
- <xsl:if test="not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) and (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) !='')">
212
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-32">
213
- <xsl:attribute name="test">exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) and (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) !=''</xsl:attribute>
214
- <svrl:text>[BR-32]-Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).</svrl:text>
215
- <svrl:message-code>BR-32</svrl:message-code>
216
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
217
- </svrl:failed-assert>
218
- </xsl:if>
219
- <xsl:if test="not(string-length(substring-after(cbc:Amount,'.'))&lt;=2)">
220
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-01">
221
- <xsl:attribute name="test">string-length(substring-after(cbc:Amount,'.'))&lt;=2</xsl:attribute>
222
- <svrl:text>[BR-DEC-01]-The allowed maximum number of decimals for the Document level allowance amount (BT-92) is 2.</svrl:text>
223
- <svrl:message-code>BR-DEC-01</svrl:message-code>
224
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
225
- </svrl:failed-assert>
226
- </xsl:if>
227
- <xsl:if test="not(string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2)">
228
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-02">
229
- <xsl:attribute name="test">string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2</xsl:attribute>
230
- <svrl:text>[BR-DEC-02]-The allowed maximum number of decimals for the Document level allowance base amount (BT-93) is 2.</svrl:text>
231
- <svrl:message-code>BR-DEC-02</svrl:message-code>
232
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
233
- </svrl:failed-assert>
234
- </xsl:if>
235
- </schxslt:rule>
236
- <xsl:next-match>
237
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
238
- </xsl:next-match>
239
- </xsl:otherwise>
240
- </xsl:choose>
241
- </xsl:template>
242
- <xsl:template match="/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" priority="31" mode="d7e42">
243
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
244
- <xsl:choose>
245
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
246
- <schxslt:rule pattern="d7e42">
247
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" shadowed by preceding rule</xsl:comment>
248
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
249
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
250
- </svrl:suppressed-rule>
251
- </schxslt:rule>
252
- <xsl:next-match>
253
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
254
- </xsl:next-match>
255
- </xsl:when>
256
- <xsl:otherwise>
257
- <schxslt:rule pattern="d7e42">
258
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
259
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
260
- </svrl:fired-rule>
261
- </schxslt:rule>
262
- <xsl:next-match>
263
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
264
- </xsl:next-match>
265
- </xsl:otherwise>
266
- </xsl:choose>
267
- </xsl:template>
268
- <!-- charge -->
269
- <xsl:template match="/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]" priority="31" mode="d7e42">
270
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
271
- <xsl:choose>
272
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
273
- <schxslt:rule pattern="d7e42">
274
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: Rule for context "/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]" shadowed by preceding rule</xsl:comment>
275
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
276
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]</xsl:attribute>
277
- </svrl:suppressed-rule>
278
- </schxslt:rule>
279
- <xsl:next-match>
280
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
281
- </xsl:next-match>
282
- </xsl:when>
283
- <xsl:otherwise>
284
- <schxslt:rule pattern="d7e42">
285
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
286
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]</xsl:attribute>
287
- </svrl:fired-rule>
288
- <!-- BR-36 -->
289
- <xsl:if test="(not (exists(./cbc:Amount)))">
290
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-36">
291
- <xsl:attribute name="test">not(exists((/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()]/exists(cbc:amount) )))</xsl:attribute>
292
- <svrl:text>[BR-36]-Each Document level charge (BG-21) shall have a Document level charge amount (BT-99).</svrl:text>
293
- <svrl:message-code>BR-36</svrl:message-code>
294
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
295
- </svrl:failed-assert>
296
- </xsl:if>
297
- <!-- End BR-36 -->
298
- <!-- BR-37 -->
299
- <xsl:if test="not(exists(cac:TaxCategory/cbc:ID))">
300
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-37">
301
- <xsl:attribute name="test">not(exists((/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()]/exists(cbc:TaxCategory/cvc:ID) )))</xsl:attribute>
302
- <svrl:text>[BR-37]-Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).</svrl:text>
303
- <svrl:message-code>BR-37</svrl:message-code>
304
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
305
- </svrl:failed-assert>
306
- </xsl:if>
307
- <!-- End BR-37 -->
308
- <!--DEC-06-->
309
- <xsl:if test="not(string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2)">
310
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-06">
311
- <xsl:attribute name="test">string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2</xsl:attribute>
312
- <svrl:text>[BR-DEC-06]-The allowed maximum number of decimals for the Document level charge base amount (BT-100) is 2.</svrl:text>
313
- <svrl:message-code>BR-DEC-06</svrl:message-code>
314
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
315
- </svrl:failed-assert>
316
- </xsl:if>
317
- <!--END-DEC-06-->
318
- <xsl:if test="not(string-length(substring-after(cbc:Amount,'.'))&lt;=2)">
319
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-05">
320
- <xsl:attribute name="test">string-length(substring-after(cbc:Amount,'.'))&lt;=2</xsl:attribute>
321
- <svrl:text>[BR-DEC-05]-The allowed maximum number of decimals for the Document level charge amount (BT-99) is 2.</svrl:text>
322
- <svrl:message-code>BR-DEC-05</svrl:message-code>
323
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
324
- </svrl:failed-assert>
325
- </xsl:if>
326
- </schxslt:rule>
327
- <xsl:next-match>
328
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
329
- </xsl:next-match>
330
- </xsl:otherwise>
331
- </xsl:choose>
332
- </xsl:template>
333
- <!-- End charge -->
334
- <xsl:template match="//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()]" priority="31" mode="d7e42">
335
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
336
- <xsl:choose>
337
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
338
- <schxslt:rule pattern="d7e42">
339
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()]" shadowed by preceding rule</xsl:comment>
340
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
341
- <xsl:attribute name="context">//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()]</xsl:attribute>
342
- </svrl:suppressed-rule>
343
- </schxslt:rule>
344
- <xsl:next-match>
345
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
346
- </xsl:next-match>
347
- </xsl:when>
348
- <xsl:otherwise>
349
- <schxslt:rule pattern="d7e42">
350
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
351
- <xsl:attribute name="context">/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]</xsl:attribute>
352
- </svrl:fired-rule>
353
- <!-- BR-43 -->
354
- <xsl:if test="(not (exists(./cbc:Amount)))">
355
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-43">
356
- <xsl:attribute name="test">not(exists((/ubl:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()]/exists(cbc:amount) )))</xsl:attribute>
357
- <svrl:text>[BR-43]-Each Invoice line charge (BG-28) shall have an Invoice line charge amount (BT-141).</svrl:text>
358
- <svrl:message-code>BR-43</svrl:message-code>
359
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
360
- </svrl:failed-assert>
361
- </xsl:if>
362
- <!-- End BR-43 -->
363
- <xsl:if test="not(string-length(substring-after(./cbc:Amount,'.'))&lt;=2)">
364
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-27">
365
- <xsl:attribute name="test">string-length(substring-after(cbc:Amount,'.'))&lt;=2</xsl:attribute>
366
- <svrl:text>[BR-DEC-27]-The allowed maximum number of decimals for the Invoice line charge amount (BT-141) is 2.</svrl:text>
367
- <svrl:message-code>BR-DEC-27</svrl:message-code>
368
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
369
- </svrl:failed-assert>
370
- </xsl:if>
371
- <xsl:if test="not(string-length(substring-after(./cbc:BaseAmount,'.'))&lt;=2)">
372
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-28">
373
- <xsl:attribute name="test">string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2</xsl:attribute>
374
- <svrl:text>[BR-DEC-28]-The allowed maximum number of decimals for the Invoice line charge base amount (BT-142) is 2.</svrl:text>
375
- <svrl:message-code>BR-DEC-28</svrl:message-code>
376
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
377
- </svrl:failed-assert>
378
- </xsl:if>
379
- </schxslt:rule>
380
- <xsl:next-match>
381
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
382
- </xsl:next-match>
383
- </xsl:otherwise>
384
- </xsl:choose>
385
- </xsl:template>
386
- <!--test2-->
387
- <xsl:template match="cac:LegalMonetaryTotal" priority="30" mode="d7e42">
388
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
389
- <xsl:choose>
390
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
391
- <schxslt:rule pattern="d7e42">
392
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: Rule for context "cac:LegalMonetaryTotal" shadowed by preceding rule</xsl:comment>
393
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
394
- <xsl:attribute name="context">cac:LegalMonetaryTotal</xsl:attribute>
395
- </svrl:suppressed-rule>
396
- </schxslt:rule>
397
- <xsl:next-match>
398
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
399
- </xsl:next-match>
400
- </xsl:when>
401
- <xsl:otherwise>
402
- <schxslt:rule pattern="d7e42">
403
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
404
- <xsl:attribute name="context">cac:LegalMonetaryTotal</xsl:attribute>
405
- </svrl:fired-rule>
406
- <xsl:if test="not(exists(cbc:TaxExclusiveAmount))">
407
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-13">
408
- <xsl:attribute name="test">exists(cbc:TaxExclusiveAmount)</xsl:attribute>
409
- <svrl:text>[BR-13]-An Invoice shall have the Invoice total amount without VAT (BT-109).</svrl:text>
410
- <svrl:message-code>BR-13</svrl:message-code>
411
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
412
- </svrl:failed-assert>
413
- </xsl:if>
414
- <xsl:if test="not(exists(cbc:TaxInclusiveAmount))">
415
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-14">
416
- <xsl:attribute name="test">exists(cbc:TaxInclusiveAmount)</xsl:attribute>
417
- <svrl:text>[BR-14]-An Invoice shall have the Invoice total amount with VAT (BT-112).</svrl:text>
418
- <svrl:message-code>BR-14</svrl:message-code>
419
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
420
- </svrl:failed-assert>
421
- </xsl:if>
422
- <xsl:if test="not(exists(cbc:PayableAmount))">
423
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-15">
424
- <xsl:attribute name="test">exists(cbc:PayableAmount)</xsl:attribute>
425
- <svrl:text>[BR-15]-An Invoice shall have the Amount due for payment (BT-115).</svrl:text>
426
- <svrl:message-code>BR-15</svrl:message-code>
427
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
428
- </svrl:failed-assert>
429
- </xsl:if>
430
- <xsl:if test="not((xs:decimal(cbc:LineExtensionAmount) = xs:decimal(round(sum(//(cac:InvoiceLine|cac:CreditNoteLine)/xs:decimal(cbc:LineExtensionAmount)) * 10 * 10) div 100)))">
431
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-10">
432
- <xsl:attribute name="test">(xs:decimal(cbc:LineExtensionAmount) = xs:decimal(round(sum(//(cac:InvoiceLine|cac:CreditNoteLine)/xs:decimal(cbc:LineExtensionAmount)) * 10 * 10) div 100))</xsl:attribute>
433
- <svrl:text>[BR-CO-10]-Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).</svrl:text>
434
- <svrl:message-code>BR-CO-10</svrl:message-code>
435
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
436
- </svrl:failed-assert>
437
- </xsl:if>
438
- <xsl:if test="not(xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()])))">
439
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-11">
440
- <xsl:attribute name="test">xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]))</xsl:attribute>
441
- <svrl:text>[BR-CO-11]-Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).</svrl:text>
442
- <svrl:message-code>BR-CO-11</svrl:message-code>
443
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
444
- </svrl:failed-assert>
445
- </xsl:if>
446
-
447
- <xsl:choose>
448
- <xsl:when test= "exists (cbc:ChargeTotalAmount) and normalize-space(cbc:ChargeTotalAmount)='' ">
449
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-12">
450
- <xsl:attribute name="test">xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]))</xsl:attribute>
451
- <svrl:text>[BR-CO-12]-Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).</svrl:text>
452
- <svrl:message-code>BR-CO-12</svrl:message-code>
453
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
454
- </svrl:failed-assert>
455
- </xsl:when>
456
- <xsl:otherwise>
457
- <xsl:if test=" not(xs:decimal(cbc:ChargeTotalAmount) = ( round ( sum(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount)) * 10 * 10)div 100 ) or ( not(cbc:ChargeTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=true()])))">
458
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-12">
459
- <xsl:attribute name="test">xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]))</xsl:attribute>
460
- <svrl:text>[BR-CO-12]-Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).</svrl:text>
461
- <svrl:message-code>BR-CO-12</svrl:message-code>
462
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
463
- </svrl:failed-assert>
464
- </xsl:if>
465
- </xsl:otherwise>
466
- </xsl:choose>
467
-
468
- <xsl:choose>
469
- <xsl:when test= "exists (cbc:ChargeTotalAmount) and normalize-space(cbc:ChargeTotalAmount)='' ">
470
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-13">
471
- <xsl:attribute name="test">((cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) + xs:decimal(cbc:ChargeTotalAmount) - xs:decimal(cbc:AllowanceTotalAmount)) * 10 * 10) div 100 )) or (not(cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) - xs:decimal(cbc:AllowanceTotalAmount)) * 10 * 10 ) div 100)) or ((cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) + xs:decimal(cbc:ChargeTotalAmount)) * 10 * 10 ) div 100)) or (not(cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = xs:decimal(cbc:LineExtensionAmount)))</xsl:attribute>
472
- <svrl:text>[BR-CO-13]-Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).</svrl:text>
473
- <svrl:message-code>BR-CO-13</svrl:message-code>
474
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
475
- </svrl:failed-assert>
476
- </xsl:when>
477
- <xsl:otherwise>
478
- <xsl:if test="not( ( (cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount ) = round ( ( xs:decimal(sum(/ubl:Invoice/cac:InvoiceLine/cbc:LineExtensionAmount)) + xs:decimal(cbc:ChargeTotalAmount) - xs:decimal(cbc:AllowanceTotalAmount) ) * 10 * 10 ) div 100 ))or( not(cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and ( xs:decimal(cbc:TaxExclusiveAmount) = round ( ( xs:decimal(sum(/ubl:Invoice/cac:InvoiceLine/cbc:LineExtensionAmount)) - xs:decimal(cbc:AllowanceTotalAmount) ) * 10 * 10 ) div 100 ))or( (cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and ( xs:decimal(cbc:TaxExclusiveAmount) = round ( ( xs:decimal(sum(/ubl:Invoice/cac:InvoiceLine/cbc:LineExtensionAmount)) + xs:decimal(cbc:ChargeTotalAmount) ) * 10 * 10 ) div 100 ))or ( not(cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and ( xs:decimal(cbc:TaxExclusiveAmount) =xs:decimal((cbc:LineExtensionAmount)) )))">
479
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-13">
480
- <xsl:attribute name="test">((cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) + xs:decimal(cbc:ChargeTotalAmount) - xs:decimal(cbc:AllowanceTotalAmount)) * 10 * 10) div 100 )) or (not(cbc:ChargeTotalAmount) and (cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) - xs:decimal(cbc:AllowanceTotalAmount)) * 10 * 10 ) div 100)) or ((cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = round((xs:decimal(cbc:LineExtensionAmount) + xs:decimal(cbc:ChargeTotalAmount)) * 10 * 10 ) div 100)) or (not(cbc:ChargeTotalAmount) and not(cbc:AllowanceTotalAmount) and (xs:decimal(cbc:TaxExclusiveAmount) = xs:decimal(cbc:LineExtensionAmount)))</xsl:attribute>
481
- <svrl:text>[BR-CO-13]-Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).</svrl:text>
482
- <svrl:message-code>BR-CO-13</svrl:message-code>
483
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
484
- </svrl:failed-assert>
485
- </xsl:if>
486
- </xsl:otherwise>
487
- </xsl:choose>
488
-
489
- <xsl:if test=" not(( not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount))))">
490
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-16">
491
- <xsl:attribute name="test">(exists(cbc:PrepaidAmount) and not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount)))</xsl:attribute>
492
- <svrl:text>[BR-CO-16]-Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Pre-Paid amount (BT-113) + Rounding amount (BT-114).</svrl:text>
493
- <svrl:message-code>BR-CO-16</svrl:message-code>
494
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
495
- </svrl:failed-assert>
496
- </xsl:if>
497
- <xsl:if test="string-length(substring-after(cbc:LineExtensionAmount,'.')) &gt; 2">
498
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-09">
499
- <xsl:attribute name="test">string-length(substring-after(cbc:LineExtensionAmount,'.'))&lt;=2</xsl:attribute>
500
- <svrl:text>[BR-DEC-09]-The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.</svrl:text>
501
- <svrl:message-code>BR-DEC-09</svrl:message-code>
502
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
503
- </svrl:failed-assert>
504
- </xsl:if>
505
- <xsl:if test="not(string-length(substring-after(cbc:AllowanceTotalAmount,'.'))&lt;=2)">
506
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-10">
507
- <xsl:attribute name="test">string-length(substring-after(cbc:AllowanceTotalAmount,'.'))&lt;=2</xsl:attribute>
508
- <svrl:text>[BR-DEC-10]-The allowed maximum number of decimals for the Sum of allowanced on document level (BT-107) is 2.</svrl:text>
509
- <svrl:message-code>BR-DEC-10</svrl:message-code>
510
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
511
- </svrl:failed-assert>
512
- </xsl:if>
513
- <!-- ADD DEC-11-->
514
- <xsl:if test="not(string-length(substring-after(cbc:ChargeTotalAmount,'.'))&lt;=2)">
515
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-11">
516
- <xsl:attribute name="test">string-length(substring-after(cbc:AllowanceTotalAmount,'.'))&lt;=2</xsl:attribute>
517
- <svrl:text>[BR-DEC-11]-The allowed maximum number of decimals for the Sum of charges on document level (BT-108) is 2.</svrl:text>
518
- <svrl:message-code>BR-DEC-11</svrl:message-code>
519
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
520
- </svrl:failed-assert>
521
- </xsl:if>
522
- <!-- END DEC-11-->
523
- <xsl:if test="not(string-length(substring-after(cbc:TaxExclusiveAmount,'.'))&lt;=2)">
524
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-12">
525
- <xsl:attribute name="test">string-length(substring-after(cbc:TaxExclusiveAmount,'.'))&lt;=2</xsl:attribute>
526
- <svrl:text>[BR-DEC-12]-The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.</svrl:text>
527
- <svrl:message-code>BR-DEC-12</svrl:message-code>
528
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
529
- </svrl:failed-assert>
530
- </xsl:if>
531
- <xsl:if test="not(string-length(substring-after(cbc:TaxInclusiveAmount,'.'))&lt;=2)">
532
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-14">
533
- <xsl:attribute name="test">string-length(substring-after(cbc:TaxInclusiveAmount,'.'))&lt;=2</xsl:attribute>
534
- <svrl:text>[BR-DEC-14]-The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.</svrl:text>
535
- <svrl:message-code>BR-DEC-14</svrl:message-code>
536
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
537
- </svrl:failed-assert>
538
- </xsl:if>
539
- <xsl:if test="not(string-length(substring-after(cbc:PrepaidAmount,'.'))&lt;=2)">
540
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-16">
541
- <xsl:attribute name="test">string-length(substring-after(cbc:PrepaidAmount,'.'))&lt;=2</xsl:attribute>
542
- <svrl:text>[BR-DEC-16]-The allowed maximum number of decimals for the Pre-Paid amount (BT-113) is 2.</svrl:text>
543
- <svrl:message-code>BR-DEC-16</svrl:message-code>
544
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
545
- </svrl:failed-assert>
546
- </xsl:if>
547
- <xsl:if test="not(string-length(substring-after(cbc:PayableRoundingAmount,'.'))&lt;=2)">
548
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-17">
549
- <xsl:attribute name="test">string-length(substring-after(cbc:PayableRoundingAmount,'.'))&lt;=2</xsl:attribute>
550
- <svrl:text>[BR-DEC-17]-The allowed maximum number of decimals for the Rounding amount (BT-114) is 2.</svrl:text>
551
- <svrl:message-code>BR-DEC-17</svrl:message-code>
552
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
553
- </svrl:failed-assert>
554
- </xsl:if>
555
- <xsl:if test="not(string-length(substring-after(cbc:PayableAmount,'.'))&lt;=2)">
556
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-18">
557
- <xsl:attribute name="test">string-length(substring-after(cbc:PayableAmount,'.'))&lt;=2</xsl:attribute>
558
- <svrl:text>[BR-DEC-18]-The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2. </svrl:text>
559
- <svrl:message-code>BR-DEC-18</svrl:message-code>
560
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
561
- </svrl:failed-assert>
562
- </xsl:if>
563
- </schxslt:rule>
564
- <xsl:next-match>
565
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
566
- </xsl:next-match>
567
- </xsl:otherwise>
568
- </xsl:choose>
569
- </xsl:template>
570
- <xsl:template match="cbc:InvoiceTypeCode[substring(@name, 1, 2) = '01']" priority="29" mode="d7e42">
571
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
572
- <xsl:choose>
573
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
574
- <schxslt:rule pattern="d7e42">
575
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "cbc:InvoiceTypeCode[substring(@name, 1, 2) = '01']" shadowed by preceding rule</xsl:comment>
576
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
577
- <xsl:attribute name="context">cbc:InvoiceTypeCode[substring(@name, 1, 2) = '01']</xsl:attribute>
578
- </svrl:suppressed-rule>
579
- </schxslt:rule>
580
- <xsl:next-match>
581
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
582
- </xsl:next-match>
583
- </xsl:when>
584
- <xsl:otherwise>
585
- <schxslt:rule pattern="d7e42">
586
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
587
- <xsl:attribute name="context">cbc:InvoiceTypeCode[substring(@name, 1, 2) = '01']</xsl:attribute>
588
- </svrl:fired-rule>
589
- <xsl:if test="boolean(//*[matches(@name, '01\d{5}')]) ">
590
- <xsl:if test="not (string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) &gt; 0 and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) &gt; 0 and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) &gt; 0 and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone) &gt; 0 and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))"> <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-10">
591
- <xsl:attribute name="test">exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:BuildingNumber) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)</xsl:attribute>
592
- <svrl:text>[BR-10]-An Invoice shall contain the Buyer postal address (BG-8).Not applicable for simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).</svrl:text>
593
- <svrl:message-code>BR-10</svrl:message-code>
594
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
595
- </svrl:failed-assert>
596
- </xsl:if>
597
- </xsl:if>
598
- </schxslt:rule>
599
- <xsl:next-match>
600
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
601
- </xsl:next-match>
602
- </xsl:otherwise>
603
- </xsl:choose>
604
- </xsl:template>
605
- <xsl:template match="/ubl:Invoice | /cn:CreditNote" priority="28" mode="d7e42">
606
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
607
- <xsl:choose>
608
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
609
- <schxslt:rule pattern="d7e42">
610
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">WARNING: Rule for context "/ubl:Invoice | /cn:CreditNote" shadowed by preceding rule</xsl:comment>
611
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
612
- <xsl:attribute name="context">/ubl:Invoice | /cn:CreditNote</xsl:attribute>
613
- </svrl:suppressed-rule>
614
- </schxslt:rule>
615
- <xsl:next-match>
616
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
617
- </xsl:next-match>
618
- </xsl:when>
619
- <xsl:otherwise>
620
- <schxslt:rule pattern="d7e42">
621
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
622
- <xsl:attribute name="context">/ubl:Invoice | /cn:CreditNote</xsl:attribute>
623
- </svrl:fired-rule>
624
- <xsl:if test="not(exists(cbc:ID) and (cbc:ID) !='')">
625
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-02">
626
- <xsl:attribute name="test">exists(cbc:ID) and (cbc:ID) !=''</xsl:attribute>
627
- <svrl:text>[BR-02]-An Invoice shall have an Invoice number (BT-1).</svrl:text>
628
- <svrl:message-code>BR-02</svrl:message-code>
629
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
630
- </svrl:failed-assert>
631
- </xsl:if>
632
- <xsl:if test="exists(cbc:ID) and string-length(cbc:ID) &gt; 127">
633
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C1">
634
- <xsl:attribute name="test">exists(cbc:ID) and string-length(cbc:ID) &gt; 127</xsl:attribute>
635
- <svrl:text>[BR-KSA-F-06-C1] - Field character limits for Invoice number field (BT-1) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.</svrl:text>
636
- <svrl:message-code>BR-KSA-F-06-C1</svrl:message-code>
637
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
638
- </svrl:failed-assert>
639
- </xsl:if>
640
- <xsl:if test="exists((//cbc:Note/text()[string-length() > 1000])[1])">
641
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C2">
642
- <xsl:attribute name="test">exists((//cbc:Note/text()[string-length() > 1000 or string-length() &lt; 0])[1])</xsl:attribute>
643
- <svrl:text>[BR-KSA-F-06-C2] - Field character limits for Invoice note field (BT-22) have not been met. The maximum limit is 1000 characters.</svrl:text>
644
- <svrl:message-code>BR-KSA-F-06-C2</svrl:message-code>
645
- <svrl:message-category>KSA - business rules (BR-KSA)</svrl:message-category>
646
- </svrl:failed-assert>
647
- </xsl:if>
648
- <xsl:if test="not(exists(cbc:IssueDate) and (cbc:IssueDate) !='')">
649
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-03">
650
- <xsl:attribute name="test">exists(cbc:IssueDate) and (cbc:IssueDate) !=''</xsl:attribute>
651
- <svrl:text>[BR-03]-An Invoice shall have an Invoice issue date (BT-2).</svrl:text>
652
- <svrl:message-code>BR-03</svrl:message-code>
653
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
654
- </svrl:failed-assert>
655
- </xsl:if>
656
- <xsl:if test="not((exists(cbc:InvoiceTypeCode) and (cbc:InvoiceTypeCode) !='') or (exists(cbc:CreditNoteTypeCode) and (cbc:CreditNoteTypeCode) !=''))">
657
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-04">
658
- <xsl:attribute name="test">(exists(cbc:InvoiceTypeCode) and (cbc:InvoiceTypeCode) !='') or (exists(cbc:CreditNoteTypeCode) and (cbc:CreditNoteTypeCode) !='')</xsl:attribute>
659
- <svrl:text>[BR-04]-An Invoice shall have an Invoice type code (BT-3).</svrl:text>
660
- <svrl:message-code>BR-04</svrl:message-code>
661
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
662
- </svrl:failed-assert>
663
- </xsl:if>
664
- <xsl:if test="not(exists(cbc:DocumentCurrencyCode) and (cbc:DocumentCurrencyCode) !='')">
665
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-05">
666
- <xsl:attribute name="test">exists(cbc:DocumentCurrencyCode) and (cbc:DocumentCurrencyCode) !=''</xsl:attribute>
667
- <svrl:text>[BR-05]-An Invoice shall have an Invoice currency code (BT-5).</svrl:text>
668
- <svrl:message-code>BR-05</svrl:message-code>
669
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
670
- </svrl:failed-assert>
671
- </xsl:if>
672
- <xsl:if test="not(exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) !='')">
673
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-06">
674
- <xsl:attribute name="test">exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) !=''</xsl:attribute>
675
- <svrl:text>[BR-06]-An Invoice shall contain the Seller name (BT-27).</svrl:text>
676
- <svrl:message-code>BR-06</svrl:message-code>
677
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
678
- </svrl:failed-assert>
679
- </xsl:if>
680
- <xsl:if test="exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)">
681
- <xsl:if test=" (string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) &gt; 1000 or string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) &lt; 1)">
682
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C10">
683
- <xsl:attribute name="test">
684
- exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) &gt; 127 or string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) &lt; 1)
685
- </xsl:attribute>
686
- <svrl:text>[BR-KSA-F-06-C10] - Field character limits for Seller name field (BT-27) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.
687
- </svrl:text>
688
- <svrl:message-code>BR-KSA-F-06-C10</svrl:message-code>
689
- <svrl:message-category>Business rules - length constraints(BR)</svrl:message-category>
690
- </svrl:failed-assert>
691
- </xsl:if>
692
- </xsl:if>
693
-
694
- <xsl:if test="exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) and string-length(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) &gt; 127">
695
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C8">
696
- <xsl:attribute name="test">
697
- exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) and (string-length(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) &gt; 127 or string-length(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) &lt; 1)
698
- </xsl:attribute>
699
- <svrl:text>[BR-KSA-F-06-C8] - Field character limits for the Seller Address - Province/State field (BT-39) have not been met. The maximum limit is 127 characters.
700
- </svrl:text>
701
- <svrl:message-code>BR-KSA-F-06-C8</svrl:message-code>
702
- <svrl:message-category>KSA - business rules (BR-KSA)</svrl:message-category>
703
- </svrl:failed-assert>
704
- </xsl:if>
705
- <xsl:if test="not(exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) and count(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) &gt;0)">
706
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-08">
707
- <xsl:attribute name="test">exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) and count(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) &gt;0</xsl:attribute>
708
- <svrl:text>[BR-08]-An Invoice shall contain the Seller postal address (BG-5) </svrl:text>
709
- <svrl:message-code>BR-08</svrl:message-code>
710
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
711
- </svrl:failed-assert>
712
- </xsl:if>
713
- <xsl:if test="exists(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) and string-length(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity)&gt;127">
714
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C27">
715
- <xsl:attribute name="test">
716
- exists(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity)) and string-length(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) &gt; 127
717
- </xsl:attribute>
718
- <svrl:text>[BR-KSA-F-06-C27] - Field character limits for the Buyer Address - Province/State field (BT-54) have not been met. The maximum limit is 127 characters.
719
- </svrl:text>
720
- <svrl:message-code>BR-KSA-F-06-C27</svrl:message-code>
721
- <svrl:message-category>KSA - business rules (BR-KSA)</svrl:message-category>
722
- </svrl:failed-assert>
723
- </xsl:if>
724
- <xsl:if test="not(exists(cac:InvoiceLine) or exists(cac:CreditNoteLine))">
725
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-16">
726
- <xsl:attribute name="test">exists(cac:InvoiceLine) or exists(cac:CreditNoteLine)</xsl:attribute>
727
- <svrl:text>[BR-16]-An Invoice shall have at least one Invoice line (BG-25)</svrl:text>
728
- <svrl:message-code>BR-16</svrl:message-code>
729
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
730
- </svrl:failed-assert>
731
- </xsl:if>
732
- <xsl:if test="not(every $taxcurrency in cbc:TaxCurrencyCode satisfies exists(//cac:TaxTotal/cbc:TaxAmount[@currencyID=$taxcurrency]))">
733
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-53">
734
- <xsl:attribute name="test">every $taxcurrency in cbc:TaxCurrencyCode satisfies exists(//cac:TaxTotal/cbc:TaxAmount[@currencyID=$taxcurrency])</xsl:attribute>
735
- <svrl:text>[BR-53]-If the VAT accounting currency code (BT-6) is present, then the Invoice total VAT amount in accounting currency (BT-111) shall be provided.</svrl:text>
736
- <svrl:message-code>BR-53</svrl:message-code>
737
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
738
- </svrl:failed-assert>
739
- </xsl:if>
740
- <xsl:for-each select="//cac:InvoiceLine">
741
- <xsl:if test="exists(cbc:ID) and (string-length(cbc:ID) &gt; 6 or string-length(cbc:ID) &lt; 1)">
742
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-KSA-F-06-C17">
743
- <xsl:attribute name="test">exists(cac:InvoiceLine/cbc:ID) and (string-length(cac:InvoiceLine/cbc:ID) &gt; 6 or string-length(cac:InvoiceLine/cbc:ID) &lt; 1)</xsl:attribute>
744
- <svrl:text>[BR-KSA-F-06-C17] - Field character limits for Invoice line identifier field (BT-126) have not been met. The minimum limit is 1 character and the maximum limit is 6 characters.</svrl:text>
745
- <svrl:message-code>BR-KSA-F-06-C17</svrl:message-code>
746
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
747
- </svrl:failed-assert>
748
- </xsl:if>
749
- <xsl:if test="exists(cac:Item/cac:BuyersItemIdentification/cbc:ID) and string-length(cac:Item/cac:BuyersItemIdentification/cbc:ID) &gt; 127">
750
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C30">
751
- <xsl:attribute name="test">exists(cac:Item/cac:BuyersItemIdentification/cbc:ID) and string-length(cac:Item/cac:BuyersItemIdentification/cbc:ID) &gt; 127</xsl:attribute>
752
- <svrl:text>[BR-KSA-F-06-C30] - Field character limits for Item Buyer's identifier field (BT-156) have not been met. The maximum limit is 127 characters.</svrl:text>
753
- <svrl:message-code>BR-KSA-F-06-C30</svrl:message-code>
754
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
755
- </svrl:failed-assert>
756
- </xsl:if>
757
- <xsl:if test="exists(cac:Item/cac:SellersItemIdentification/cbc:ID) and string-length(cac:Item/cac:SellersItemIdentification/cbc:ID) &gt; 127">
758
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C31">
759
- <xsl:attribute name="test">exists(cac:Item/cac:SellersItemIdentification/cbc:ID) and string-length(cac:Item/cac:SellersItemIdentification/cbc:ID) &gt; 127</xsl:attribute>
760
- <svrl:text>[BR-KSA-F-06-C31] - Field character limits for Item Seller's identifier field (BT-155) have not been met. The maximum limit is 127 characters.</svrl:text>
761
- <svrl:message-code>BR-KSA-F-06-C31</svrl:message-code>
762
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
763
- </svrl:failed-assert>
764
- </xsl:if>
765
- <xsl:if test="exists(cac:Item/cac:StandardItemIdentification/cbc:ID) and string-length(cac:Item/cac:StandardItemIdentification/cbc:ID) &gt; 127">
766
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C20">
767
- <xsl:attribute name="test">exists(cac:Item/cac:StandardItemIdentification/cbc:ID) and string-length(cac:Item/cac:StandardItemIdentification/cbc:ID) &gt; 127</xsl:attribute>
768
- <svrl:text>[BR-KSA-F-06-C20] - Field character limits for Item standard identifier field (BT-157) have not been met. The maximum limit is 127 characters.</svrl:text>
769
- <svrl:message-code>BR-KSA-F-06-C20</svrl:message-code>
770
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
771
- </svrl:failed-assert>
772
- </xsl:if>
773
- </xsl:for-each>
774
- <xsl:if test="not(every $Currency in cbc:DocumentCurrencyCode satisfies (count(cac:TaxTotal/xs:decimal(cbc:TaxAmount[@currencyID=$Currency])) &gt;= 1) and (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxInclusiveAmount) = round( (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxExclusiveAmount) + sum(cac:TaxTotal/cac:TaxSubtotal/xs:decimal(cbc:TaxAmount))) * 10 * 10) div 100))">
775
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-15">
776
- <xsl:attribute name="test">every $Currency in cbc:DocumentCurrencyCode satisfies (count(cac:TaxTotal/xs:decimal(cbc:TaxAmount[@currencyID=$Currency])) &gt;= 1) and (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxInclusiveAmount) = round( (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxExclusiveAmount) + sum(cac:TaxTotal/cac:TaxSubtotal/xs:decimal(cbc:TaxAmount))) * 10 * 10) div 100)</xsl:attribute>
777
- <svrl:text>[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).</svrl:text>
778
- <svrl:message-code>BR-CO-15</svrl:message-code>
779
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
780
- </svrl:failed-assert>
781
- </xsl:if>
782
- <xsl:if test="not(exists(cac:TaxTotal/cac:TaxSubtotal))">
783
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-18">
784
- <xsl:attribute name="test">exists(cac:TaxTotal/cac:TaxSubtotal)</xsl:attribute>
785
- <svrl:text>[BR-CO-18]-An Invoice shall at least have one VAT breakdown group (BG-23).</svrl:text>
786
- <svrl:message-code>BR-CO-18</svrl:message-code>
787
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
788
- </svrl:failed-assert>
789
- </xsl:if>
790
- <xsl:if test="not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) &gt; 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E'])))">
791
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-E-01">
792
- <xsl:attribute name="test">((exists(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) = 1)) or (not(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']))</xsl:attribute>
793
- <svrl:text>[BR-E-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Exempt from VAT" shall contain at least one VAT breakdown (BG-23) with the VAT category code (BT-118) equal to "Exempt from VAT".</svrl:text>
794
- <svrl:message-code>BR-E-01</svrl:message-code>
795
- <svrl:message-category>Business rules - Exempted from VAT (BR-E)</svrl:message-category>
796
- </svrl:failed-assert>
797
- </xsl:if>
798
- <!-- Role BR-O-01 -->
799
- <xsl:if test="not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) &gt; 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O'])))">
800
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-O-01">
801
- <xsl:attribute name="test">((exists(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) = 1)) or (not(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']))</xsl:attribute>
802
- <svrl:text>[BR-O-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Not subject to VAT" shall contain exactly at least one VAT breakdown group (BG-23) with the VAT category code (BT-118) equal to "Not subject to VAT".</svrl:text>
803
- <svrl:message-code>BR-O-01</svrl:message-code>
804
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
805
- </svrl:failed-assert>
806
- </xsl:if>
807
- <!--End Role BR-O-01 -->
808
- <xsl:if test="cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((/ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory /cbc:Percent)=0)) ">
809
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-Z-07">
810
- <xsl:attribute name="test">cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and (/ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory /cbc:Percent)=0 </xsl:attribute>
811
- <svrl:text>[BR-Z-07]-In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Zero rated" the Document level charge VAT rate (BT-103) shall be 0 (zero).</svrl:text>
812
- <svrl:message-code>BR-Z-07</svrl:message-code>
813
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
814
- </svrl:failed-assert>
815
- </xsl:if>
816
- <xsl:if test="cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((/ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory /cbc:Percent)=0)) ">
817
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-E-07">
818
- <xsl:attribute name="test">(xs:decimal(cbc:Percent) = 0)</xsl:attribute>
819
- <svrl:text>[BR-E-07]-In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Exempt from VAT", the Document level charge VAT rate (BT-103) shall be 0 (zero).</svrl:text>
820
- <svrl:message-code>BR-E-07</svrl:message-code>
821
- <svrl:message-category>Business rules - Exempted from VAT (BR-E)</svrl:message-category>
822
- </svrl:failed-assert>
823
- </xsl:if>
824
- <xsl:if test="not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) &gt; 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z'])))">
825
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-Z-01">
826
- <xsl:attribute name="test">((exists(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) >= 1)) or (not(//cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']))</xsl:attribute>
827
- <svrl:text>[BR-Z-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Zero rated" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "Zero rated".</svrl:text>
828
- <svrl:message-code>BR-Z-01</svrl:message-code>
829
- <svrl:message-category>Business rules - VAT zero rate (BR-Z)</svrl:message-category>
830
- </svrl:failed-assert>
831
- </xsl:if>
832
- </schxslt:rule>
833
- <xsl:next-match>
834
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
835
- </xsl:next-match>
836
- </xsl:otherwise>
837
- </xsl:choose>
838
- </xsl:template>
839
- <xsl:template match="cac:InvoiceLine | cac:CreditNoteLine" priority="27" mode="d7e42">
840
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
841
- <xsl:choose>
842
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
843
- <schxslt:rule pattern="d7e42">
844
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: Rule for context "cac:InvoiceLine | cac:CreditNoteLine" shadowed by preceding rule</xsl:comment>
845
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
846
- <xsl:attribute name="context">cac:InvoiceLine | cac:CreditNoteLine</xsl:attribute>
847
- </svrl:suppressed-rule>
848
- </schxslt:rule>
849
- <xsl:next-match>
850
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
851
- </xsl:next-match>
852
- </xsl:when>
853
- <xsl:otherwise>
854
- <schxslt:rule pattern="d7e42">
855
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
856
- <xsl:attribute name="context">cac:InvoiceLine | cac:CreditNoteLine</xsl:attribute>
857
- </svrl:fired-rule>
858
- <xsl:if test="exists(cbc:InvoicedQuantity/@unitCode) and string-length(cbc:InvoicedQuantity/@unitCode) &gt; 127">
859
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C18">
860
- <xsl:attribute name="test">exists(cac:InvoiceLine/cbc:InvoicedQuantity/@unitCode) and string-length(cac:InvoiceLine/cbc:InvoicedQuantity/@unitCode) &gt; 127</xsl:attribute>
861
- <svrl:text>[BR-KSA-F-06-C18] - Field character limits for Invoiced quantity unit of measure field (BT-130) have not been met. The maximum limit is 127 characters.</svrl:text>
862
- <svrl:message-code>BR-KSA-F-06-C18</svrl:message-code>
863
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
864
- </svrl:failed-assert>
865
- </xsl:if>
866
- <xsl:if test="exists(cac:Item/cbc:Name) and (string-length(cac:Item/cbc:Name) &gt; 1000 or string-length(cac:Item/cbc:Name) &lt; 1)">
867
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-KSA-F-06-C19">
868
- <xsl:attribute name="test">exists(cac:Item/cbc:Name) and (string-length(cac:Item/cbc:Name) &gt; 1000 or string-length(cac:Item/cbc:Name) &lt; 1)</xsl:attribute>
869
- <svrl:text>[BR-KSA-F-06-C19] - Field character limits for Item name field (BT-153) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.</svrl:text>
870
- <svrl:message-code>BR-KSA-F-06-C19</svrl:message-code>
871
- <svrl:message-category>KSA - business rules (BR-KSA)</svrl:message-category>
872
- </svrl:failed-assert>
873
- </xsl:if>
874
- <xsl:if test="not((cbc:ID) != '')">
875
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-21">
876
- <xsl:attribute name="test">(cbc:ID) != ''</xsl:attribute>
877
- <svrl:text>[BR-21]-Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).</svrl:text>
878
- <svrl:message-code>BR-21</svrl:message-code>
879
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
880
- </svrl:failed-assert>
881
- </xsl:if>
882
- <xsl:if test="(not(exists(cbc:InvoicedQuantity)) or cbc:InvoicedQuantity/text() = '0')">
883
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-22">
884
- <xsl:attribute name="test">exists(cbc:InvoicedQuantity) or exists(cbc:CreditedQuantity)</xsl:attribute>
885
- <svrl:text>[BR-22]-Each Invoice line (BG-25) shall have an Invoiced quantity (BT-129).</svrl:text>
886
- <svrl:message-code>BR-22</svrl:message-code>
887
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
888
- </svrl:failed-assert>
889
- </xsl:if>
890
- <xsl:if test="not(exists(cbc:LineExtensionAmount))">
891
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-24">
892
- <xsl:attribute name="test">exists(cbc:LineExtensionAmount)</xsl:attribute>
893
- <svrl:text>[BR-24]-Each Invoice line (BG-25) shall have an Invoice line net amount (BT-131).</svrl:text>
894
- <svrl:message-code>BR-24</svrl:message-code>
895
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
896
- </svrl:failed-assert>
897
- </xsl:if>
898
- <xsl:if test="not((cac:Item/cbc:Name) != '')">
899
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-25">
900
- <xsl:attribute name="test">(cac:Item/cbc:Name) != ''</xsl:attribute>
901
- <svrl:text>[BR-25]-Each Invoice line (BG-25) shall contain the Item name (BT-153).</svrl:text>
902
- <svrl:message-code>BR-25</svrl:message-code>
903
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
904
- </svrl:failed-assert>
905
- </xsl:if>
906
- <xsl:if test="not(exists(cac:Price/cbc:PriceAmount))">
907
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-26">
908
- <xsl:attribute name="test">exists(cac:Price/cbc:PriceAmount)</xsl:attribute>
909
- <svrl:text>[BR-26]-Each Invoice line (BG-25) shall contain the Item net price (BT-146).</svrl:text>
910
- <svrl:message-code>BR-26</svrl:message-code>
911
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
912
- </svrl:failed-assert>
913
- </xsl:if>
914
- <xsl:if test="not((cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/(normalize-space(upper-case(cbc:ID))='VAT')]/cbc:ID))">
915
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-04">
916
- <xsl:attribute name="test">(cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/(normalize-space(upper-case(cbc:ID))='VAT')]/cbc:ID)</xsl:attribute>
917
- <svrl:text>[BR-CO-04]-Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).</svrl:text>
918
- <svrl:message-code>BR-CO-04</svrl:message-code>
919
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
920
- </svrl:failed-assert>
921
- </xsl:if>
922
- <xsl:if test="not(string-length(substring-after(cbc:LineExtensionAmount,'.'))&lt;=2)">
923
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-23">
924
- <xsl:attribute name="test">string-length(substring-after(cbc:LineExtensionAmount,'.'))&lt;=2</xsl:attribute>
925
- <svrl:text>[BR-DEC-23]-The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.</svrl:text>
926
- <svrl:message-code>BR-DEC-23</svrl:message-code>
927
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
928
- </svrl:failed-assert>
929
- </xsl:if>
930
- </schxslt:rule>
931
- <xsl:next-match>
932
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
933
- </xsl:next-match>
934
- </xsl:otherwise>
935
- </xsl:choose>
936
- </xsl:template>
937
- <xsl:template match="//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" priority="26" mode="d7e42">
938
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
939
- <xsl:choose>
940
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
941
- <schxslt:rule pattern="d7e42">
942
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]" shadowed by preceding rule</xsl:comment>
943
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
944
- <xsl:attribute name="context">//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
945
- </svrl:suppressed-rule>
946
- </schxslt:rule>
947
- <xsl:next-match>
948
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
949
- </xsl:next-match>
950
- </xsl:when>
951
- <xsl:otherwise>
952
- <schxslt:rule pattern="d7e42">
953
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
954
- <xsl:attribute name="context">//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]</xsl:attribute>
955
- </svrl:fired-rule>
956
- <xsl:if test="not(exists(cbc:Amount))">
957
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-41">
958
- <xsl:attribute name="test">exists(cbc:Amount)</xsl:attribute>
959
- <svrl:text>[BR-41]-Each Invoice line allowance (BG-27) shall have an Invoice line allowance amount (BT-136).</svrl:text>
960
- <svrl:message-code>BR-41</svrl:message-code>
961
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
962
- </svrl:failed-assert>
963
- </xsl:if>
964
- <xsl:if test="not(string-length(substring-after(cbc:Amount,'.'))&lt;=2)">
965
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-24">
966
- <xsl:attribute name="test">string-length(substring-after(cbc:Amount,'.'))&lt;=2</xsl:attribute>
967
- <svrl:text>[BR-DEC-24]-The allowed maximum number of decimals for the Invoice line allowance amount (BT-136) is 2.</svrl:text>
968
- <svrl:message-code>BR-DEC-24</svrl:message-code>
969
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
970
- </svrl:failed-assert>
971
- </xsl:if>
972
- <xsl:if test="not(string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2)">
973
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-25">
974
- <xsl:attribute name="test">string-length(substring-after(cbc:BaseAmount,'.'))&lt;=2</xsl:attribute>
975
- <svrl:text>[BR-DEC-25]-The allowed maximum number of decimals for the Invoice line allowance base amount (BT-137) is 2.</svrl:text>
976
- <svrl:message-code>BR-DEC-25</svrl:message-code>
977
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
978
- </svrl:failed-assert>
979
- </xsl:if>
980
- </schxslt:rule>
981
- <xsl:next-match>
982
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
983
- </xsl:next-match>
984
- </xsl:otherwise>
985
- </xsl:choose>
986
- </xsl:template>
987
- <xsl:template match="//cac:AdditionalItemProperty" priority="25" mode="d7e42">
988
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
989
- <xsl:choose>
990
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
991
- <schxslt:rule pattern="d7e42">
992
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "//cac:AdditionalItemProperty" shadowed by preceding rule</xsl:comment>
993
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
994
- <xsl:attribute name="context">//cac:AdditionalItemProperty</xsl:attribute>
995
- </svrl:suppressed-rule>
996
- </schxslt:rule>
997
- <xsl:next-match>
998
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
999
- </xsl:next-match>
1000
- </xsl:when>
1001
- <xsl:otherwise>
1002
- <schxslt:rule pattern="d7e42">
1003
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1004
- <xsl:attribute name="context">//cac:AdditionalItemProperty</xsl:attribute>
1005
- </svrl:fired-rule>
1006
- <xsl:if test="not(exists(cbc:Name) and exists(cbc:Value))">
1007
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-54">
1008
- <xsl:attribute name="test">exists(cbc:Name) and exists(cbc:Value)</xsl:attribute>
1009
- <svrl:text>[BR-54]-Each Item attribute (BG-32) shall contain an Item attribute name (BT-160) and an Item attribute value (BT-161).</svrl:text>
1010
- <svrl:message-code>BR-54</svrl:message-code>
1011
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1012
- </svrl:failed-assert>
1013
- </xsl:if>
1014
- </schxslt:rule>
1015
- <xsl:next-match>
1016
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1017
- </xsl:next-match>
1018
- </xsl:otherwise>
1019
- </xsl:choose>
1020
- </xsl:template>
1021
- <xsl:template match="cac:PaymentMeans" priority="24" mode="d7e42">
1022
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1023
- <xsl:choose>
1024
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1025
- <schxslt:rule pattern="d7e42">
1026
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:PaymentMeans" shadowed by preceding rule</xsl:comment>
1027
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1028
- <xsl:attribute name="context">cac:PaymentMeans</xsl:attribute>
1029
- </svrl:suppressed-rule>
1030
- </schxslt:rule>
1031
- <xsl:next-match>
1032
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1033
- </xsl:next-match>
1034
- </xsl:when>
1035
- <xsl:otherwise>
1036
- <schxslt:rule pattern="d7e42">
1037
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1038
- <xsl:attribute name="context">cac:PaymentMeans</xsl:attribute>
1039
- </svrl:fired-rule>
1040
- <xsl:if test="boolean(//*[matches(@name, '01\d{5}')]) and not(exists(cbc:PaymentMeansCode))">
1041
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-49">
1042
- <xsl:attribute name="test">exists(cbc:PaymentMeansCode)</xsl:attribute>
1043
- <svrl:text>[BR-49]-A Payment instruction (BG-16) shall specify the Payment means type code (BT-81).</svrl:text>
1044
- <svrl:message-code>BR-49</svrl:message-code>
1045
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1046
- </svrl:failed-assert>
1047
- </xsl:if>
1048
- </schxslt:rule>
1049
- <xsl:next-match>
1050
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1051
- </xsl:next-match>
1052
- </xsl:otherwise>
1053
- </xsl:choose>
1054
- </xsl:template>
1055
- <xsl:template match="cac:BillingReference" priority="23" mode="d7e42">
1056
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1057
- <xsl:choose>
1058
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1059
- <schxslt:rule pattern="d7e42">
1060
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:BillingReference" shadowed by preceding rule</xsl:comment>
1061
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1062
- <xsl:attribute name="context">cac:BillingReference</xsl:attribute>
1063
- </svrl:suppressed-rule>
1064
- </schxslt:rule>
1065
- <xsl:next-match>
1066
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1067
- </xsl:next-match>
1068
- </xsl:when>
1069
- <xsl:otherwise>
1070
- <schxslt:rule pattern="d7e42">
1071
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1072
- <xsl:attribute name="context">cac:BillingReference</xsl:attribute>
1073
- </svrl:fired-rule>
1074
- <xsl:if test="not(exists(cac:InvoiceDocumentReference/cbc:ID) and (cac:InvoiceDocumentReference/cbc:ID) !='')">
1075
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-55">
1076
- <xsl:attribute name="test">exists(cac:InvoiceDocumentReference/cbc:ID) and (cac:InvoiceDocumentReference/cbc:ID) !=''</xsl:attribute>
1077
- <svrl:text>[BR-55]-Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).</svrl:text>
1078
- <svrl:message-code>BR-55</svrl:message-code>
1079
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1080
- </svrl:failed-assert>
1081
- </xsl:if>
1082
- </schxslt:rule>
1083
- <xsl:next-match>
1084
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1085
- </xsl:next-match>
1086
- </xsl:otherwise>
1087
- </xsl:choose>
1088
- </xsl:template>
1089
- <xsl:template match="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress" priority="22" mode="d7e42">
1090
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1091
- <xsl:choose>
1092
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1093
- <schxslt:rule pattern="d7e42">
1094
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:AccountingSupplierParty/cac:Party/cac:PostalAddress" shadowed by preceding rule</xsl:comment>
1095
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1096
- <xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PostalAddress</xsl:attribute>
1097
- </svrl:suppressed-rule>
1098
- </schxslt:rule>
1099
- <xsl:next-match>
1100
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1101
- </xsl:next-match>
1102
- </xsl:when>
1103
- <xsl:otherwise>
1104
- <schxslt:rule pattern="d7e42">
1105
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1106
- <xsl:attribute name="context">cac:AccountingSupplierParty/cac:Party/cac:PostalAddress</xsl:attribute>
1107
- </svrl:fired-rule>
1108
- <xsl:if test="not((cac:Country/cbc:IdentificationCode) != '')">
1109
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-09">
1110
- <xsl:attribute name="test">(cac:Country/cbc:IdentificationCode) != ''</xsl:attribute>
1111
- <svrl:text>[BR-09]-The Seller postal address (BG-5) shall contain a Seller country code (BT-40).</svrl:text>
1112
- <svrl:message-code>BR-09</svrl:message-code>
1113
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1114
- </svrl:failed-assert>
1115
- </xsl:if>
1116
- </schxslt:rule>
1117
- <xsl:next-match>
1118
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1119
- </xsl:next-match>
1120
- </xsl:otherwise>
1121
- </xsl:choose>
1122
- </xsl:template>
1123
- <xsl:template match="/ubl:Invoice/cac:TaxTotal | /cn:CreditNote/cac:TaxTotal" priority="21" mode="d7e42">
1124
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1125
- <xsl:choose>
1126
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1127
- <schxslt:rule pattern="d7e42">
1128
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "/ubl:Invoice/cac:TaxTotal | /cn:CreditNote/cac:TaxTotal" shadowed by preceding rule</xsl:comment>
1129
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1130
- <xsl:attribute name="context">/ubl:Invoice/cac:TaxTotal | /cn:CreditNote/cac:TaxTotal</xsl:attribute>
1131
- </svrl:suppressed-rule>
1132
- </schxslt:rule>
1133
- <xsl:next-match>
1134
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1135
- </xsl:next-match>
1136
- </xsl:when>
1137
- <xsl:otherwise>
1138
- <schxslt:rule pattern="d7e42">
1139
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1140
- <xsl:attribute name="context">/ubl:Invoice/cac:TaxTotal | /cn:CreditNote/cac:TaxTotal</xsl:attribute>
1141
- </svrl:fired-rule>
1142
- <xsl:if test="not((xs:decimal(child::cbc:TaxAmount)= round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) or not(cac:TaxSubtotal))">
1143
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CO-14">
1144
- <xsl:attribute name="test">(xs:decimal(child::cbc:TaxAmount)= round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) or not(cac:TaxSubtotal)</xsl:attribute>
1145
- <svrl:text>[BR-CO-14]-Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).</svrl:text>
1146
- <svrl:message-code>BR-CO-14</svrl:message-code>
1147
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
1148
- </svrl:failed-assert>
1149
- </xsl:if>
1150
- </schxslt:rule>
1151
- <xsl:next-match>
1152
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1153
- </xsl:next-match>
1154
- </xsl:otherwise>
1155
- </xsl:choose>
1156
- </xsl:template>
1157
- <xsl:template match="/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal" priority="20" mode="d7e42">
1158
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1159
- <xsl:choose>
1160
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1161
- <schxslt:rule pattern="d7e42">
1162
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:TaxTotal/cac:TaxSubtotal" shadowed by preceding rule</xsl:comment>
1163
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1164
- <xsl:attribute name="context">cac:TaxTotal/cac:TaxSubtotal</xsl:attribute>
1165
- </svrl:suppressed-rule>
1166
- </schxslt:rule>
1167
- <xsl:next-match>
1168
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1169
- </xsl:next-match>
1170
- </xsl:when>
1171
- <xsl:otherwise>
1172
- <schxslt:rule pattern="d7e42">
1173
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1174
- <xsl:attribute name="context">cac:TaxTotal/cac:TaxSubtotal</xsl:attribute>
1175
- </svrl:fired-rule>
1176
- <xsl:if test="not(exists(cbc:TaxableAmount))">
1177
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-45">
1178
- <xsl:attribute name="test">exists(cbc:TaxableAmount)</xsl:attribute>
1179
- <svrl:text>[BR-45]-Each VAT breakdown (BG-23) shall have a VAT category taxable amount (BT-116).</svrl:text>
1180
- <svrl:message-code>BR-45</svrl:message-code>
1181
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1182
- </svrl:failed-assert>
1183
- </xsl:if>
1184
- <xsl:if test="not(exists(cbc:TaxAmount))">
1185
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-46">
1186
- <xsl:attribute name="test">exists(cbc:TaxAmount)</xsl:attribute>
1187
- <svrl:text>[BR-46]-Each VAT breakdown (BG-23) shall have a VAT category tax amount (BT-117).</svrl:text>
1188
- <svrl:message-code>BR-46</svrl:message-code>
1189
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1190
- </svrl:failed-assert>
1191
- </xsl:if>
1192
- <xsl:if test="not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID))">
1193
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-47">
1194
- <xsl:attribute name="test">exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID)</xsl:attribute>
1195
- <svrl:text>[BR-47]-Each VAT breakdown (BG-23) shall be defined through a VAT category code (BT-118).</svrl:text>
1196
- <svrl:message-code>BR-47</svrl:message-code>
1197
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1198
- </svrl:failed-assert>
1199
- </xsl:if>
1200
- <xsl:if test="not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:Percent) or (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/normalize-space(cbc:ID)='O'))">
1201
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-48">
1202
- <xsl:attribute name="test">exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:Percent) or (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/normalize-space(cbc:ID)='O')</xsl:attribute>
1203
- <svrl:text>[BR-48]-Each VAT breakdown (BG-23) shall have a VAT category rate (BT-119), except if the Invoice is not subject to VAT.</svrl:text>
1204
- <svrl:message-code>BR-48</svrl:message-code>
1205
- <svrl:message-category>Business rules - integrity constraints (BR)</svrl:message-category>
1206
- </svrl:failed-assert>
1207
- </xsl:if>
1208
-
1209
- <xsl:choose>
1210
- <xsl:when test= " not (./cac:TaxCategory/normalize-space(cbc:ID)='S') and (./cac:TaxCategory/normalize-space(cbc:ID)='O' and not(exists(./cac:TaxCategory/cbc:Percent)) or ./cac:TaxCategory/normalize-space(cbc:ID)='E' or ./cac:TaxCategory/normalize-space(cbc:ID)='Z' or normalize-space(./cac:TaxCategory/cbc:Percent)='')">
1211
- <xsl:if test="not(format-number(./cbc:TaxAmount,'#.00') = format-number(( round((((xs:decimal(./cbc:TaxableAmount) * (0)) div 100) * 100 + 0.01)) div 100), '#.00') )">
1212
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-17">
1213
- <xsl:attribute name="test">(round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) = 0 and (round(xs:decimal(cbc:TaxAmount)) = 0)) or (round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) != 0 and ((abs(xs:decimal(cbc:TaxAmount)) - 1 &lt; round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ) and (abs(xs:decimal(cbc:TaxAmount)) + 1 &gt; round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ))) or (not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent))) and (round(xs:decimal(cbc:TaxAmount)) = 0))</xsl:attribute>
1214
- <svrl:text>[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.</svrl:text>
1215
- <svrl:message-code>BR-CO-17</svrl:message-code>
1216
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
1217
- </svrl:failed-assert>
1218
- </xsl:if>
1219
- </xsl:when>
1220
- <xsl:otherwise>
1221
- <xsl:if test=" normalize-space(./cac:TaxCategory/cbc:Percent)='' or not( format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)-0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)+0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)), '#.00')))">
1222
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CO-17">
1223
- <xsl:attribute name="test">(round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) = 0 and (round(xs:decimal(cbc:TaxAmount)) = 0)) or (round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) != 0 and ((abs(xs:decimal(cbc:TaxAmount)) - 1 &lt; round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ) and (abs(xs:decimal(cbc:TaxAmount)) + 1 &gt; round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ))) or (not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent))) and (round(xs:decimal(cbc:TaxAmount)) = 0))</xsl:attribute>
1224
- <svrl:text>[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.</svrl:text>
1225
- <svrl:message-code>BR-CO-17</svrl:message-code>
1226
- <svrl:message-category>Business rules - conditions (BR-CO)</svrl:message-category>
1227
- </svrl:failed-assert>
1228
- </xsl:if>
1229
- </xsl:otherwise>
1230
- </xsl:choose>
1231
-
1232
- <xsl:if test="not(string-length(substring-after(cbc:TaxableAmount,'.'))&lt;=2)">
1233
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-19">
1234
- <xsl:attribute name="test">string-length(substring-after(cbc:TaxableAmount,'.'))&lt;=2</xsl:attribute>
1235
- <svrl:text>[BR-DEC-19]-The allowed maximum number of decimals for the VAT category taxable amount (BT-116) is 2.</svrl:text>
1236
- <svrl:message-code>BR-DEC-19</svrl:message-code>
1237
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
1238
- </svrl:failed-assert>
1239
- </xsl:if>
1240
- <xsl:if test="not(string-length(substring-after(cbc:TaxAmount,'.'))&lt;=2)">
1241
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-20">
1242
- <xsl:attribute name="test">string-length(substring-after(cbc:TaxAmount,'.'))&lt;=2</xsl:attribute>
1243
- <svrl:text>[BR-DEC-20]-The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.</svrl:text>
1244
- <svrl:message-code>BR-DEC-20</svrl:message-code>
1245
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
1246
- </svrl:failed-assert>
1247
- </xsl:if>
1248
- </schxslt:rule>
1249
- <xsl:next-match>
1250
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1251
- </xsl:next-match>
1252
- </xsl:otherwise>
1253
- </xsl:choose>
1254
- </xsl:template>
1255
-
1256
- <xsl:template match="/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="19" mode="d7e42">
1257
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1258
- <xsl:choose>
1259
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1260
- <schxslt:rule pattern="d7e42">
1261
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1262
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1263
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1264
- </svrl:suppressed-rule>
1265
- </schxslt:rule>
1266
- <xsl:next-match>
1267
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1268
- </xsl:next-match>
1269
- </xsl:when>
1270
- <xsl:otherwise>
1271
- <schxslt:rule pattern="d7e42">
1272
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1273
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1274
- </svrl:fired-rule>
1275
- <xsl:if test="not( (xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:Amount)) )))">
1276
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-E-08">
1277
- <xsl:attribute name="test">((xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) )))</xsl:attribute>
1278
- <svrl:text>[BR-E-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Exempt from VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Exempt from VAT".</svrl:text>
1279
- <svrl:message-code>BR-E-08</svrl:message-code>
1280
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
1281
- </svrl:failed-assert>
1282
- </xsl:if>
1283
- <xsl:if test="not(xs:decimal(../cbc:TaxAmount) = 0)">
1284
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-E-09">
1285
- <xsl:attribute name="test">xs:decimal(../cbc:TaxAmount) = 0</xsl:attribute>
1286
- <svrl:text>[BR-E-09]-The VAT category tax amount (BT-117) In a VAT breakdown (BG-23) where the VAT category code (BT-118) equals "Exempt from VAT" shall equal 0 (zero).</svrl:text>
1287
- <svrl:message-code>BR-E-09</svrl:message-code>
1288
- <svrl:message-category>Business rules - Exempted from VAT (BR-E)</svrl:message-category>
1289
- </svrl:failed-assert>
1290
- </xsl:if>
1291
- </schxslt:rule>
1292
- <xsl:next-match>
1293
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1294
- </xsl:next-match>
1295
- </xsl:otherwise>
1296
- </xsl:choose>
1297
- </xsl:template>
1298
- <xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="18" mode="d7e42">
1299
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1300
- <xsl:choose>
1301
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1302
- <schxslt:rule pattern="d7e42">
1303
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1304
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1305
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1306
- </svrl:suppressed-rule>
1307
- </schxslt:rule>
1308
- <xsl:next-match>
1309
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1310
- </xsl:next-match>
1311
- </xsl:when>
1312
- <xsl:otherwise>
1313
- <schxslt:rule pattern="d7e42">
1314
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1315
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1316
- </svrl:fired-rule>
1317
- <xsl:if test="not((xs:decimal(cbc:Percent) = 0))">
1318
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-E-06">
1319
- <xsl:attribute name="test">(xs:decimal(cbc:Percent) = 0)</xsl:attribute>
1320
- <svrl:text>[BR-E-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Exempt from VAT", the Document level allowance VAT rate (BT-96) shall be 0 (zero).</svrl:text>
1321
- <svrl:message-code>BR-E-06</svrl:message-code>
1322
- <svrl:message-category>Business rules - Exempted from VAT (BR-E)</svrl:message-category>
1323
- </svrl:failed-assert>
1324
- </xsl:if>
1325
- </schxslt:rule>
1326
- <xsl:next-match>
1327
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1328
- </xsl:next-match>
1329
- </xsl:otherwise>
1330
- </xsl:choose>
1331
- </xsl:template>
1332
- <xsl:template match="cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="17" mode="d7e42">
1333
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1334
- <xsl:choose>
1335
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1336
- <schxslt:rule pattern="d7e42">
1337
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1338
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1339
- <xsl:attribute name="context">cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1340
- </svrl:suppressed-rule>
1341
- </schxslt:rule>
1342
- <xsl:next-match>
1343
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1344
- </xsl:next-match>
1345
- </xsl:when>
1346
- <xsl:otherwise>
1347
- <schxslt:rule pattern="d7e42">
1348
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1349
- <xsl:attribute name="context">cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1350
- </svrl:fired-rule>
1351
- <xsl:if test="not((xs:decimal(cbc:Percent) = 0))">
1352
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-E-05">
1353
- <xsl:attribute name="test">(xs:decimal(cbc:Percent) = 0)</xsl:attribute>
1354
- <svrl:text>[BR-E-05]-In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Exempt from VAT", the Invoiced item VAT rate (BT-152) shall be 0 (zero).</svrl:text>
1355
- <svrl:message-code>BR-E-05</svrl:message-code>
1356
- <svrl:message-category>Business rules - Exempted from VAT (BR-E)</svrl:message-category>
1357
- </svrl:failed-assert>
1358
- </xsl:if>
1359
- </schxslt:rule>
1360
- <xsl:next-match>
1361
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1362
- </xsl:next-match>
1363
- </xsl:otherwise>
1364
- </xsl:choose>
1365
- </xsl:template>
1366
- <xsl:template match="/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="16" mode="d7e42">
1367
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1368
- <xsl:choose>
1369
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1370
- <schxslt:rule pattern="d7e42">
1371
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1372
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1373
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1374
- </svrl:suppressed-rule>
1375
- </schxslt:rule>
1376
- <xsl:next-match>
1377
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1378
- </xsl:next-match>
1379
- </xsl:when>
1380
- <xsl:otherwise>
1381
- <schxslt:rule pattern="d7e42">
1382
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1383
- <xsl:attribute name="context">cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']
1384
-
1385
- </xsl:attribute>
1386
- </svrl:fired-rule>
1387
- <xsl:if test="not((xs:decimal(../cbc:TaxableAmount) = (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)))))">
1388
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-O-08">
1389
- <xsl:attribute name="test">(exists(//cac:InvoiceLine) and (xs:decimal(../cbc:TaxableAmount) = (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount))))) or (exists(//cac:CreditNoteLine) and (xs:decimal(../cbc:TaxableAmount) = (sum(../../../cac:CreditNoteLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)))))</xsl:attribute>
1390
- <svrl:text>[BR-O-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Not subject to VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Not subject to VAT".</svrl:text>
1391
- <svrl:message-code>BR-O-08</svrl:message-code>
1392
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
1393
- </svrl:failed-assert>
1394
- </xsl:if>
1395
- <xsl:if test="not(xs:decimal(../cbc:TaxAmount) = 0)">
1396
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-O-09">
1397
- <xsl:attribute name="test">xs:decimal(../cbc:TaxAmount) = 0</xsl:attribute>
1398
- <svrl:text>[BR-O-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where the VAT category code (BT-118) is "Not subject to VAT" shall be 0 (zero).</svrl:text>
1399
- <svrl:message-code>BR-O-09</svrl:message-code>
1400
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
1401
- </svrl:failed-assert>
1402
- </xsl:if>
1403
- </schxslt:rule>
1404
- <xsl:next-match>
1405
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1406
- </xsl:next-match>
1407
- </xsl:otherwise>
1408
- </xsl:choose>
1409
- </xsl:template>
1410
- <xsl:template match="/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="13" mode="d7e42">
1411
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1412
- <xsl:choose>
1413
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1414
- <schxslt:rule pattern="d7e42">
1415
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1416
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1417
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1418
- </svrl:suppressed-rule>
1419
- </schxslt:rule>
1420
- <xsl:next-match>
1421
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1422
- </xsl:next-match>
1423
- </xsl:when>
1424
- <xsl:otherwise>
1425
- <schxslt:rule pattern="d7e42">
1426
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1427
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1428
- </svrl:fired-rule>
1429
- <xsl:if test="not( (xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) )))">
1430
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-S-08">
1431
- <xsl:attribute name="test">((xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) )))</xsl:attribute>
1432
- <svrl:text>[BR-S-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Standard rated" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Standard Rate".</svrl:text>
1433
- <svrl:message-code>BR-S-08</svrl:message-code>
1434
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
1435
- </svrl:failed-assert>
1436
- </xsl:if>
1437
- <xsl:if test="normalize-space(cbc:Percent)='' or not( format-number(../cbc:TaxAmount,'#.00') = (format-number((( round((((../cbc:TaxableAmount * (../cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)-0.01), '#.00')) or format-number(../cbc:TaxAmount,'#.00') = (format-number((( round((((../cbc:TaxableAmount * (../cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)+0.01), '#.00')) or format-number(../cbc:TaxAmount,'#.00') = (format-number((( round((((../cbc:TaxableAmount * (../cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)), '#.00')))">
1438
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-S-09">
1439
- <xsl:attribute name="test">(abs(xs:decimal(../cbc:TaxAmount)) - 1 &lt; round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 ) and (abs(xs:decimal(../cbc:TaxAmount)) + 1 &gt; round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 )</xsl:attribute>
1440
- <svrl:text>[BR-S-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119) / 100), rounded to two decimals.</svrl:text>
1441
- <svrl:message-code>BR-S-09</svrl:message-code>
1442
- <svrl:message-category>Business rules - VAT standard and reduced rate (BR-S)</svrl:message-category>
1443
- </svrl:failed-assert>
1444
- </xsl:if>
1445
- <xsl:if test="(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID/text() = 'S') and (exists(cbc:TaxExemptionReason) or exists(cbc:TaxExemptionReasonCode))">
1446
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-S-10">
1447
- <xsl:attribute name="test">not(cbc:TaxExemptionReason) and not(cbc:TaxExemptionReasonCode)</xsl:attribute>
1448
- <svrl:text>[BR-S-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) "Standard rate" shall not have a VAT exemption reason code (BT-121) or VAT exemption reason text (BT-120).</svrl:text>
1449
- <svrl:message-code>BR-S-10</svrl:message-code>
1450
- <svrl:message-category>Business rules - VAT standard and reduced rate (BR-S)</svrl:message-category>
1451
- </svrl:failed-assert>
1452
- </xsl:if>
1453
- </schxslt:rule>
1454
- <xsl:next-match>
1455
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1456
- </xsl:next-match>
1457
- </xsl:otherwise>
1458
- </xsl:choose>
1459
- </xsl:template>
1460
- <xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="12" mode="d7e42">
1461
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1462
- <xsl:choose>
1463
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1464
- <schxslt:rule pattern="d7e42">
1465
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1466
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1467
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1468
- </svrl:suppressed-rule>
1469
- </schxslt:rule>
1470
- <xsl:next-match>
1471
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1472
- </xsl:next-match>
1473
- </xsl:when>
1474
- <xsl:otherwise>
1475
- <schxslt:rule pattern="d7e42">
1476
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1477
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1478
- </svrl:fired-rule>
1479
- <xsl:if test="not((cbc:Percent) &gt; 0)">
1480
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-S-06">
1481
- <xsl:attribute name="test">(cbc:Percent) &gt; 0</xsl:attribute>
1482
- <svrl:text>[BR-S-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Standard rated" the Document level allowance VAT rate (BT-96) shall be greater than zero.</svrl:text>
1483
- <svrl:message-code>BR-S-06</svrl:message-code>
1484
- <svrl:message-category>Business rules - VAT standard and reduced rate (BR-S)</svrl:message-category>
1485
- </svrl:failed-assert>
1486
- </xsl:if>
1487
- </schxslt:rule>
1488
- <xsl:next-match>
1489
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1490
- </xsl:next-match>
1491
- </xsl:otherwise>
1492
- </xsl:choose>
1493
- </xsl:template>
1494
- <xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="12" mode="d7e42">
1495
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1496
- <xsl:choose>
1497
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1498
- <schxslt:rule pattern="d7e42">
1499
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1500
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1501
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1502
- </svrl:suppressed-rule>
1503
- </schxslt:rule>
1504
- <xsl:next-match>
1505
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1506
- </xsl:next-match>
1507
- </xsl:when>
1508
- <xsl:otherwise>
1509
- <schxslt:rule pattern="d7e42">
1510
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1511
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1512
- </svrl:fired-rule>
1513
- <xsl:if test="not((cbc:Percent) &gt; 0)">
1514
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-S-07">
1515
- <xsl:attribute name="test">(cbc:Percent) &gt; 0</xsl:attribute>
1516
- <svrl:text>[BR-S-07]--In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Standard rated" the Document level charge VAT rate (BT-103) shall be greater than zero.</svrl:text>
1517
- <svrl:message-code>BR-S-07</svrl:message-code>
1518
- <svrl:message-category>Business rules - VAT standard and reduced rate (BR-S)</svrl:message-category>
1519
- </svrl:failed-assert>
1520
- </xsl:if>
1521
- </schxslt:rule>
1522
- <xsl:next-match>
1523
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1524
- </xsl:next-match>
1525
- </xsl:otherwise>
1526
- </xsl:choose>
1527
- </xsl:template>
1528
- <xsl:template match="/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="11" mode="d7e42">
1529
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1530
- <xsl:choose>
1531
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1532
- <schxslt:rule pattern="d7e42">
1533
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1534
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1535
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1536
- </svrl:suppressed-rule>
1537
- </schxslt:rule>
1538
- <xsl:next-match>
1539
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1540
- </xsl:next-match>
1541
- </xsl:when>
1542
- <xsl:otherwise>
1543
- <schxslt:rule pattern="d7e42">
1544
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1545
- <xsl:attribute name="context">/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1546
- </svrl:fired-rule>
1547
- <xsl:if test="not( (xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:Amount)) )))">
1548
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-Z-08">
1549
- <xsl:attribute name="test">((xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) )))</xsl:attribute>
1550
- <svrl:text>[BR-Z-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Zero rated" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Zero Rated".</svrl:text>
1551
- <svrl:message-code>BR-Z-08</svrl:message-code>
1552
- <svrl:message-category>Business rules - Not subject to VAT (BR-OO)</svrl:message-category>
1553
- </svrl:failed-assert>
1554
- </xsl:if>
1555
- <xsl:if test="not(xs:decimal(../cbc:TaxAmount) = 0)">
1556
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-Z-09">
1557
- <xsl:attribute name="test">xs:decimal(../cbc:TaxAmount) = 0</xsl:attribute>
1558
- <svrl:text>[BR-Z-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Zero rated" shall equal 0 (zero).</svrl:text>
1559
- <svrl:message-code>BR-Z-09</svrl:message-code>
1560
- <svrl:message-category>Business rules - VAT zero rate (BR-Z)</svrl:message-category>
1561
- </svrl:failed-assert>
1562
- </xsl:if>
1563
- </schxslt:rule>
1564
- <xsl:next-match>
1565
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1566
- </xsl:next-match>
1567
- </xsl:otherwise>
1568
- </xsl:choose>
1569
- </xsl:template>
1570
- <xsl:template match="cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="10" mode="d7e42">
1571
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1572
- <xsl:choose>
1573
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1574
- <schxslt:rule pattern="d7e42">
1575
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1576
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1577
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1578
- </svrl:suppressed-rule>
1579
- </schxslt:rule>
1580
- <xsl:next-match>
1581
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1582
- </xsl:next-match>
1583
- </xsl:when>
1584
- <xsl:otherwise>
1585
- <schxslt:rule pattern="d7e42">
1586
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1587
- <xsl:attribute name="context">cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1588
- </svrl:fired-rule>
1589
- <xsl:if test="not((xs:decimal(cbc:Percent) = 0))">
1590
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-Z-06">
1591
- <xsl:attribute name="test">(xs:decimal(cbc:Percent) = 0)</xsl:attribute>
1592
- <svrl:text>[BR-Z-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Zero rated" the Document level allowance VAT rate (BT-96) shall be 0 (zero).</svrl:text>
1593
- <svrl:message-code>BR-Z-06</svrl:message-code>
1594
- <svrl:message-category>Business rules - VAT zero rate (BR-Z)</svrl:message-category>
1595
- </svrl:failed-assert>
1596
- </xsl:if>
1597
- </schxslt:rule>
1598
- <xsl:next-match>
1599
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1600
- </xsl:next-match>
1601
- </xsl:otherwise>
1602
- </xsl:choose>
1603
- </xsl:template>
1604
- <xsl:template match="cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" priority="9" mode="d7e42">
1605
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1606
- <xsl:choose>
1607
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e42']">
1608
- <schxslt:rule pattern="d7e42">
1609
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']" shadowed by preceding rule</xsl:comment>
1610
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1611
- <xsl:attribute name="context">cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1612
- </svrl:suppressed-rule>
1613
- </schxslt:rule>
1614
- <xsl:next-match>
1615
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1616
- </xsl:next-match>
1617
- </xsl:when>
1618
- <xsl:otherwise>
1619
- <schxslt:rule pattern="d7e42">
1620
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1621
- <xsl:attribute name="context">cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] | cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']</xsl:attribute>
1622
- </svrl:fired-rule>
1623
- <xsl:if test="not((xs:decimal(cbc:Percent) = 0))">
1624
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-Z-05">
1625
- <xsl:attribute name="test">(xs:decimal(cbc:Percent) = 0)</xsl:attribute>
1626
- <svrl:text>[BR-Z-05]-In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Zero rated" the Invoiced item VAT rate (BT-152) shall be 0 (zero).</svrl:text>
1627
- <svrl:message-code>BR-Z-05</svrl:message-code>
1628
- <svrl:message-category>Business rules - VAT zero rate (BR-Z)</svrl:message-category>
1629
- </svrl:failed-assert>
1630
- </xsl:if>
1631
- </schxslt:rule>
1632
- <xsl:next-match>
1633
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e42')"/>
1634
- </xsl:next-match>
1635
- </xsl:otherwise>
1636
- </xsl:choose>
1637
- </xsl:template>
1638
- <xsl:template match="ubl:Invoice/cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:DocumentCurrencyCode]" priority="8" mode="d7e42">
1639
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1640
- <xsl:choose>
1641
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e353']">
1642
- <schxslt:rule pattern="d7e353">
1643
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:DocumentCurrencyCode]" shadowed by preceding rule</xsl:comment>
1644
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1645
- <xsl:attribute name="context">cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:DocumentCurrencyCode]</xsl:attribute>
1646
- </svrl:suppressed-rule>
1647
- </schxslt:rule>
1648
- <xsl:next-match>
1649
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1650
- </xsl:next-match>
1651
- </xsl:when>
1652
- <xsl:otherwise>
1653
- <schxslt:rule pattern="d7e353">
1654
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1655
- <xsl:attribute name="context">cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:DocumentCurrencyCode]</xsl:attribute>
1656
- </svrl:fired-rule>
1657
- <xsl:if test="not((string-length(substring-after(.,'.'))&lt;=2))">
1658
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-13">
1659
- <xsl:attribute name="test">(string-length(substring-after(.,'.'))&lt;=2)</xsl:attribute>
1660
- <svrl:text>[BR-DEC-13]-The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.</svrl:text>
1661
- <svrl:message-code>BR-DEC-13</svrl:message-code>
1662
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
1663
- </svrl:failed-assert>
1664
- </xsl:if>
1665
- </schxslt:rule>
1666
- <xsl:next-match>
1667
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e353')"/>
1668
- </xsl:next-match>
1669
- </xsl:otherwise>
1670
- </xsl:choose>
1671
- </xsl:template>
1672
- <xsl:template match="ubl:Invoice/cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:TaxCurrencyCode]" priority="7" mode="d7e42">
1673
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1674
- <xsl:choose>
1675
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e362']">
1676
- <schxslt:rule pattern="d7e362">
1677
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:TaxCurrencyCode]" shadowed by preceding rule</xsl:comment>
1678
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1679
- <xsl:attribute name="context">cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:TaxCurrencyCode]</xsl:attribute>
1680
- </svrl:suppressed-rule>
1681
- </schxslt:rule>
1682
- <xsl:next-match>
1683
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1684
- </xsl:next-match>
1685
- </xsl:when>
1686
- <xsl:otherwise>
1687
- <schxslt:rule pattern="d7e362">
1688
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
1689
- <xsl:attribute name="context">cac:TaxTotal/cbc:TaxAmount[@currencyID = //cbc:TaxCurrencyCode]</xsl:attribute>
1690
- </svrl:fired-rule>
1691
- <xsl:if test="not((string-length(substring-after(.,'.'))&lt;=2))">
1692
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-DEC-15">
1693
- <xsl:attribute name="test">(string-length(substring-after(.,'.'))&lt;=2)</xsl:attribute>
1694
- <svrl:text>[BR-DEC-15]-The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.</svrl:text>
1695
- <svrl:message-code>BR-DEC-15</svrl:message-code>
1696
- <svrl:message-category>Business rules - Decimals (BR-DEC)</svrl:message-category>
1697
- </svrl:failed-assert>
1698
- </xsl:if>
1699
- </schxslt:rule>
1700
- <xsl:next-match>
1701
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e362')"/>
1702
- </xsl:next-match>
1703
- </xsl:otherwise>
1704
- </xsl:choose>
1705
- </xsl:template>
1706
- <xsl:template match="cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode" priority="6" mode="d7e42">
1707
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1708
- <xsl:choose>
1709
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1710
- <schxslt:rule pattern="d7e371">
1711
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode" shadowed by preceding rule</xsl:comment>
1712
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1713
- <xsl:attribute name="context">cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode</xsl:attribute>
1714
- </svrl:suppressed-rule>
1715
- </schxslt:rule>
1716
- <xsl:next-match>
1717
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1718
- </xsl:next-match>
1719
- </xsl:when>
1720
- <xsl:otherwise>
1721
- <schxslt:rule pattern="d7e371">
1722
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1723
- <xsl:attribute name="context">cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode</xsl:attribute>
1724
- </svrl:fired-rule>
1725
- <xsl:if test="not((self::cbc:InvoiceTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 80 82 84 130 202 203 204 211 295 325 326 380 381 383 384 385 386 387 388 389 390 393 394 395 456 457 527 575 623 633 751 780 935 ', concat(' ', normalize-space(.), ' '))))) or (self::cbc:CreditNoteTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 81 83 261 262 296 308 396 420 458 532 ', concat(' ', normalize-space(.), ' '))))))">
1726
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CL-01">
1727
- <xsl:attribute name="test">(self::cbc:InvoiceTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 80 82 84 130 202 203 204 211 295 325 326 380 381 383 384 385 386 387 388 389 390 393 394 395 456 457 527 575 623 633 751 780 935 ', concat(' ', normalize-space(.), ' '))))) or (self::cbc:CreditNoteTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 81 83 261 262 296 308 396 420 458 532 ', concat(' ', normalize-space(.), ' ')))))</xsl:attribute>
1728
- <svrl:text>[BR-CL-01]-The document type code MUST be coded by the invoice and credit note related code lists of UNTDID 1001.</svrl:text>
1729
- <svrl:message-code>BR-CL-01</svrl:message-code>
1730
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1731
- </svrl:failed-assert>
1732
- </xsl:if>
1733
- </schxslt:rule>
1734
- <xsl:next-match>
1735
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1736
- </xsl:next-match>
1737
- </xsl:otherwise>
1738
- </xsl:choose>
1739
- </xsl:template>
1740
- <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="5" mode="d7e42">
1741
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1742
- <xsl:choose>
1743
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1744
- <schxslt:rule pattern="d7e371">
1745
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: 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>
1746
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1747
- <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>
1748
- </svrl:suppressed-rule>
1749
- </schxslt:rule>
1750
- <xsl:next-match>
1751
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1752
- </xsl:next-match>
1753
- </xsl:when>
1754
- <xsl:otherwise>
1755
- <schxslt:rule pattern="d7e371">
1756
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1757
- <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>
1758
- </svrl:fired-rule>
1759
- <xsl:if test=" string-length(@currencyID) &gt; 0 and not(((not(contains(normalize-space(@currencyID), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(@currencyID), ' ')))))">
1760
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CL-03">
1761
- <xsl:attribute name="test">((not(contains(normalize-space(@currencyID), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(@currencyID), ' '))))</xsl:attribute>
1762
- <svrl:text>[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3</svrl:text>
1763
- <svrl:message-code>BR-CL-03</svrl:message-code>
1764
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1765
- </svrl:failed-assert>
1766
- </xsl:if>
1767
- </schxslt:rule>
1768
- <xsl:next-match>
1769
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1770
- </xsl:next-match>
1771
- </xsl:otherwise>
1772
- </xsl:choose>
1773
- </xsl:template>
1774
- <xsl:template match="cbc:DocumentCurrencyCode" priority="4" mode="d7e42">
1775
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1776
- <xsl:choose>
1777
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1778
- <schxslt:rule pattern="d7e371">
1779
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cbc:DocumentCurrencyCode" shadowed by preceding rule</xsl:comment>
1780
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1781
- <xsl:attribute name="context">cbc:DocumentCurrencyCode</xsl:attribute>
1782
- </svrl:suppressed-rule>
1783
- </schxslt:rule>
1784
- <xsl:next-match>
1785
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1786
- </xsl:next-match>
1787
- </xsl:when>
1788
- <xsl:otherwise>
1789
- <schxslt:rule pattern="d7e371">
1790
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1791
- <xsl:attribute name="context">cbc:DocumentCurrencyCode</xsl:attribute>
1792
- </svrl:fired-rule>
1793
- <xsl:if test="not(((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' ')))))">
1794
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CL-04">
1795
- <xsl:attribute name="test">((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))</xsl:attribute>
1796
- <svrl:text>[BR-CL-04]-Invoice currency code MUST be coded using ISO code list 4217 alpha-3</svrl:text>
1797
- <svrl:message-code>BR-CL-04</svrl:message-code>
1798
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1799
- </svrl:failed-assert>
1800
- </xsl:if>
1801
- </schxslt:rule>
1802
- <xsl:next-match>
1803
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1804
- </xsl:next-match>
1805
- </xsl:otherwise>
1806
- </xsl:choose>
1807
- </xsl:template>
1808
- <xsl:template match="cbc:TaxCurrencyCode" priority="3" mode="d7e42">
1809
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1810
- <xsl:choose>
1811
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1812
- <schxslt:rule pattern="d7e371">
1813
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cbc:TaxCurrencyCode" shadowed by preceding rule</xsl:comment>
1814
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1815
- <xsl:attribute name="context">cbc:TaxCurrencyCode</xsl:attribute>
1816
- </svrl:suppressed-rule>
1817
- </schxslt:rule>
1818
- <xsl:next-match>
1819
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1820
- </xsl:next-match>
1821
- </xsl:when>
1822
- <xsl:otherwise>
1823
- <schxslt:rule pattern="d7e371">
1824
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1825
- <xsl:attribute name="context">cbc:TaxCurrencyCode</xsl:attribute>
1826
- </svrl:fired-rule>
1827
- <xsl:if test="not(((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' ')))))">
1828
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CL-05">
1829
- <xsl:attribute name="test">((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' '))))</xsl:attribute>
1830
- <svrl:text>[BR-CL-05]-Tax currency code MUST be coded using ISO code list 4217 alpha-3</svrl:text>
1831
- <svrl:message-code>BR-CL-05</svrl:message-code>
1832
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1833
- </svrl:failed-assert>
1834
- </xsl:if>
1835
- </schxslt:rule>
1836
- <xsl:next-match>
1837
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1838
- </xsl:next-match>
1839
- </xsl:otherwise>
1840
- </xsl:choose>
1841
- </xsl:template>
1842
- <xsl:template match="cac:Country/cbc:IdentificationCode" priority="2" mode="d7e42">
1843
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1844
- <xsl:choose>
1845
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1846
- <schxslt:rule pattern="d7e371">
1847
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:Country/cbc:IdentificationCode" shadowed by preceding rule</xsl:comment>
1848
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1849
- <xsl:attribute name="context">cac:Country/cbc:IdentificationCode</xsl:attribute>
1850
- </svrl:suppressed-rule>
1851
- </schxslt:rule>
1852
- <xsl:next-match>
1853
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1854
- </xsl:next-match>
1855
- </xsl:when>
1856
- <xsl:otherwise>
1857
- <schxslt:rule pattern="d7e371">
1858
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1859
- <xsl:attribute name="context">cac:Country/cbc:IdentificationCode</xsl:attribute>
1860
- </svrl:fired-rule>
1861
- <xsl:if test="not(((not(contains(normalize-space(.), ' ')) and contains(' 1A 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 XI YE YT ZA ZM ZW ', concat(' ', normalize-space(.), ' ')))))">
1862
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CL-14">
1863
- <xsl:attribute name="test">((not(contains(normalize-space(.), ' ')) and contains(' 1A 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 XI YE YT ZA ZM ZW ', concat(' ', normalize-space(.), ' '))))</xsl:attribute>
1864
- <svrl:text>[BR-CL-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1</svrl:text>
1865
- <svrl:message-code>BR-CL-14</svrl:message-code>
1866
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1867
- </svrl:failed-assert>
1868
- </xsl:if>
1869
- </schxslt:rule>
1870
- <xsl:next-match>
1871
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1872
- </xsl:next-match>
1873
- </xsl:otherwise>
1874
- </xsl:choose>
1875
- </xsl:template>
1876
- <xsl:template match="cac:PaymentMeans/cbc:PaymentMeansCode" priority="1" mode="d7e42">
1877
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1878
- <xsl:choose>
1879
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1880
- <schxslt:rule pattern="d7e371">
1881
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">warning: Rule for context "cac:PaymentMeans/cbc:PaymentMeansCode" shadowed by preceding rule</xsl:comment>
1882
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1883
- <xsl:attribute name="context">cac:PaymentMeans/cbc:PaymentMeansCode</xsl:attribute>
1884
- </svrl:suppressed-rule>
1885
- </schxslt:rule>
1886
- <xsl:next-match>
1887
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1888
- </xsl:next-match>
1889
- </xsl:when>
1890
- <xsl:otherwise>
1891
- <schxslt:rule pattern="d7e371">
1892
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1893
- <xsl:attribute name="context">cac:PaymentMeans/cbc:PaymentMeansCode</xsl:attribute>
1894
- </svrl:fired-rule>
1895
- <xsl:if test="not(( ( not(contains(normalize-space(.),' ')) and contains( ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 74 75 76 77 78 91 92 93 94 95 96 97 ZZZ ',concat(' ',normalize-space(.),' ') ) ) ))">
1896
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="warning" id="BR-CL-16">
1897
- <xsl:attribute name="test">( ( not(contains(normalize-space(.),' ')) and contains( ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 74 75 76 77 78 91 92 93 94 95 96 97 ZZZ ',concat(' ',normalize-space(.),' ') ) ) )</xsl:attribute>
1898
- <svrl:text>[BR-CL-16]-Payment means in an invoice MUST be coded using UNCL4461 code list</svrl:text>
1899
- <svrl:message-code>BR-CL-16</svrl:message-code>
1900
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1901
- </svrl:failed-assert>
1902
- </xsl:if>
1903
- </schxslt:rule>
1904
- <xsl:next-match>
1905
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1906
- </xsl:next-match>
1907
- </xsl:otherwise>
1908
- </xsl:choose>
1909
- </xsl:template>
1910
- <xsl:template match="/ubl:Invoice / cac:TaxTotal / cac:TaxSubtotal / cac:TaxCategory / cbc:ID | /ubl:Invoice/cac:InvoiceLine/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID | /ubl:Invoice / cac:AllowanceCharge / cac:TaxCategory / cbc:ID | /ubl:Invoice / cac:InvoiceLine / cac:Item / cac:ClassifiedTaxCategory / cbc:ID" priority="0" mode="d7e42">
1911
- <xsl:param name="schxslt:patterns-matched" as="xs:string*"/>
1912
- <xsl:choose>
1913
- <xsl:when test="$schxslt:patterns-matched[. = 'd7e371']">
1914
- <schxslt:rule pattern="d7e371">
1915
- <xsl:comment xmlns:svrl="http://purl.oclc.org/dsdl/svrl">error: Rule for context "cac:ClassifiedTaxCategory/cbc:ID | cac:TaxSubtotal/cac:TaxCategory/cbc:ID" shadowed by preceding rule</xsl:comment>
1916
- <svrl:suppressed-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1917
- <xsl:attribute name="context">cac:ClassifiedTaxCategory/cbc:ID</xsl:attribute>
1918
- </svrl:suppressed-rule>
1919
- </schxslt:rule>
1920
- <xsl:next-match>
1921
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="$schxslt:patterns-matched"/>
1922
- </xsl:next-match>
1923
- </xsl:when>
1924
- <xsl:otherwise>
1925
- <schxslt:rule pattern="d7e371">
1926
- <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" flag="fatal">
1927
- <xsl:attribute name="context">cac:ClassifiedTaxCategory/cbc:ID | cac:TaxSubtotal/cac:TaxCategory/cbc:ID</xsl:attribute>
1928
- </svrl:fired-rule>
1929
- <xsl:if test="not(( ( not(contains(normalize-space(.),' ')) and contains( ' AE L M E S Z G O K B ',concat(' ',normalize-space(.),' ') ) ) ))">
1930
- <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" location="{schxslt:location(.)}" flag="error" id="BR-CL-18">
1931
- <xsl:attribute name="test">( ( not(contains(normalize-space(.),' ')) and contains( ' AE L M E S Z G O K B ',concat(' ',normalize-space(.),' ') ) ) )</xsl:attribute>
1932
- <svrl:text>[BR-CL-18]-Invoice tax categories MUST be coded using UNCL5305 code list.</svrl:text>
1933
- <svrl:message-code>BR-CL-18</svrl:message-code>
1934
- <svrl:message-category>Business rules - Code lists (BR-CL)</svrl:message-category>
1935
- </svrl:failed-assert>
1936
- </xsl:if>
1937
- </schxslt:rule>
1938
- <xsl:next-match>
1939
- <xsl:with-param name="schxslt:patterns-matched" as="xs:string*" select="($schxslt:patterns-matched, 'd7e371')"/>
1940
- </xsl:next-match>
1941
- </xsl:otherwise>
1942
- </xsl:choose>
1943
- </xsl:template>
1944
- <xsl:function name="schxslt:location" as="xs:string">
1945
- <xsl:param name="node" as="node()"/>
1946
- <xsl:variable name="segments" as="xs:string*">
1947
- <xsl:for-each select="($node/ancestor-or-self::node())">
1948
- <xsl:variable name="position">
1949
- <xsl:number level="single"/>
1950
- </xsl:variable>
1951
- <xsl:choose>
1952
- <xsl:when test=". instance of element()">
1953
- <xsl:value-of select="concat('Q{', namespace-uri(.), '}', local-name(.), '[', $position, ']')"/>
1954
- </xsl:when>
1955
- <xsl:when test=". instance of attribute()">
1956
- <xsl:value-of select="concat('@Q{', namespace-uri(.), '}', local-name(.))"/>
1957
- </xsl:when>
1958
- <xsl:when test=". instance of processing-instruction()">
1959
- <xsl:value-of select="concat('processing-instruction(&#34;', name(.), '&#34;)[', $position, ']')"/>
1960
- </xsl:when>
1961
- <xsl:when test=". instance of comment()">
1962
- <xsl:value-of select="concat('comment()[', $position, ']')"/>
1963
- </xsl:when>
1964
- <xsl:when test=". instance of text()">
1965
- <xsl:value-of select="concat('text()[', $position, ']')"/>
1966
- </xsl:when>
1967
- <xsl:otherwise/>
1968
- </xsl:choose>
1969
- </xsl:for-each>
1970
- </xsl:variable>
1971
- <xsl:value-of select="concat('/', string-join($segments, '/'))"/>
1972
- </xsl:function>
1973
- </xsl:transform>