Skip to content

Commit 236afcd

Browse files
authored
Merge pull request #12 from wes4m/dev
Experimental release v0.1.4 release
2 parents 13770e0 + 95d2b91 commit 236afcd

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22
<br/>
33
<img src="./docs/logo.png"/>
4-
<p>v0.1.3 (experimental)</p>
4+
<p>v0.1.4 (experimental)</p>
55
<br/>
66
<br/>
77
<p>
@@ -17,7 +17,7 @@
1717
<img src="https://img.shields.io/badge/maintainer-wes4m-blue"/>
1818
</a>
1919
<a href="https://badge.fury.io/js/zatca-xml-js">
20-
<img src="https://badge.fury.io/js/zatca-xml-js.svg/?v=0.1.3"/>
20+
<img src="https://badge.fury.io/js/zatca-xml-js.svg/?v=0.1.4"/>
2121
</a>
2222
</p>
2323

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zatca-xml-js",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "An implementation of Saudi Arabia ZATCA's E-Invoicing requirements, processes, and standards.",
55
"main": "lib/index.js",
66
"files": ["lib/**/*"],

src/zatca/ZATCASimplifiedTaxInvoice.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ export class ZATCASimplifiedTaxInvoice {
129129
"@_unitCode": "PCE",
130130
"#text": line_item.quantity
131131
},
132+
// BR-DEC-23
132133
"cbc:LineExtensionAmount": {
133134
"@_currencyID": "SAR",
134-
"#text": line_item_total_tax_exclusive
135+
"#text": line_item_total_tax_exclusive.toFixed(2)
135136
},
136137
"cac:TaxTotal": cacTaxTotal,
137138
"cac:Item": {
@@ -158,13 +159,15 @@ export class ZATCASimplifiedTaxInvoice {
158159
private constructLegalMonetaryTotal = (tax_exclusive_subtotal: number, taxes_total: number) => {
159160

160161
return {
162+
// BR-DEC-09
161163
"cbc:LineExtensionAmount": {
162164
"@_currencyID": "SAR",
163-
"#text": tax_exclusive_subtotal
165+
"#text": tax_exclusive_subtotal.toFixed(2)
164166
},
167+
// BR-DEC-12
165168
"cbc:TaxExclusiveAmount": {
166169
"@_currencyID": "SAR",
167-
"#text": tax_exclusive_subtotal
170+
"#text": tax_exclusive_subtotal.toFixed(2)
168171
},
169172
// BR-DEC-14
170173
"cbc:TaxInclusiveAmount": {
@@ -193,9 +196,10 @@ export class ZATCASimplifiedTaxInvoice {
193196
// BR-DEC-13, MESSAGE : [BR-DEC-13]-The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.
194197
const addTaxSubtotal = (taxable_amount: number, tax_amount: number, tax_percent: number) => {
195198
cacTaxSubtotal.push({
199+
// BR-DEC-19
196200
"cbc:TaxableAmount": {
197201
"@_currencyID": "SAR",
198-
"#text": taxable_amount
202+
"#text": taxable_amount.toFixed(2)
199203
},
200204
"cbc:TaxAmount": {
201205
"@_currencyID": "SAR",

0 commit comments

Comments
 (0)