diff --git a/README.md b/README.md index 3db8c6a..3fa3e47 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

-

v0.1.3 (experimental)

+

v0.1.4 (experimental)



@@ -17,7 +17,7 @@ - +

diff --git a/package.json b/package.json index 2a852c0..dc06be5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zatca-xml-js", - "version": "0.1.3", + "version": "0.1.4", "description": "An implementation of Saudi Arabia ZATCA's E-Invoicing requirements, processes, and standards.", "main": "lib/index.js", "files": ["lib/**/*"], diff --git a/src/zatca/ZATCASimplifiedTaxInvoice.ts b/src/zatca/ZATCASimplifiedTaxInvoice.ts index e33ef61..12204b8 100644 --- a/src/zatca/ZATCASimplifiedTaxInvoice.ts +++ b/src/zatca/ZATCASimplifiedTaxInvoice.ts @@ -129,9 +129,10 @@ export class ZATCASimplifiedTaxInvoice { "@_unitCode": "PCE", "#text": line_item.quantity }, + // BR-DEC-23 "cbc:LineExtensionAmount": { "@_currencyID": "SAR", - "#text": line_item_total_tax_exclusive + "#text": line_item_total_tax_exclusive.toFixed(2) }, "cac:TaxTotal": cacTaxTotal, "cac:Item": { @@ -158,13 +159,15 @@ export class ZATCASimplifiedTaxInvoice { private constructLegalMonetaryTotal = (tax_exclusive_subtotal: number, taxes_total: number) => { return { + // BR-DEC-09 "cbc:LineExtensionAmount": { "@_currencyID": "SAR", - "#text": tax_exclusive_subtotal + "#text": tax_exclusive_subtotal.toFixed(2) }, + // BR-DEC-12 "cbc:TaxExclusiveAmount": { "@_currencyID": "SAR", - "#text": tax_exclusive_subtotal + "#text": tax_exclusive_subtotal.toFixed(2) }, // BR-DEC-14 "cbc:TaxInclusiveAmount": { @@ -193,9 +196,10 @@ export class ZATCASimplifiedTaxInvoice { // BR-DEC-13, MESSAGE : [BR-DEC-13]-The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2. const addTaxSubtotal = (taxable_amount: number, tax_amount: number, tax_percent: number) => { cacTaxSubtotal.push({ + // BR-DEC-19 "cbc:TaxableAmount": { "@_currencyID": "SAR", - "#text": taxable_amount + "#text": taxable_amount.toFixed(2) }, "cbc:TaxAmount": { "@_currencyID": "SAR",