@qrwise/pos-calculations 0.0.7 → 0.0.8

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 CHANGED
@@ -66,6 +66,7 @@ function calculateTotals(input) {
66
66
  discountableTotalAmount = 0,
67
67
  nonDiscountableTotalAmount = 0,
68
68
  serviceChargeableTotalAmount = 0,
69
+ togoableTotalAmount = 0,
69
70
  voucherType = null,
70
71
  voucherRate = 0,
71
72
  discountType = null,
@@ -105,7 +106,7 @@ function calculateTotals(input) {
105
106
  serviceCharge = Number((vatNet * scRate).toFixed(2));
106
107
  }
107
108
  }
108
- let totalAmount = vatNet + vat + serviceCharge + togoCharge;
109
+ let totalAmount = vatNet + vat + serviceCharge + (togoableTotalAmount > 0 ? togoCharge : 0);
109
110
  if (isSpecial && !isAddVat) {
110
111
  totalAmount -= vat;
111
112
  }
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
@@ -34,6 +34,7 @@ function calculateTotals(input) {
34
34
  discountableTotalAmount = 0,
35
35
  nonDiscountableTotalAmount = 0,
36
36
  serviceChargeableTotalAmount = 0,
37
+ togoableTotalAmount = 0,
37
38
  voucherType = null,
38
39
  voucherRate = 0,
39
40
  discountType = null,
@@ -73,7 +74,7 @@ function calculateTotals(input) {
73
74
  serviceCharge = Number((vatNet * scRate).toFixed(2));
74
75
  }
75
76
  }
76
- let totalAmount = vatNet + vat + serviceCharge + togoCharge;
77
+ let totalAmount = vatNet + vat + serviceCharge + (togoableTotalAmount > 0 ? togoCharge : 0);
77
78
  if (isSpecial && !isAddVat) {
78
79
  totalAmount -= vat;
79
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrwise/pos-calculations",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Shared POS calculations for QR Wise POS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",