Skip to content

Commit

Permalink
Adding BR-DEC-09
Browse files Browse the repository at this point in the history
BR-DEC-23

BR-DEC-12

BR-DEC-19
  • Loading branch information
wes4m committed Oct 18, 2022
1 parent 765dc55 commit 73637bd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/zatca/ZATCASimplifiedTaxInvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 73637bd

Please sign in to comment.