@vita-mojo/amounts 0.0.68 → 0.0.69
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/package.json +8 -6
- package/src/discounts/applyPromotion.d.ts +4 -4
- package/src/discounts/checkMeetsRequiredConditions.js +1 -2
- package/src/discounts/checkMeetsRequiredConditions.js.map +1 -1
- package/src/discounts/distributeDiscount.js +1 -2
- package/src/discounts/distributeDiscount.js.map +1 -1
- package/src/discounts/distributeDiscountAmount.js +1 -2
- package/src/discounts/distributeDiscountAmount.js.map +1 -1
- package/src/discounts/distributeDiscounts/bundle.util.d.ts +26 -26
- package/src/discounts/distributeDiscounts/bundle.util.js +2 -2
- package/src/discounts/distributeDiscounts/bundle.util.js.map +1 -1
- package/src/discounts/distributeDiscounts/distributeDiscounts.js +1 -2
- package/src/discounts/distributeDiscounts/distributeDiscounts.js.map +1 -1
- package/src/discounts/multiplePromotions/sortPromotions.js +1 -2
- package/src/discounts/multiplePromotions/sortPromotions.js.map +1 -1
- package/src/discounts/promoIsApplicable.js +1 -2
- package/src/discounts/promoIsApplicable.js.map +1 -1
- package/src/discounts/util.d.ts +20 -20
- package/src/discounts/util.js +2 -2
- package/src/discounts/util.js.map +1 -1
- package/src/index.d.ts +19 -7
- package/src/index.js.map +1 -1
- package/src/lib/distribute-discount.js +3 -5
- package/src/lib/distribute-discount.js.map +1 -1
- package/src/lib/distribute-refund.d.ts +25 -25
- package/src/lib/distribute-refund.js +28 -26
- package/src/lib/distribute-refund.js.map +1 -1
- package/src/lib/final-price.d.ts +44 -44
- package/src/lib/final-price.js +6 -5
- package/src/lib/final-price.js.map +1 -1
- package/src/lib/subtotals.d.ts +73 -44
- package/src/lib/subtotals.js +10 -9
- package/src/lib/subtotals.js.map +1 -1
- package/src/lib/tax-totals.d.ts +29 -29
- package/src/lib/tax.d.ts +84 -84
- package/src/lib/tax.js +19 -16
- package/src/lib/tax.js.map +1 -1
- package/src/lib/totals.d.ts +72 -72
- package/src/lib/totals.js +6 -8
- package/src/lib/totals.js.map +1 -1
- package/src/number-wrapper/bignumber.d.ts +10 -10
- package/src/number-wrapper/currency.d.ts +10 -10
- package/src/number-wrapper/index.d.ts +109 -109
- package/src/tax/tax.js +3 -4
- package/src/tax/tax.js.map +1 -1
- package/src/utils/order-vat.js +2 -3
- package/src/utils/order-vat.js.map +1 -1
- package/src/utils/pipe-merge.d.ts +1 -1
- package/src/utils/pipe-merge.js +5 -3
- package/src/utils/pipe-merge.js.map +1 -1
- package/src/discounts/mocks/index.d.ts +0 -6
- package/src/discounts/mocks/index.js +0 -10
- package/src/discounts/mocks/index.js.map +0 -1
- package/src/discounts/mocks/mockDeal.d.ts +0 -2
- package/src/discounts/mocks/mockDeal.js +0 -9
- package/src/discounts/mocks/mockDeal.js.map +0 -1
- package/src/discounts/mocks/mockDiscountGroup.d.ts +0 -2
- package/src/discounts/mocks/mockDiscountGroup.js +0 -9
- package/src/discounts/mocks/mockDiscountGroup.js.map +0 -1
- package/src/discounts/mocks/mockProduct.d.ts +0 -2
- package/src/discounts/mocks/mockProduct.js +0 -9
- package/src/discounts/mocks/mockProduct.js.map +0 -1
- package/src/discounts/mocks/mockProductPromotion.d.ts +0 -2
- package/src/discounts/mocks/mockProductPromotion.js +0 -9
- package/src/discounts/mocks/mockProductPromotion.js.map +0 -1
- package/src/discounts/mocks/mockPromotion.d.ts +0 -3
- package/src/discounts/mocks/mockPromotion.js +0 -45
- package/src/discounts/mocks/mockPromotion.js.map +0 -1
- package/src/discounts/mocks/mockTag.d.ts +0 -2
- package/src/discounts/mocks/mockTag.js +0 -9
- package/src/discounts/mocks/mockTag.js.map +0 -1
- package/src/discounts/multiplePromotions/mocks/index.d.ts +0 -4
- package/src/discounts/multiplePromotions/mocks/index.js +0 -8
- package/src/discounts/multiplePromotions/mocks/index.js.map +0 -1
- package/src/discounts/multiplePromotions/mocks/mockDiscountedProduct.d.ts +0 -2
- package/src/discounts/multiplePromotions/mocks/mockDiscountedProduct.js +0 -15
- package/src/discounts/multiplePromotions/mocks/mockDiscountedProduct.js.map +0 -1
- package/src/discounts/multiplePromotions/mocks/mockInputDeal.d.ts +0 -2
- package/src/discounts/multiplePromotions/mocks/mockInputDeal.js +0 -9
- package/src/discounts/multiplePromotions/mocks/mockInputDeal.js.map +0 -1
- package/src/discounts/multiplePromotions/mocks/mockProduct.d.ts +0 -2
- package/src/discounts/multiplePromotions/mocks/mockProduct.js +0 -9
- package/src/discounts/multiplePromotions/mocks/mockProduct.js.map +0 -1
- package/src/discounts/multiplePromotions/mocks/mockPromotion.d.ts +0 -2
- package/src/discounts/multiplePromotions/mocks/mockPromotion.js +0 -13
- package/src/discounts/multiplePromotions/mocks/mockPromotion.js.map +0 -1
package/src/lib/subtotals.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateSubtotals = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const R = tslib_1.__importStar(require("ramda"));
|
|
6
4
|
const number_wrapper_1 = require("../number-wrapper");
|
|
7
5
|
const utils_1 = require("../utils");
|
|
8
6
|
const calculateSubtotalAmount = (item) => {
|
|
7
|
+
var _a, _b;
|
|
9
8
|
const MathWrapper = (0, number_wrapper_1.getNumber)();
|
|
10
9
|
return new MathWrapper(item.finalPrice)
|
|
11
|
-
.subtract(
|
|
12
|
-
.subtract(
|
|
10
|
+
.subtract((_a = item.discount) !== null && _a !== void 0 ? _a : 0)
|
|
11
|
+
.subtract((_b = item.refund) !== null && _b !== void 0 ? _b : 0)
|
|
13
12
|
.value();
|
|
14
13
|
};
|
|
15
14
|
const calculateOrderSubtotals = (order) => {
|
|
@@ -21,10 +20,10 @@ const calculateOrderSubtotals = (order) => {
|
|
|
21
20
|
const serviceChargeBeforeRefund = +((_d = orderPayment.serviceChargeBeforeRefund) !== null && _d !== void 0 ? _d : 0);
|
|
22
21
|
const deliveryFeeBeforeRefund = +((_e = orderPayment.deliveryFeeBeforeRefund) !== null && _e !== void 0 ? _e : 0);
|
|
23
22
|
const orderDiscount = +((_f = orderPayment.discount) !== null && _f !== void 0 ? _f : 0);
|
|
24
|
-
const price =
|
|
23
|
+
const price = bundles.reduce((acc, bundle) => {
|
|
25
24
|
var _a;
|
|
26
25
|
return acc.add((_a = bundle.finalPrice) !== null && _a !== void 0 ? _a : 0);
|
|
27
|
-
}, new MathWrapper(0))
|
|
26
|
+
}, new MathWrapper(0));
|
|
28
27
|
const subtotalAmount = new MathWrapper(price.value())
|
|
29
28
|
.subtract(orderDiscount)
|
|
30
29
|
.add(deliveryFeeBeforeRefund)
|
|
@@ -58,12 +57,14 @@ const calculateFeesWithRefund = (order) => {
|
|
|
58
57
|
};
|
|
59
58
|
};
|
|
60
59
|
const calculateSubtotals = (order) => {
|
|
61
|
-
|
|
62
|
-
const
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const bundles = ((_a = order === null || order === void 0 ? void 0 : order.bundles) !== null && _a !== void 0 ? _a : []);
|
|
62
|
+
const orderPayment = (_b = order === null || order === void 0 ? void 0 : order.payment) !== null && _b !== void 0 ? _b : {};
|
|
63
63
|
const { subtotalAmount, subtotalAmountBeforeRefund } = calculateOrderSubtotals(order);
|
|
64
64
|
const { serviceCharge, deliveryFee } = calculateFeesWithRefund(order);
|
|
65
65
|
const bundlesWithSubtotalAmount = bundles.map((bundle) => {
|
|
66
|
-
|
|
66
|
+
var _a;
|
|
67
|
+
const itemTypesList = ((_a = bundle === null || bundle === void 0 ? void 0 : bundle.itemTypes) !== null && _a !== void 0 ? _a : []);
|
|
67
68
|
const itemTypes = itemTypesList.map((itemType) => {
|
|
68
69
|
const items = itemType.items.map((item) => {
|
|
69
70
|
const itemSubtotalAmount = calculateSubtotalAmount(item);
|
package/src/lib/subtotals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subtotals.js","sourceRoot":"","sources":["../../../../../packages/amounts/src/lib/subtotals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subtotals.js","sourceRoot":"","sources":["../../../../../packages/amounts/src/lib/subtotals.ts"],"names":[],"mappings":";;;AAEA,sDAA8C;AAC9C,oCAAkC;AAElC,MAAM,uBAAuB,GAAG,CAC9B,IAA2C,EAC3C,EAAE;;IACF,MAAM,WAAW,GAAG,IAAA,0BAAS,GAAE,CAAC;IAEhC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC;SACpC,QAAQ,CAAC,MAAwB,IAAK,CAAC,QAAQ,mCAAI,CAAC,CAAC;SACrD,QAAQ,CAAC,MAAsB,IAAK,CAAC,MAAM,mCAAI,CAAC,CAAC;SACjD,KAAK,EAAE,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,KAAkB,EAAE,EAAE;;IACrD,MAAM,WAAW,GAAG,IAAA,0BAAS,GAAE,CAAC;IAChC,MAAM,OAAO,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,EAAE,CAAC;IACpC,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,OAAO,mCAAI,EAAE,CAAC;IACzC,MAAM,YAAY,GAAG,MAAA,YAAY,CAAC,YAAY,mCAAI,CAAC,CAAC;IACpD,MAAM,yBAAyB,GAAG,CAAC,CACjC,MAAA,YAAY,CAAC,yBAAyB,mCAAI,CAAC,CAC5C,CAAC;IACF,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAA,YAAY,CAAC,uBAAuB,mCAAI,CAAC,CAAC,CAAC;IAC7E,MAAM,aAAa,GAAG,CAAC,CAAC,MAAA,YAAY,CAAC,QAAQ,mCAAI,CAAC,CAAC,CAAC;IAEpD,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAA2B,EAAE,EAAE;;QAChE,OAAO,GAAG,CAAC,GAAG,CAAC,MAAA,MAAM,CAAC,UAAU,mCAAI,CAAC,CAAC,CAAC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,QAAQ,CAAC,IAAI;oBAC7B,0BAA0B,EAAE,kBAAkB;iBAC/C,CAAC,EACF;YACJ,CAAC,CAAC,CAAC;YAEH,uCACK,QAAQ,KACX,KAAK,IACL;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAE7D,qDACK,MAAM,KACT,SAAS,EACT,cAAc,EAAE,oBAAoB,KACjC,CAAC,CAAC,IAAA,cAAM,EAAC,MAAM,EAAE,QAAQ,CAAC,IAAI;YAC/B,0BAA0B,EAAE,oBAAoB;SACjD,CAAC,EACF;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,yBAAyB;QAClC,OAAO,kCACF,YAAY,KACf,cAAc;YACd,0BAA0B;YAC1B,aAAa;YACb,WAAW,GACZ;KACF,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,kBAAkB,sBAkD7B"}
|
package/src/lib/tax-totals.d.ts
CHANGED
|
@@ -4,36 +4,36 @@ export declare const addTaxTotals: (order: Order.Order) => Order.Order | {
|
|
|
4
4
|
taxTotals: Record<string, number>[];
|
|
5
5
|
totalAmount: number;
|
|
6
6
|
subtotalAmount: number;
|
|
7
|
-
subtotalAmountBeforeRefund?: number
|
|
8
|
-
vatAmount?: number
|
|
9
|
-
vatAmountBeforeRefund?: number
|
|
7
|
+
subtotalAmountBeforeRefund?: number;
|
|
8
|
+
vatAmount?: number;
|
|
9
|
+
vatAmountBeforeRefund?: number;
|
|
10
10
|
price: number;
|
|
11
|
-
discount?: number
|
|
12
|
-
provider?: string
|
|
13
|
-
currency?: string
|
|
14
|
-
status?: string
|
|
15
|
-
meta?: string
|
|
16
|
-
name?: string
|
|
17
|
-
deliveryVatRate?: number | null
|
|
18
|
-
type?: string
|
|
19
|
-
refundSumUp?: number
|
|
20
|
-
salesTaxRate?: number | null
|
|
21
|
-
serviceCharge?: number
|
|
22
|
-
serviceChargeBeforeRefund?: number
|
|
23
|
-
serviceChargePercentage?: number | null
|
|
11
|
+
discount?: number;
|
|
12
|
+
provider?: string;
|
|
13
|
+
currency?: string;
|
|
14
|
+
status?: string;
|
|
15
|
+
meta?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
deliveryVatRate?: number | null;
|
|
18
|
+
type?: string;
|
|
19
|
+
refundSumUp?: number;
|
|
20
|
+
salesTaxRate?: number | null;
|
|
21
|
+
serviceCharge?: number;
|
|
22
|
+
serviceChargeBeforeRefund?: number;
|
|
23
|
+
serviceChargePercentage?: number | null;
|
|
24
24
|
deliveryFee: number;
|
|
25
|
-
deliveryFeeBeforeRefund?: number
|
|
26
|
-
transactions?: Order.Payment.Transaction[]
|
|
27
|
-
refundAmountExcludingTax?: number
|
|
28
|
-
serviceChargeRefund?: number
|
|
29
|
-
deliveryFeeRefund?: number
|
|
30
|
-
isTaxExclusive?: boolean
|
|
31
|
-
refundAmount?: number
|
|
32
|
-
discountedDeliveryFee?: number
|
|
33
|
-
discountedServiceCharge?: number
|
|
34
|
-
deliveryFeeTaxAmount?: number
|
|
35
|
-
totalDeliveryFee?: number
|
|
36
|
-
deliveryFeeRefundTaxAmount?: number
|
|
37
|
-
requireExternalPayment?: boolean
|
|
25
|
+
deliveryFeeBeforeRefund?: number;
|
|
26
|
+
transactions?: Order.Payment.Transaction[];
|
|
27
|
+
refundAmountExcludingTax?: number;
|
|
28
|
+
serviceChargeRefund?: number;
|
|
29
|
+
deliveryFeeRefund?: number;
|
|
30
|
+
isTaxExclusive?: boolean;
|
|
31
|
+
refundAmount?: number;
|
|
32
|
+
discountedDeliveryFee?: number;
|
|
33
|
+
discountedServiceCharge?: number;
|
|
34
|
+
deliveryFeeTaxAmount?: number;
|
|
35
|
+
totalDeliveryFee?: number;
|
|
36
|
+
deliveryFeeRefundTaxAmount?: number;
|
|
37
|
+
requireExternalPayment?: boolean;
|
|
38
38
|
};
|
|
39
39
|
};
|
package/src/lib/tax.d.ts
CHANGED
|
@@ -10,36 +10,36 @@ export declare const bundlesVat: (bundles: Array<Order.Bundle.Bundle>, isTakeAwa
|
|
|
10
10
|
bundleVATOverwrite: number | undefined;
|
|
11
11
|
vatAmount: number;
|
|
12
12
|
uuid: string;
|
|
13
|
-
menuUUID?: string
|
|
14
|
-
upsellCategories?: string[]
|
|
15
|
-
isReorder?: boolean
|
|
13
|
+
menuUUID?: string;
|
|
14
|
+
upsellCategories?: string[];
|
|
15
|
+
isReorder?: boolean;
|
|
16
16
|
basketUUID: string;
|
|
17
17
|
hasModifiers: boolean;
|
|
18
|
-
extMediaUUID?: string
|
|
18
|
+
extMediaUUID?: string;
|
|
19
19
|
name: string;
|
|
20
20
|
kitchenTicketName: string;
|
|
21
|
-
slug?: string
|
|
21
|
+
slug?: string;
|
|
22
22
|
description: string | null;
|
|
23
|
-
dealCategoryOrder?: number
|
|
23
|
+
dealCategoryOrder?: number;
|
|
24
24
|
isGrouped: boolean;
|
|
25
25
|
isPrintable: boolean;
|
|
26
|
-
isAccessory?: boolean
|
|
26
|
+
isAccessory?: boolean;
|
|
27
27
|
straightToPickup: boolean;
|
|
28
28
|
appStraightToPickup: Order.Bundle.AppStraightToPickup;
|
|
29
29
|
type: string;
|
|
30
|
-
items?: Order.Item.Item[]
|
|
30
|
+
items?: Order.Item.Item[];
|
|
31
31
|
price: number;
|
|
32
32
|
priceEatIn: number;
|
|
33
33
|
hasEatInPrice: boolean;
|
|
34
|
-
refund?: number
|
|
35
|
-
excludeFromServiceCharge?: boolean
|
|
36
|
-
refundIncludingTax?: number
|
|
37
|
-
refundTaxAmount?: number
|
|
38
|
-
refundUUID?: string
|
|
34
|
+
refund?: number;
|
|
35
|
+
excludeFromServiceCharge?: boolean;
|
|
36
|
+
refundIncludingTax?: number;
|
|
37
|
+
refundTaxAmount?: number;
|
|
38
|
+
refundUUID?: string;
|
|
39
39
|
finalPrice: number;
|
|
40
40
|
subtotalAmountIncludingTax: number;
|
|
41
41
|
totalAmount: number;
|
|
42
|
-
totalAmountBeforeRefund?: number
|
|
42
|
+
totalAmountBeforeRefund?: number;
|
|
43
43
|
subtotalAmount: number;
|
|
44
44
|
discount: number;
|
|
45
45
|
taxExempt: number;
|
|
@@ -48,24 +48,24 @@ export declare const bundlesVat: (bundles: Array<Order.Bundle.Bundle>, isTakeAwa
|
|
|
48
48
|
rootCategory?: {
|
|
49
49
|
name: string;
|
|
50
50
|
uuid: string;
|
|
51
|
-
}
|
|
52
|
-
category?: object
|
|
53
|
-
note?: string | null
|
|
54
|
-
defaultItems?: Order.Bundle.DefaultItem[]
|
|
55
|
-
promotion?: Order.Promotion | null
|
|
56
|
-
promotions?: Order.BundlePromotion[] | null
|
|
51
|
+
};
|
|
52
|
+
category?: object;
|
|
53
|
+
note?: string | null;
|
|
54
|
+
defaultItems?: Order.Bundle.DefaultItem[];
|
|
55
|
+
promotion?: Order.Promotion | null;
|
|
56
|
+
promotions?: Order.BundlePromotion[] | null;
|
|
57
57
|
meta: object;
|
|
58
|
-
baseTotalAmount?: number
|
|
59
|
-
baseVatAmount?: number
|
|
60
|
-
deal?: Order.Bundle.Deal
|
|
58
|
+
baseTotalAmount?: number;
|
|
59
|
+
baseVatAmount?: number;
|
|
60
|
+
deal?: Order.Bundle.Deal;
|
|
61
61
|
kitchenStation: Order.Bundle.KitchenStation | null;
|
|
62
|
-
status?: string
|
|
62
|
+
status?: string;
|
|
63
63
|
allergens: string[];
|
|
64
|
-
isRecommendation?: boolean
|
|
65
|
-
parentID?: string
|
|
66
|
-
quantity?: number
|
|
67
|
-
basketEntries?: Record<string, Partial<Order.Bundle.Bundle
|
|
68
|
-
adjustment?: Order.Bundle.Adjustment
|
|
64
|
+
isRecommendation?: boolean;
|
|
65
|
+
parentID?: string;
|
|
66
|
+
quantity?: number;
|
|
67
|
+
basketEntries?: Record<string, Partial<Order.Bundle.Bundle>>;
|
|
68
|
+
adjustment?: Order.Bundle.Adjustment;
|
|
69
69
|
tags: Order.Bundle.Tag[];
|
|
70
70
|
}[];
|
|
71
71
|
export declare const calculateVatSales: (bundles: Array<Order.Bundle.Bundle>, vatableSales?: boolean) => number;
|
|
@@ -80,34 +80,34 @@ export declare const assignVat: (order: Order.Order) => {
|
|
|
80
80
|
vatAmountBeforeRefund: number;
|
|
81
81
|
totalAmount: number;
|
|
82
82
|
subtotalAmount: number;
|
|
83
|
-
subtotalAmountBeforeRefund?: number
|
|
83
|
+
subtotalAmountBeforeRefund?: number;
|
|
84
84
|
price: number;
|
|
85
|
-
discount?: number
|
|
86
|
-
provider?: string
|
|
87
|
-
currency?: string
|
|
88
|
-
status?: string
|
|
89
|
-
meta?: string
|
|
90
|
-
name?: string
|
|
91
|
-
deliveryVatRate?: number | null
|
|
92
|
-
type?: string
|
|
93
|
-
refundSumUp?: number
|
|
94
|
-
salesTaxRate?: number | null
|
|
95
|
-
serviceCharge?: number
|
|
96
|
-
serviceChargeBeforeRefund?: number
|
|
97
|
-
serviceChargePercentage?: number | null
|
|
85
|
+
discount?: number;
|
|
86
|
+
provider?: string;
|
|
87
|
+
currency?: string;
|
|
88
|
+
status?: string;
|
|
89
|
+
meta?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
deliveryVatRate?: number | null;
|
|
92
|
+
type?: string;
|
|
93
|
+
refundSumUp?: number;
|
|
94
|
+
salesTaxRate?: number | null;
|
|
95
|
+
serviceCharge?: number;
|
|
96
|
+
serviceChargeBeforeRefund?: number;
|
|
97
|
+
serviceChargePercentage?: number | null;
|
|
98
98
|
deliveryFee: number;
|
|
99
|
-
deliveryFeeBeforeRefund?: number
|
|
100
|
-
transactions?: Order.Payment.Transaction[]
|
|
101
|
-
refundAmountExcludingTax?: number
|
|
102
|
-
serviceChargeRefund?: number
|
|
103
|
-
deliveryFeeRefund?: number
|
|
104
|
-
isTaxExclusive?: boolean
|
|
105
|
-
refundAmount?: number
|
|
106
|
-
discountedDeliveryFee?: number
|
|
107
|
-
discountedServiceCharge?: number
|
|
108
|
-
totalDeliveryFee?: number
|
|
109
|
-
deliveryFeeRefundTaxAmount?: number
|
|
110
|
-
requireExternalPayment?: boolean
|
|
99
|
+
deliveryFeeBeforeRefund?: number;
|
|
100
|
+
transactions?: Order.Payment.Transaction[];
|
|
101
|
+
refundAmountExcludingTax?: number;
|
|
102
|
+
serviceChargeRefund?: number;
|
|
103
|
+
deliveryFeeRefund?: number;
|
|
104
|
+
isTaxExclusive?: boolean;
|
|
105
|
+
refundAmount?: number;
|
|
106
|
+
discountedDeliveryFee?: number;
|
|
107
|
+
discountedServiceCharge?: number;
|
|
108
|
+
totalDeliveryFee?: number;
|
|
109
|
+
deliveryFeeRefundTaxAmount?: number;
|
|
110
|
+
requireExternalPayment?: boolean;
|
|
111
111
|
};
|
|
112
112
|
bundles: {
|
|
113
113
|
itemTypes: Order.ItemType[];
|
|
@@ -115,36 +115,36 @@ export declare const assignVat: (order: Order.Order) => {
|
|
|
115
115
|
bundleVATOverwrite: number | undefined;
|
|
116
116
|
vatAmount: number;
|
|
117
117
|
uuid: string;
|
|
118
|
-
menuUUID?: string
|
|
119
|
-
upsellCategories?: string[]
|
|
120
|
-
isReorder?: boolean
|
|
118
|
+
menuUUID?: string;
|
|
119
|
+
upsellCategories?: string[];
|
|
120
|
+
isReorder?: boolean;
|
|
121
121
|
basketUUID: string;
|
|
122
122
|
hasModifiers: boolean;
|
|
123
|
-
extMediaUUID?: string
|
|
123
|
+
extMediaUUID?: string;
|
|
124
124
|
name: string;
|
|
125
125
|
kitchenTicketName: string;
|
|
126
|
-
slug?: string
|
|
126
|
+
slug?: string;
|
|
127
127
|
description: string | null;
|
|
128
|
-
dealCategoryOrder?: number
|
|
128
|
+
dealCategoryOrder?: number;
|
|
129
129
|
isGrouped: boolean;
|
|
130
130
|
isPrintable: boolean;
|
|
131
|
-
isAccessory?: boolean
|
|
131
|
+
isAccessory?: boolean;
|
|
132
132
|
straightToPickup: boolean;
|
|
133
133
|
appStraightToPickup: Order.Bundle.AppStraightToPickup;
|
|
134
134
|
type: string;
|
|
135
|
-
items?: Order.Item.Item[]
|
|
135
|
+
items?: Order.Item.Item[];
|
|
136
136
|
price: number;
|
|
137
137
|
priceEatIn: number;
|
|
138
138
|
hasEatInPrice: boolean;
|
|
139
|
-
refund?: number
|
|
140
|
-
excludeFromServiceCharge?: boolean
|
|
141
|
-
refundIncludingTax?: number
|
|
142
|
-
refundTaxAmount?: number
|
|
143
|
-
refundUUID?: string
|
|
139
|
+
refund?: number;
|
|
140
|
+
excludeFromServiceCharge?: boolean;
|
|
141
|
+
refundIncludingTax?: number;
|
|
142
|
+
refundTaxAmount?: number;
|
|
143
|
+
refundUUID?: string;
|
|
144
144
|
finalPrice: number;
|
|
145
145
|
subtotalAmountIncludingTax: number;
|
|
146
146
|
totalAmount: number;
|
|
147
|
-
totalAmountBeforeRefund?: number
|
|
147
|
+
totalAmountBeforeRefund?: number;
|
|
148
148
|
subtotalAmount: number;
|
|
149
149
|
discount: number;
|
|
150
150
|
taxExempt: number;
|
|
@@ -153,24 +153,24 @@ export declare const assignVat: (order: Order.Order) => {
|
|
|
153
153
|
rootCategory?: {
|
|
154
154
|
name: string;
|
|
155
155
|
uuid: string;
|
|
156
|
-
}
|
|
157
|
-
category?: object
|
|
158
|
-
note?: string | null
|
|
159
|
-
defaultItems?: Order.Bundle.DefaultItem[]
|
|
160
|
-
promotion?: Order.Promotion | null
|
|
161
|
-
promotions?: Order.BundlePromotion[] | null
|
|
156
|
+
};
|
|
157
|
+
category?: object;
|
|
158
|
+
note?: string | null;
|
|
159
|
+
defaultItems?: Order.Bundle.DefaultItem[];
|
|
160
|
+
promotion?: Order.Promotion | null;
|
|
161
|
+
promotions?: Order.BundlePromotion[] | null;
|
|
162
162
|
meta: object;
|
|
163
|
-
baseTotalAmount?: number
|
|
164
|
-
baseVatAmount?: number
|
|
165
|
-
deal?: Order.Bundle.Deal
|
|
163
|
+
baseTotalAmount?: number;
|
|
164
|
+
baseVatAmount?: number;
|
|
165
|
+
deal?: Order.Bundle.Deal;
|
|
166
166
|
kitchenStation: Order.Bundle.KitchenStation | null;
|
|
167
|
-
status?: string
|
|
167
|
+
status?: string;
|
|
168
168
|
allergens: string[];
|
|
169
|
-
isRecommendation?: boolean
|
|
170
|
-
parentID?: string
|
|
171
|
-
quantity?: number
|
|
172
|
-
basketEntries?: Record<string, Partial<Order.Bundle.Bundle
|
|
173
|
-
adjustment?: Order.Bundle.Adjustment
|
|
169
|
+
isRecommendation?: boolean;
|
|
170
|
+
parentID?: string;
|
|
171
|
+
quantity?: number;
|
|
172
|
+
basketEntries?: Record<string, Partial<Order.Bundle.Bundle>>;
|
|
173
|
+
adjustment?: Order.Bundle.Adjustment;
|
|
174
174
|
tags: Order.Bundle.Tag[];
|
|
175
175
|
}[];
|
|
176
176
|
};
|
package/src/lib/tax.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assignVat = exports.calculateVatSales = exports.bundlesVat = exports.calculateItemsTax = void 0;
|
|
4
|
-
const
|
|
5
|
-
const R = tslib_1.__importStar(require("ramda"));
|
|
4
|
+
const ramda_1 = require("ramda");
|
|
6
5
|
const discounts_1 = require("../discounts");
|
|
7
6
|
const number_wrapper_1 = require("../number-wrapper");
|
|
8
7
|
const tax_1 = require("../tax");
|
|
@@ -18,7 +17,7 @@ const sum = (items, precision = 2) => {
|
|
|
18
17
|
};
|
|
19
18
|
const calculateItemsTax = (itemTypes, isTakeAway, bundleVATOverwrites, isTaxExclusive = false, salesTaxRate = 0) => {
|
|
20
19
|
const MathWrapper = (0, number_wrapper_1.getNumber)();
|
|
21
|
-
const resultItemTypes =
|
|
20
|
+
const resultItemTypes = (0, ramda_1.clone)(itemTypes);
|
|
22
21
|
const items = (0, utils_1.getItems)(resultItemTypes);
|
|
23
22
|
items.forEach((item) => {
|
|
24
23
|
var _a, _b;
|
|
@@ -39,12 +38,11 @@ const calculateItemsTax = (itemTypes, isTakeAway, bundleVATOverwrites, isTaxExcl
|
|
|
39
38
|
exports.calculateItemsTax = calculateItemsTax;
|
|
40
39
|
const bundlesVat = (bundles, isTakeAway, isTaxExclusive = false, salesTaxRate = 0) => {
|
|
41
40
|
return bundles.map((bundle) => {
|
|
42
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
const itemTypes = ((_a = bundle === null || bundle === void 0 ? void 0 : bundle.itemTypes) !== null && _a !== void 0 ? _a : []);
|
|
43
43
|
const bundleVATOverwrites = (0, utils_1.findBundleVATOverwrite)(itemTypes);
|
|
44
44
|
const itemTypesWithTax = (0, exports.calculateItemsTax)(itemTypes, isTakeAway, bundleVATOverwrites, isTaxExclusive, salesTaxRate);
|
|
45
|
-
const vatAmount =
|
|
46
|
-
.pipe(utils_1.getItems, R.pluck('vatAmount'), sum)(itemTypesWithTax)
|
|
47
|
-
.value();
|
|
45
|
+
const vatAmount = sum((0, utils_1.getItems)(itemTypesWithTax).map((item) => item.vatAmount)).value();
|
|
48
46
|
const bundleVATOverwrite = isTakeAway
|
|
49
47
|
? bundleVATOverwrites.takeaway
|
|
50
48
|
: bundleVATOverwrites.eatin;
|
|
@@ -55,15 +53,20 @@ const bundlesVat = (bundles, isTakeAway, isTaxExclusive = false, salesTaxRate =
|
|
|
55
53
|
exports.bundlesVat = bundlesVat;
|
|
56
54
|
const calculateVatSales = (bundles, vatableSales = true) => {
|
|
57
55
|
const MathWrapper = (0, number_wrapper_1.getNumber)();
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
return bundles
|
|
57
|
+
.reduce((acc, bundle) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const itemTypes = ((_a = bundle === null || bundle === void 0 ? void 0 : bundle.itemTypes) !== null && _a !== void 0 ? _a : []);
|
|
60
|
+
const finalPriceOfSales = sum((0, utils_1.getItems)(itemTypes)
|
|
61
|
+
.filter(({ vatAmount }) => (vatableSales ? !!vatAmount : !vatAmount))
|
|
62
|
+
.map((item) => item.finalPrice));
|
|
61
63
|
return acc.add(finalPriceOfSales);
|
|
62
|
-
}, new MathWrapper(0)
|
|
64
|
+
}, new MathWrapper(0))
|
|
65
|
+
.value();
|
|
63
66
|
};
|
|
64
67
|
exports.calculateVatSales = calculateVatSales;
|
|
65
68
|
const assignVat = (order) => {
|
|
66
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
69
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
67
70
|
const MathWrapper = (0, number_wrapper_1.getNumber)();
|
|
68
71
|
const bundles = (_a = order === null || order === void 0 ? void 0 : order.bundles) !== null && _a !== void 0 ? _a : [];
|
|
69
72
|
const isTakeAway = (_b = order === null || order === void 0 ? void 0 : order.takeaway) !== null && _b !== void 0 ? _b : false;
|
|
@@ -82,9 +85,9 @@ const assignVat = (order) => {
|
|
|
82
85
|
? (0, tax_1.productTax)(deliveryFeeWithDiscount, deliveryVatRate).tax
|
|
83
86
|
: (0, utils_1.calculateInclusiveTax)(deliveryFeeWithDiscount, deliveryVatRate);
|
|
84
87
|
const bundlesWithTax = (0, exports.bundlesVat)(bundles, isTakeAway, isTaxExclusive, salesTaxRate);
|
|
85
|
-
const totalBundlesTax =
|
|
86
|
-
const totalBundlesTaxBeforeRefund =
|
|
87
|
-
const promotion =
|
|
88
|
+
const totalBundlesTax = sum(bundlesWithTax.map((bundle) => bundle.vatAmount));
|
|
89
|
+
const totalBundlesTaxBeforeRefund = sum(bundlesWithTax.map((bundle) => bundle.vatAmountBeforeRefund));
|
|
90
|
+
const promotion = (_l = order === null || order === void 0 ? void 0 : order.promotions) === null || _l === void 0 ? void 0 : _l[0];
|
|
88
91
|
const discountedDeliveryFee = new MathWrapper(deliveryFee)
|
|
89
92
|
.subtract((0, discounts_1.discountDeliveryFee)(deliveryFee, promotion) || 0)
|
|
90
93
|
.value();
|
|
@@ -95,7 +98,7 @@ const assignVat = (order) => {
|
|
|
95
98
|
if (deliveryFeeTaxAmountBeforeRefund > 0) {
|
|
96
99
|
const diff = new MathWrapper(deliveryFeeTaxAmountBeforeRefund)
|
|
97
100
|
.subtract(deliveryFeeTaxAmount)
|
|
98
|
-
.subtract((
|
|
101
|
+
.subtract((_m = orderPayment.deliveryFeeRefundTaxAmount) !== null && _m !== void 0 ? _m : 0)
|
|
99
102
|
.value();
|
|
100
103
|
deliveryFeeTaxAmount = new MathWrapper(deliveryFeeTaxAmount)
|
|
101
104
|
.add(diff)
|
package/src/lib/tax.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax.js","sourceRoot":"","sources":["../../../../../packages/amounts/src/lib/tax.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tax.js","sourceRoot":"","sources":["../../../../../packages/amounts/src/lib/tax.ts"],"names":[],"mappings":";;;AACA,iCAA8B;AAE9B,4CAAmD;AACnD,sDAA8C;AAC9C,gCAAoC;AACpC,oCAMkB;AAOlB,MAAM,GAAG,GAAG,CAAC,KAAoB,EAAE,SAAS,GAAG,CAAC,EAAE,EAAE;IAClD,MAAM,WAAW,GAAG,IAAA,0BAAS,GAAE,CAAC;IAEhC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAChC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,GAAG,CAAC;QACb,CAAC;QAED,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAC/B,SAA2B,EAC3B,UAAmB,EACnB,mBAAwC,EACxC,cAAc,GAAG,KAAK,EACtB,YAAY,GAAG,CAAC,EAChB,EAAE;IACF,MAAM,WAAW,GAAG,IAAA,0BAAS,GAAE,CAAC;IAChC,MAAM,eAAe,GAAG,IAAA,aAAK,EAAC,SAAS,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAA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