zatca 0.1.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/einvoicing-sdk/Apps/fatoora +12 -0
- data/einvoicing-sdk/Apps/fatoora.bat +16 -0
- data/einvoicing-sdk/Apps/global.json +1 -0
- data/einvoicing-sdk/Apps/jq.exe +0 -0
- data/einvoicing-sdk/Apps/zatca-einvoicing-sdk-238-R3.2.7.jar +0 -0
- data/einvoicing-sdk/Configuration/config.json +11 -0
- data/einvoicing-sdk/Configuration/defaults.json +11 -0
- data/einvoicing-sdk/Configuration/jq.exe +0 -0
- data/einvoicing-sdk/Configuration/usage.txt +16 -0
- data/einvoicing-sdk/Data/Certificates/cert.pem +1 -0
- data/einvoicing-sdk/Data/Certificates/ec-secp256k1-priv-key.pem +1 -0
- data/einvoicing-sdk/Data/Input/csr-config-example-AR-VAT-Group.properties +9 -0
- data/einvoicing-sdk/Data/Input/csr-config-example-AR.properties +9 -0
- data/einvoicing-sdk/Data/Input/csr-config-example-EN-VAT-group.properties +9 -0
- data/einvoicing-sdk/Data/Input/csr-config-example-EN.properties +9 -0
- data/einvoicing-sdk/Data/Input/csr-config-template.properties +9 -0
- data/einvoicing-sdk/Data/PIH/pih.txt +1 -0
- data/einvoicing-sdk/Data/Rules/schematrons/20210819_ZATCA_E-invoice_Validation_Rules.xsl +2844 -0
- data/einvoicing-sdk/Data/Rules/schematrons/CEN-EN16931-UBL.xsl +1973 -0
- data/einvoicing-sdk/Data/Samples/PDF-A3/Simplified Debit Note.pdf +0 -0
- data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Credit Note.pdf +0 -0
- data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Debit Note.pdf +0 -0
- data/einvoicing-sdk/Data/Samples/PDF-A3/Standard Invoice.pdf +0 -0
- data/einvoicing-sdk/Data/Samples/PDF-A3/Tax_Invoice_USD.pdf +0 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Credit/Simplified_Credit_Note.xml +300 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Credit/Simplified_Credit_Note_Error.xml +225 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Debit/Simplified_Debit_Note.xml +211 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Debit/Simplified_Debit_Note_Error.xml +226 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Additional_Simplified_Invoices/Out_Of_Scope_Simplified_Invoice.xml +207 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Additional_Simplified_Invoices/Simplified_Invoice_USD.xml +246 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Simplified_Invoice.xml +246 -0
- data/einvoicing-sdk/Data/Samples/Simplified/Invoice/Simplified_Invoice_Error.xml +228 -0
- data/einvoicing-sdk/Data/Samples/Standard/Credit/Standard_Credit_Note.xml +227 -0
- data/einvoicing-sdk/Data/Samples/Standard/Credit/Standard_Credit_Note_Error.xml +224 -0
- data/einvoicing-sdk/Data/Samples/Standard/Debit/Standard_Debit_Note.xml +227 -0
- data/einvoicing-sdk/Data/Samples/Standard/Debit/Standard_Debit_Note_Error.xml +226 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Exempt_Standard_Invoice.xml +227 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Standard_Invoice_USD.xml +227 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Additional_Standard_Invoices/Zero_Rate_Standard_Invoice.xml +227 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Sample Invoice[Advance Payements] - 1.xml +294 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Sample Invoice[Advance Payements] - 2.xml +432 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Standard_Invoice.xml +222 -0
- data/einvoicing-sdk/Data/Samples/Standard/Invoice/Standard_Invoice_Error.xml +228 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/CCTS_CCT_SchemaModule-2.1.xsd +731 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonAggregateComponents-2.1.xsd +44365 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonBasicComponents-2.1.xsd +5389 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonExtensionComponents-2.1.xsd +223 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CommonSignatureComponents-2.1.xsd +101 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-CoreComponentParameters-2.1.xsd +63 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-ExtensionContentDataType-2.1.xsd +89 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-QualifiedDataTypes-2.1.xsd +69 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-SignatureAggregateComponents-2.1.xsd +138 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-SignatureBasicComponents-2.1.xsd +78 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-UnqualifiedDataTypes-2.1.xsd +553 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-XAdESv132-2.1.xsd +476 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-XAdESv141-2.1.xsd +25 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/common/UBL-xmldsig-core-schema-2.1.xsd +330 -0
- data/einvoicing-sdk/Data/Schemas/xsds/UBL2.1/xsd/maindoc/UBL-Invoice-2.1.xsd +1002 -0
- data/einvoicing-sdk/Dockerfile +26 -0
- data/einvoicing-sdk/LICENSE.txt +56 -0
- data/einvoicing-sdk/Lib/.Net/DLL/BouncyCastle.Crypto.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Core.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Text.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.Util.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/IKVM.OpenJDK.XML.API.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/IKVM.Runtime.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.dll.config +43 -0
- data/einvoicing-sdk/Lib/.Net/DLL/SDKNETFrameWorkLib.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/System.Net.Http.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-api-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/DLL/saxon-he-api-10.8.xml +11759 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/3f204b7a-faba-42d8-8288-8b6fe516555c.vsidx +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/f95b6f91-c110-4b7a-bb49-3fc6bde85b13.vsidx +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/FileContentIndex/read.lock +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/.vs/SDKNETFrameworkTest/v17/.suo +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/App.config +14 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/BouncyCastle.Crypto.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/CSRGeneratorOpenSSL.cs +58 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Core.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Text.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.Util.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.OpenJDK.XML.API.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/IKVM.Runtime.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Program.cs +194 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Properties/AssemblyInfo.cs +36 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/Readme.txt +8 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.dll.config +43 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameWorkLib.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.csproj +120 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.exe +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.exe.config +20 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/SDKNETFrameworkTest.sln +25 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/BouncyCastle.Crypto.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/certificate.txt +1 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/pih.txt +1 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/Data/privateKey.txt +1 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Core.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Text.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.Util.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.OpenJDK.XML.API.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/IKVM.Runtime.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.dll.config +43 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameWorkLib.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.exe +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.exe.config +20 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/SDKNETFrameworkTest.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/System.Net.Http.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-api-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/bin/Debug/saxon-he-api-10.8.xml +11759 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs +4 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.AssemblyReference.cache +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.CopyComplete +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.CoreCompileInputs.cache +1 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.FileListAbsolute.txt +22 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.csproj.SuggestedBindingRedirects.cache +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.exe +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/obj/Debug/SDKNETFrameworkTest.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-api-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/SDKNETFrameworkTest/saxon-he-api-10.8.xml +11759 -0
- data/einvoicing-sdk/Lib/.Net/Test/BouncyCastle.Crypto.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Core.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Text.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.Util.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/IKVM.OpenJDK.XML.API.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/IKVM.Runtime.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.dll.config +43 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameWorkLib.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.exe +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.exe.config +20 -0
- data/einvoicing-sdk/Lib/.Net/Test/SDKNETFrameworkTest.pdb +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/saxon-he-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/saxon-he-api-10.8.dll +0 -0
- data/einvoicing-sdk/Lib/.Net/Test/saxon-he-api-10.8.xml +11759 -0
- data/einvoicing-sdk/README.md +15 -0
- data/einvoicing-sdk/Readme/readme.docx +0 -0
- data/einvoicing-sdk/Readme/readme.md +674 -0
- data/einvoicing-sdk/Readme/readme.pdf +0 -0
- data/einvoicing-sdk/Readme/~$readme.docx +0 -0
- data/einvoicing-sdk/docker-compose.yml +12 -0
- data/einvoicing-sdk/install.bat +74 -0
- data/einvoicing-sdk/install.sh +74 -0
- data/lib/zatca/client.rb +173 -0
- data/lib/zatca/hacks.rb +45 -0
- data/lib/zatca/hashing.rb +18 -0
- data/lib/zatca/qr_code_extractor.rb +31 -0
- data/lib/zatca/qr_code_generator.rb +9 -2
- data/lib/zatca/signing/certificate.rb +78 -0
- data/lib/zatca/signing/csr.rb +220 -0
- data/lib/zatca/signing/ecdsa.rb +59 -0
- data/lib/zatca/tag.rb +18 -8
- data/lib/zatca/tags.rb +5 -1
- data/lib/zatca/tags_schema.rb +5 -5
- data/lib/zatca/types.rb +7 -0
- data/lib/zatca/ubl/base_component.rb +142 -0
- data/lib/zatca/ubl/builder.rb +166 -0
- data/lib/zatca/ubl/common_aggregate_components/allowance_charge.rb +64 -0
- data/lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb +25 -0
- data/lib/zatca/ubl/common_aggregate_components/delivery.rb +27 -0
- data/lib/zatca/ubl/common_aggregate_components/invoice_line.rb +63 -0
- data/lib/zatca/ubl/common_aggregate_components/item.rb +21 -0
- data/lib/zatca/ubl/common_aggregate_components/legal_monetary_total.rb +59 -0
- data/lib/zatca/ubl/common_aggregate_components/party.rb +28 -0
- data/lib/zatca/ubl/common_aggregate_components/party_identification.rb +25 -0
- data/lib/zatca/ubl/common_aggregate_components/party_legal_entity.rb +19 -0
- data/lib/zatca/ubl/common_aggregate_components/party_tax_scheme.rb +30 -0
- data/lib/zatca/ubl/common_aggregate_components/postal_address.rb +59 -0
- data/lib/zatca/ubl/common_aggregate_components/price.rb +20 -0
- data/lib/zatca/ubl/common_aggregate_components/tax_category.rb +56 -0
- data/lib/zatca/ubl/common_aggregate_components/tax_total.rb +58 -0
- data/lib/zatca/ubl/common_aggregate_components.rb +2 -0
- data/lib/zatca/ubl/invoice.rb +481 -0
- data/lib/zatca/ubl/invoice_subtype_builder.rb +50 -0
- data/lib/zatca/ubl/signing/cert.rb +48 -0
- data/lib/zatca/ubl/signing/invoice_signed_data_reference.rb +44 -0
- data/lib/zatca/ubl/signing/key_info.rb +25 -0
- data/lib/zatca/ubl/signing/object.rb +20 -0
- data/lib/zatca/ubl/signing/qualifying_properties.rb +27 -0
- data/lib/zatca/ubl/signing/signature.rb +50 -0
- data/lib/zatca/ubl/signing/signature_information.rb +19 -0
- data/lib/zatca/ubl/signing/signature_properties_reference.rb +26 -0
- data/lib/zatca/ubl/signing/signed_info.rb +21 -0
- data/lib/zatca/ubl/signing/signed_properties.rb +81 -0
- data/lib/zatca/ubl/signing/signed_signature_properties.rb +23 -0
- data/lib/zatca/ubl/signing/ubl_document_signatures.rb +25 -0
- data/lib/zatca/ubl/signing/ubl_extension.rb +22 -0
- data/lib/zatca/ubl/signing/ubl_extensions.rb +17 -0
- data/lib/zatca/ubl/signing.rb +2 -0
- data/lib/zatca/ubl.rb +2 -0
- data/lib/zatca/version.rb +1 -1
- data/lib/zatca.rb +27 -3
- data/zatca.gemspec +52 -0
- metadata +318 -10
- data/Gemfile.lock +0 -100
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d65cb57654ffcf290ba95965eff7e0c0ec6f5413a890b16cbce127e76a5356d8
|
4
|
+
data.tar.gz: 7c3a4bbd85c5630d541e30bf4c8b510bbffbb0f4a67bc91e8969c5551cbeffe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6341d6dcb453d1a50b98bb25326ea36f1a2569d856ad53515ae607b3b92f3937358aab733dbf509fd404685a54b5cbf171021a00304e411cc0b297da6d538b84
|
7
|
+
data.tar.gz: b32f22b71a5ff6532bd7c9ca63b2bbca9eaa2c36d948d32cd7338cacfd5278dc3b2a83ab36929a9272a0280ee0183bcbdb89a2aa8682d7060006d41119eb645c
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# zatca
|
2
2
|
![](https://img.shields.io/gem/v/zatca) ![](https://img.shields.io/github/workflow/status/mrsool/zatca/Ruby)
|
3
3
|
|
4
|
-
A Ruby library for generating QR Codes
|
4
|
+
A Ruby library for generating QR Codes and e-invoices according to the standard created by ZATCA in Saudi Arabia.
|
5
5
|
|
6
|
-
|
6
|
+
This library supports both Phase 1 and Phase 2. Phase 2 support is still new so there may be bugs. Please [report any issues](https://github.com/mrsool/zatca/issues/new) you find.
|
7
7
|
|
8
8
|
# Installation
|
9
9
|
|
@@ -19,6 +19,7 @@ bundle add zatca
|
|
19
19
|
|
20
20
|
# Usage
|
21
21
|
|
22
|
+
## Phase 1
|
22
23
|
```rb
|
23
24
|
require "zatca"
|
24
25
|
|
@@ -51,3 +52,11 @@ tags = ZATCA::Tags.new({
|
|
51
52
|
generator = ZATCA::QRCodeGenerator.new(tags)
|
52
53
|
generator.render(size: 512)
|
53
54
|
```
|
55
|
+
|
56
|
+
## Phase 2
|
57
|
+
Documentation lives in the [wiki](https://github.com/mrsool/zatca/wiki)
|
58
|
+
|
59
|
+
# Notice of Non-Affiliation and Disclaimer
|
60
|
+
This library is not affiliated, associated, authorized, endorsed by, or in any way officially connected with ZATCA (Zakat, Tax and Customs Authority), or any of its subsidiaries or its affiliates. The official ZATCA website can be found at https://zatca.gov.sa.
|
61
|
+
|
62
|
+
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
EXTVER=$(jq -r '.version' ${FATOORA_HOME}/global.json)
|
4
|
+
|
5
|
+
CERTPASSWORD=$(jq -r '.certPassword' ${FATOORA_HOME}/global.json)
|
6
|
+
|
7
|
+
|
8
|
+
java -Djdk.module.illegalAccess=deny -Djdk.sunec.disableNative=false -jar ${FATOORA_HOME}/zatca-einvoicing-sdk-${EXTVER}.jar --globalVersion $EXTVER -certpassword $CERTPASSWORD $1 $2 $3 $4 $5 $6
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
@echo off
|
3
|
+
|
4
|
+
SET VAR=
|
5
|
+
FOR /F %%I IN ('jq .version %FATOORA_HOME%/global.json') DO set "VAR=%%I"
|
6
|
+
|
7
|
+
SET CERT_PASS=
|
8
|
+
FOR /F %%N IN ('jq .certPassword %FATOORA_HOME%/global.json') DO set "CERT_PASS=%%N"
|
9
|
+
|
10
|
+
|
11
|
+
set "VAR=%VAR:~1,-1%"
|
12
|
+
|
13
|
+
set "CERT_PASS=%CERT_PASS:~1,-1%"
|
14
|
+
|
15
|
+
|
16
|
+
if exist "%FATOORA_HOME%/zatca-einvoicing-sdk-%VAR%.jar" call java -Djdk.module.illegalAccess=deny -Dfile.encoding=UTF-8 -jar %FATOORA_HOME%/zatca-einvoicing-sdk-%VAR%.jar --globalVersion %VAR% -certpassword %CERT_PASS% %*
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":"238-R3.2.7" , "certPassword": "123456789" }
|
Binary file
|
Binary file
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"xsdPath": "/zatca/Data/Schemas/xsds/UBL2.1/xsd/maindoc/UBL-Invoice-2.1.xsd",
|
3
|
+
"enSchematron": "/zatca/Data/Rules/schematrons/CEN-EN16931-UBL.xsl",
|
4
|
+
"zatcaSchematron": "/zatca/Data/Rules/schematrons/20210819_ZATCA_E-invoice_Validation_Rules.xsl",
|
5
|
+
"certPath": "/zatca/Data/Certificates/cert.pem",
|
6
|
+
"privateKeyPath": "/zatca/Data/Certificates/ec-secp256k1-priv-key.pem",
|
7
|
+
"pihPath": "/zatca/Data/PIH/pih.txt",
|
8
|
+
"certPassword": "123456789",
|
9
|
+
"inputPath": "/zatca/Data/Input",
|
10
|
+
"usagePathFile": "/zatca/Configuration/usage.txt"
|
11
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"xsdPath": "../Data/Schemas/xsds/UBL2.1/xsd/maindoc/UBL-Invoice-2.1.xsd",
|
3
|
+
"enSchematron": "../Data/Rules/schematrons/CEN-EN16931-UBL.xsl",
|
4
|
+
"zatcaSchematron": "../Data/Rules/schematrons/20210819_ZATCA_E-invoice_Validation_Rules.xsl",
|
5
|
+
"certPath": "../Data/Certificates/cert.pem",
|
6
|
+
"privateKeyPath": "../Data/Certificates/ec-secp256k1-priv-key.pem",
|
7
|
+
"pihPath": "../Data/PIH/pih.txt",
|
8
|
+
"certPassword": "123456789",
|
9
|
+
"inputPath": "../Data/Input",
|
10
|
+
"usagePathFile": "../Configuration/usage.txt"
|
11
|
+
}
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[-csr]: flag used to generate csr and private key.
|
2
|
+
[-pem]: flag used to generate csr and private key in pem format.
|
3
|
+
[-privateKey <fileName>]: The name of the private key output file.
|
4
|
+
[-generatedCsr <fileName>]: The name of the csr output file.
|
5
|
+
[-csrConfig] <fileName> : The name of the csr configuration file.
|
6
|
+
[-invoice] <filename> : The name of the invoice file.
|
7
|
+
[-qr]: flag used to generate qr.
|
8
|
+
[-sign]: flag used to sign invoice.
|
9
|
+
[-signedInvoice <fileName>]: The name of the signed invoice output file.
|
10
|
+
[-invoiceRequest]: flag used to generate invoice request.
|
11
|
+
[-apiRequest <fileName>]: The name of the invoice json request output file
|
12
|
+
[-generateHash]: flag used to generate new hash for the provided invoice.
|
13
|
+
[-validate]: flag used to validate invoice.
|
14
|
+
[-nonprod]: flag pointing to use the csr and private key on non production server.
|
15
|
+
[-sim]: flag pointing to use the csr and private key on simulation server.
|
16
|
+
[-help]: flag used to display this help menu and exit.
|
@@ -0,0 +1 @@
|
|
1
|
+
MIID6jCCA5CgAwIBAgITbwAAgbuRbo5tpQ+QjgABAACBuzAKBggqhkjOPQQDAjBjMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnYXp0MRwwGgYDVQQDExNUU1pFSU5WT0lDRS1TdWJDQS0xMB4XDTIyMTEwOTA4MDcyMloXDTI0MTEwODA4MDcyMlowTjELMAkGA1UEBhMCU0ExEzARBgNVBAoTCjM5OTk5OTk5OTkxDDAKBgNVBAsTA1RTVDEcMBoGA1UEAxMTVFNULTM5OTk5OTk5OTkwMDAwMzBWMBAGByqGSM49AgEGBSuBBAAKA0IABGGDDKDmhWAITDv7LXqLX2cmr6+qddUkpcLCvWs5rC2O29W/hS4ajAK4Qdnahym6MaijX75Cg3j4aao7ouYXJ9GjggI5MIICNTCBmgYDVR0RBIGSMIGPpIGMMIGJMTswOQYDVQQEDDIxLVRTVHwyLVRTVHwzLTlmMDkyMjM4LTFkOTctNDcxOC1iNDQxLWNiYzMwMTMyMWIwYTEfMB0GCgmSJomT8ixkAQEMDzM5OTk5OTk5OTkwMDAwMzENMAsGA1UEDAwEMTEwMDEMMAoGA1UEGgwDVFNUMQwwCgYDVQQPDANUU1QwHQYDVR0OBBYEFDuWYlOzWpFN3no1WtyNktQdrA8JMB8GA1UdIwQYMBaAFHZgjPsGoKxnVzWdz5qspyuZNbUvME4GA1UdHwRHMEUwQ6BBoD+GPWh0dHA6Ly90c3RjcmwuemF0Y2EuZ292LnNhL0NlcnRFbnJvbGwvVFNaRUlOVk9JQ0UtU3ViQ0EtMS5jcmwwga0GCCsGAQUFBwEBBIGgMIGdMG4GCCsGAQUFBzABhmJodHRwOi8vdHN0Y3JsLnphdGNhLmdvdi5zYS9DZXJ0RW5yb2xsL1RTWkVpbnZvaWNlU0NBMS5leHRnYXp0Lmdvdi5sb2NhbF9UU1pFSU5WT0lDRS1TdWJDQS0xKDEpLmNydDArBggrBgEFBQcwAYYfaHR0cDovL3RzdGNybC56YXRjYS5nb3Yuc2Evb2NzcDAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMDMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwMwCgYIKoZIzj0EAwIDSAAwRQIgeWUEjxXaW4s8XilH/abzbDJhHHjO3uLaD87YqioA89YCIQDNltfAU98b8FnTD7M8NYIk8cqi7OnPu7h85v5V1Bt3Hg==
|
@@ -0,0 +1 @@
|
|
1
|
+
MHQCAQEEIDyLDaWIn/1/g3PGLrwupV4nTiiLKM59UEqUch1vDfhpoAcGBSuBBAAKoUQDQgAEYYMMoOaFYAhMO/steotfZyavr6p11SSlwsK9azmsLY7b1b+FLhqMArhB2dqHKboxqKNfvkKDePhpqjui5hcn0Q==
|
@@ -0,0 +1,9 @@
|
|
1
|
+
csr.common.name=TST-886431145-311111111101113
|
2
|
+
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
|
3
|
+
csr.organization.identifier=311111111111113
|
4
|
+
csr.organization.unit.name=3111111111
|
5
|
+
csr.organization.name=ABCD المحدودة
|
6
|
+
csr.country.name=SA
|
7
|
+
csr.invoice.type=1111
|
8
|
+
csr.location.address=RRRD2929
|
9
|
+
csr.industry.business.category=الأنشطة العقارية
|
@@ -0,0 +1,9 @@
|
|
1
|
+
csr.common.name=TST-886431145-311111111101113
|
2
|
+
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
|
3
|
+
csr.organization.identifier=311111111101113
|
4
|
+
csr.organization.unit.name=فرع الرياض
|
5
|
+
csr.organization.name=ABCD المحدودة
|
6
|
+
csr.country.name=SA
|
7
|
+
csr.invoice.type=1111
|
8
|
+
csr.location.address=RRRD2929
|
9
|
+
csr.industry.business.category=الأنشطة العقارية
|
@@ -0,0 +1,9 @@
|
|
1
|
+
csr.common.name=TST-886431145-311111111101113
|
2
|
+
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
|
3
|
+
csr.organization.identifier=311111111111113
|
4
|
+
csr.organization.unit.name=3111111111
|
5
|
+
csr.organization.name=ABCD Limited
|
6
|
+
csr.country.name=SA
|
7
|
+
csr.invoice.type=1111
|
8
|
+
csr.location.address=RRRD2929
|
9
|
+
csr.industry.business.category=Real estate activities
|
@@ -0,0 +1,9 @@
|
|
1
|
+
csr.common.name=TST-886431145-311111111101113
|
2
|
+
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e445f
|
3
|
+
csr.organization.identifier=311111111101113
|
4
|
+
csr.organization.unit.name=Riyadh Branch
|
5
|
+
csr.organization.name=ABCD Limited
|
6
|
+
csr.country.name=SA
|
7
|
+
csr.invoice.type=1111
|
8
|
+
csr.location.address=RRRD2929
|
9
|
+
csr.industry.business.category=Real estate activities
|
@@ -0,0 +1 @@
|
|
1
|
+
NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==
|