Skip to content

Commit

Permalink
Merge pull request #12 from wes4m/dev
Browse files Browse the repository at this point in the history
Experimental release v0.1.4 release
  • Loading branch information
wes4m authored Oct 18, 2022
2 parents 13770e0 + 95d2b91 commit 236afcd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<br/>
<img src="./docs/logo.png"/>
<p>v0.1.3 (experimental)</p>
<p>v0.1.4 (experimental)</p>
<br/>
<br/>
<p>
Expand All @@ -17,7 +17,7 @@
<img src="https://img.shields.io/badge/maintainer-wes4m-blue"/>
</a>
<a href="https://badge.fury.io/js/zatca-xml-js">
<img src="https://badge.fury.io/js/zatca-xml-js.svg/?v=0.1.3"/>
<img src="https://badge.fury.io/js/zatca-xml-js.svg/?v=0.1.4"/>
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/**/*"],
Expand Down
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 236afcd

Please sign in to comment.