@qrwise/pos-calculations 0.0.14 → 0.0.16

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
@@ -97,7 +97,7 @@ function calculateTotals(input) {
97
97
  serviceCharge = format2(vatNet * scRate);
98
98
  }
99
99
  }
100
- const togoCharge = input.togoCharge;
100
+ const togoCharge = input.togoableTotalAmount > 0 ? input.togoCharge : 0;
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
@@ -65,7 +65,7 @@ function calculateTotals(input) {
65
65
  serviceCharge = format2(vatNet * scRate);
66
66
  }
67
67
  }
68
- const togoCharge = input.togoCharge;
68
+ const togoCharge = input.togoableTotalAmount > 0 ? input.togoCharge : 0;
69
69
  let totalAmount = vatNet + vat + serviceCharge + togoCharge;
70
70
  if (isSpecial && !isAddVat) {
71
71
  totalAmount -= vat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrwise/pos-calculations",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Shared POS calculations for QR Wise POS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",