From 73637bd98cc5149ee27e44bc22f5b50e7d7c874a Mon Sep 17 00:00:00 2001 From: Wesam Alzahir Date: Tue, 18 Oct 2022 20:47:28 +0300 Subject: [PATCH] Adding BR-DEC-09 BR-DEC-23 BR-DEC-12 BR-DEC-19 --- src/zatca/ZATCASimplifiedTaxInvoice.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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",