@qrwise/pos-calculations 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,6 +75,7 @@ function calculateTotals(input) {
|
|
|
75
75
|
voucherDiscounted = -format2(totalOrderAmount * voucherRate);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
const togoCharge = input.togoableTotalAmount > 0 ? input.togoCharge : 0;
|
|
78
79
|
const subtotal = totalOrderAmount + voucherDiscounted;
|
|
79
80
|
const voucherVatNet = format2(totalOrderAmount / vatRate);
|
|
80
81
|
const voucherVat = format2(voucherVatNet * 0.12);
|
|
@@ -97,7 +98,6 @@ function calculateTotals(input) {
|
|
|
97
98
|
serviceCharge = format2(vatNet * scRate);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
const togoCharge = input.togoCharge;
|
|
101
101
|
let totalAmount = vatNet + vat + serviceCharge + togoCharge;
|
|
102
102
|
if (isSpecial && !isAddVat) {
|
|
103
103
|
totalAmount -= vat;
|
package/dist/index.d.cts
CHANGED
|
@@ -5,6 +5,7 @@ interface CalculateTotalsInput {
|
|
|
5
5
|
discountableTotalAmount: number;
|
|
6
6
|
nonDiscountableTotalAmount: number;
|
|
7
7
|
serviceChargeableTotalAmount: number;
|
|
8
|
+
togoableTotalAmount: number;
|
|
8
9
|
voucherType: VoucherType | null;
|
|
9
10
|
voucherRate: number;
|
|
10
11
|
discountType: DiscountType | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface CalculateTotalsInput {
|
|
|
5
5
|
discountableTotalAmount: number;
|
|
6
6
|
nonDiscountableTotalAmount: number;
|
|
7
7
|
serviceChargeableTotalAmount: number;
|
|
8
|
+
togoableTotalAmount: number;
|
|
8
9
|
voucherType: VoucherType | null;
|
|
9
10
|
voucherRate: number;
|
|
10
11
|
discountType: DiscountType | null;
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ function calculateTotals(input) {
|
|
|
43
43
|
voucherDiscounted = -format2(totalOrderAmount * voucherRate);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
const togoCharge = input.togoableTotalAmount > 0 ? input.togoCharge : 0;
|
|
46
47
|
const subtotal = totalOrderAmount + voucherDiscounted;
|
|
47
48
|
const voucherVatNet = format2(totalOrderAmount / vatRate);
|
|
48
49
|
const voucherVat = format2(voucherVatNet * 0.12);
|
|
@@ -65,7 +66,6 @@ function calculateTotals(input) {
|
|
|
65
66
|
serviceCharge = format2(vatNet * scRate);
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
const togoCharge = input.togoCharge;
|
|
69
69
|
let totalAmount = vatNet + vat + serviceCharge + togoCharge;
|
|
70
70
|
if (isSpecial && !isAddVat) {
|
|
71
71
|
totalAmount -= vat;
|