@pisell/pisellos 2.1.103 → 2.1.104
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.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/strategy/adapter/index.d.ts +3 -0
- package/dist/model/strategy/adapter/index.js +4 -0
- package/dist/model/strategy/adapter/type.d.ts +28 -0
- package/dist/model/strategy/adapter/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +498 -0
- package/dist/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/dist/model/strategy/adapter/walletPass/example.js +258 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/index.js +182 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/locales.js +26 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +169 -0
- package/dist/model/strategy/adapter/walletPass/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +1064 -0
- package/dist/model/strategy/index.d.ts +94 -0
- package/dist/model/strategy/index.js +551 -0
- package/dist/model/strategy/strategy-example.d.ts +5 -0
- package/dist/model/strategy/strategy-example.js +331 -0
- package/dist/model/strategy/type.d.ts +228 -0
- package/dist/model/strategy/type.js +94 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +11 -0
- package/dist/modules/Discount/types.d.ts +16 -0
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +545 -129
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +6 -0
- package/dist/modules/Summary/utils.js +21 -0
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +3 -1
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +23 -7
- package/dist/solution/ShopDiscount/types.d.ts +1 -0
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/model/index.d.ts +1 -0
- package/lib/model/index.js +23 -0
- package/lib/model/strategy/adapter/index.d.ts +3 -0
- package/lib/model/strategy/adapter/index.js +45 -0
- package/lib/model/strategy/adapter/type.d.ts +28 -0
- package/lib/model/strategy/adapter/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +422 -0
- package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/lib/model/strategy/adapter/walletPass/example.js +207 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/index.js +142 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/locales.js +54 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +169 -0
- package/lib/model/strategy/adapter/walletPass/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +720 -0
- package/lib/model/strategy/index.d.ts +94 -0
- package/lib/model/strategy/index.js +413 -0
- package/lib/model/strategy/strategy-example.d.ts +5 -0
- package/lib/model/strategy/strategy-example.js +318 -0
- package/lib/model/strategy/type.d.ts +228 -0
- package/lib/model/strategy/type.js +44 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +9 -0
- package/lib/modules/Discount/types.d.ts +16 -0
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +671 -262
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +6 -0
- package/lib/modules/Summary/utils.js +15 -0
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +3 -1
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +22 -8
- package/lib/solution/ShopDiscount/types.d.ts +1 -0
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/package.json +1 -1
|
@@ -58,6 +58,12 @@ export declare const getTax: ({ service, addons, bookingDetail, bookingId }: {
|
|
|
58
58
|
* @returns 商品总价字符串,保留2位小数
|
|
59
59
|
*/
|
|
60
60
|
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
61
|
+
/**
|
|
62
|
+
* 计算商品小计(不含其他费用 不包含折扣卡商品券抵扣金额)
|
|
63
|
+
* @param items - 购物车商品数组
|
|
64
|
+
* @returns 商品总价字符串,保留2位小数
|
|
65
|
+
*/
|
|
66
|
+
export declare const calculateOriginSubtotal: (items: CartItem[]) => string;
|
|
61
67
|
/**
|
|
62
68
|
* @title: 单个商品的税费
|
|
63
69
|
* @description:
|
|
@@ -31,6 +31,7 @@ var utils_exports = {};
|
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
calcDiscountListDifference: () => calcDiscountListDifference,
|
|
33
33
|
calculateDeposit: () => calculateDeposit,
|
|
34
|
+
calculateOriginSubtotal: () => calculateOriginSubtotal,
|
|
34
35
|
calculatePriceDetails: () => calculatePriceDetails,
|
|
35
36
|
calculateSubtotal: () => calculateSubtotal,
|
|
36
37
|
calculateTaxFee: () => calculateTaxFee,
|
|
@@ -46,6 +47,7 @@ var import_utils = require("../Product/utils");
|
|
|
46
47
|
var import_dayjs = __toESM(require("dayjs"));
|
|
47
48
|
var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList, scheduleById) => {
|
|
48
49
|
const subtotal = new import_decimal.default(calculateSubtotal(items));
|
|
50
|
+
const subOriginTotal = new import_decimal.default(calculateOriginSubtotal(items));
|
|
49
51
|
const totalTaxFee = new import_decimal.default(calculateTaxFee(shopInfo, items));
|
|
50
52
|
const surcharge = getSurcharge({ service: items, addons: [], bookingDetail: null, bookingId: void 0 }, { isEdit: false, isInScheduleByDate, surcharge_list: surchargeList, scheduleById });
|
|
51
53
|
const surchargeAmount = new import_decimal.default(getSurchargeAmount({ bookingDetail: null, bookingId: void 0 }, surcharge, { isEdit: false }));
|
|
@@ -59,10 +61,12 @@ var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList,
|
|
|
59
61
|
is_price_include_tax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax
|
|
60
62
|
});
|
|
61
63
|
const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal.plus(surchargeAmount) : subtotal.plus(tax).plus(surchargeAmount);
|
|
64
|
+
const originTotal = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
|
|
62
65
|
const deposit = calculateDeposit(items);
|
|
63
66
|
return {
|
|
64
67
|
subtotal: subtotal.toFixed(2),
|
|
65
68
|
total: total.toFixed(2),
|
|
69
|
+
originTotal: originTotal.toFixed(2),
|
|
66
70
|
taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
|
|
67
71
|
taxRate: shopInfo == null ? void 0 : shopInfo.tax_rate,
|
|
68
72
|
totalTaxFee: tax,
|
|
@@ -360,6 +364,16 @@ var calculateSubtotal = (items) => {
|
|
|
360
364
|
}, new import_decimal.default(0));
|
|
361
365
|
return subtotal.toFixed(2);
|
|
362
366
|
};
|
|
367
|
+
var calculateOriginSubtotal = (items) => {
|
|
368
|
+
if (!(items == null ? void 0 : items.length)) {
|
|
369
|
+
return "0.00";
|
|
370
|
+
}
|
|
371
|
+
const subtotal = items.reduce((sum, item) => {
|
|
372
|
+
const cartItemTotalPrice = new import_decimal.default(item.summaryOriginTotal || 0);
|
|
373
|
+
return sum.plus(cartItemTotalPrice);
|
|
374
|
+
}, new import_decimal.default(0));
|
|
375
|
+
return subtotal.toFixed(2);
|
|
376
|
+
};
|
|
363
377
|
var calculateTaxFee = (shopInfo, items) => {
|
|
364
378
|
if (!(items == null ? void 0 : items.length)) {
|
|
365
379
|
return "0.00";
|
|
@@ -785,6 +799,7 @@ function resetItemsSurchargeSideEffects({ service, addons }) {
|
|
|
785
799
|
0 && (module.exports = {
|
|
786
800
|
calcDiscountListDifference,
|
|
787
801
|
calculateDeposit,
|
|
802
|
+
calculateOriginSubtotal,
|
|
788
803
|
calculatePriceDetails,
|
|
789
804
|
calculateSubtotal,
|
|
790
805
|
calculateTaxFee,
|
package/lib/plugins/window.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WalletPassEvaluator } from '../model';
|
|
1
2
|
import { Plugin } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* WindowPlugin 接口定义
|
|
@@ -14,6 +15,7 @@ export interface WindowPlugin extends Plugin {
|
|
|
14
15
|
document: Partial<Document>;
|
|
15
16
|
history: History;
|
|
16
17
|
interaction?: any;
|
|
18
|
+
getWalletPassEvaluator?: () => WalletPassEvaluator;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* 简单的 Storage 接口实现
|
|
@@ -144,6 +144,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
144
144
|
getSummary(): Promise<{
|
|
145
145
|
subtotal: string | number;
|
|
146
146
|
total: string | number;
|
|
147
|
+
originTotal: string | number;
|
|
147
148
|
taxTitle?: string | undefined;
|
|
148
149
|
totalTaxFee?: string | number | undefined;
|
|
149
150
|
isPriceIncludeTax?: 0 | 1 | undefined;
|
|
@@ -310,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
310
311
|
date: string;
|
|
311
312
|
status: string;
|
|
312
313
|
week: string;
|
|
313
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
314
315
|
}[]>;
|
|
315
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
316
317
|
private getScheduleDataByIds;
|
|
@@ -357,7 +358,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
357
358
|
};
|
|
358
359
|
setOtherData(key: string, value: any): void;
|
|
359
360
|
getOtherData(key: string): any;
|
|
360
|
-
getProductTypeById(id: number): Promise<"
|
|
361
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
361
362
|
/**
|
|
362
363
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
363
364
|
*
|
|
@@ -115,7 +115,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
115
115
|
* 获取当前的客户搜索条件
|
|
116
116
|
* @returns 当前搜索条件
|
|
117
117
|
*/
|
|
118
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
118
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
119
119
|
/**
|
|
120
120
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
121
121
|
* @returns 客户状态
|
|
@@ -222,6 +222,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
222
222
|
product_id: item.product_id,
|
|
223
223
|
product_variant_id: item.product_variant_id,
|
|
224
224
|
quantity: item.num,
|
|
225
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
225
226
|
// 商品是否含税:1;0
|
|
226
227
|
is_charge_tax: item.is_charge_tax ?? 0,
|
|
227
228
|
// 若商品不含税,计算得到的税费,单位(元)
|
|
@@ -244,8 +245,9 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
244
245
|
// 可选,附加费均摊舍入金额
|
|
245
246
|
"surcharge_rounding_remainder": item.metadata.surcharge_rounding_remainder
|
|
246
247
|
},
|
|
247
|
-
product_bundle: item.product_bundle.map((bundle) => {
|
|
248
|
+
product_bundle: (item.product_bundle || []).map((bundle) => {
|
|
248
249
|
return {
|
|
250
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
249
251
|
bundle_id: bundle.bundle_id,
|
|
250
252
|
bundle_product_id: bundle.bundle_product_id,
|
|
251
253
|
bundle_variant_id: bundle.bundle_variant_id,
|
|
@@ -22,6 +22,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
22
22
|
getCurrentBookingTime(): string | null;
|
|
23
23
|
private filterDiscountListByBookingTime;
|
|
24
24
|
setCustomer(customer: Customer): Promise<void>;
|
|
25
|
+
setOriginTotalAmount(amount: number): void;
|
|
25
26
|
setHolders(holders: {
|
|
26
27
|
form_record_id: number;
|
|
27
28
|
}[]): void;
|
|
@@ -56,7 +56,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
56
56
|
originalDiscountList: [],
|
|
57
57
|
currentBookingTime: "",
|
|
58
58
|
filteredDiscountList: [],
|
|
59
|
-
bookingSubject: void 0
|
|
59
|
+
bookingSubject: void 0,
|
|
60
|
+
orderTotalAmount: 0
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
// =========== 生命周期方法 ===========
|
|
@@ -194,6 +195,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
194
195
|
);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
198
|
+
setOriginTotalAmount(amount) {
|
|
199
|
+
this.store.orderTotalAmount = amount;
|
|
200
|
+
}
|
|
197
201
|
// 设置holders
|
|
198
202
|
setHolders(holders) {
|
|
199
203
|
this.store.holders = holders;
|
|
@@ -213,6 +217,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
213
217
|
{
|
|
214
218
|
productList,
|
|
215
219
|
discountList: this.getDiscountList(),
|
|
220
|
+
orderTotalAmount: this.store.orderTotalAmount || 0,
|
|
216
221
|
holders: this.store.holders || [],
|
|
217
222
|
isFormSubject: ((_a = this.store.bookingSubject) == null ? void 0 : _a.type) === "form"
|
|
218
223
|
},
|
|
@@ -320,6 +325,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
320
325
|
productList: this.store.productList || [],
|
|
321
326
|
oldDiscountList: this.getDiscountList(),
|
|
322
327
|
newDiscountList: withScanList,
|
|
328
|
+
orderTotalAmount: this.store.orderTotalAmount || 0,
|
|
323
329
|
holders: this.store.holders || [],
|
|
324
330
|
isFormSubject: ((_b = this.store.bookingSubject) == null ? void 0 : _b.type) === "form"
|
|
325
331
|
}) || {
|
|
@@ -388,7 +394,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
388
394
|
if (item.booking_id) {
|
|
389
395
|
const product = (_a2 = this.hooks) == null ? void 0 : _a2.getProduct(item);
|
|
390
396
|
(item.discount_list || []).forEach((discount) => {
|
|
391
|
-
var _a3, _b, _c, _d, _e;
|
|
397
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
392
398
|
if (discount.id && ["good_pass", "discount_card"].includes(discount.type)) {
|
|
393
399
|
const index = editModeDiscountList.findIndex((n) => {
|
|
394
400
|
var _a4;
|
|
@@ -397,8 +403,12 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
397
403
|
if (index !== -1) {
|
|
398
404
|
editModeDiscountList[index] = {
|
|
399
405
|
...editModeDiscountList[index],
|
|
406
|
+
metadata: {
|
|
407
|
+
...discount.metadata || {},
|
|
408
|
+
num: (((_b = (_a3 = editModeDiscountList == null ? void 0 : editModeDiscountList[index]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b.num) || 1) + (((_c = discount.metadata) == null ? void 0 : _c.num) || 1)
|
|
409
|
+
},
|
|
400
410
|
amount: new import_decimal.default(discount.amount || 0).plus(new import_decimal.default(editModeDiscountList[index].amount || 0)).toNumber(),
|
|
401
|
-
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((
|
|
411
|
+
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((_d = discount == null ? void 0 : discount.metadata) == null ? void 0 : _d.product_discount_difference) || 0).plus(new import_decimal.default(editModeDiscountList[index].savedAmount || 0)).toNumber()
|
|
402
412
|
};
|
|
403
413
|
} else {
|
|
404
414
|
if (discount.type && !discount.tag) {
|
|
@@ -406,16 +416,20 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
406
416
|
}
|
|
407
417
|
editModeDiscountList.push({
|
|
408
418
|
...discount,
|
|
419
|
+
metadata: {
|
|
420
|
+
...discount.metadata || {},
|
|
421
|
+
num: ((_e = discount.metadata) == null ? void 0 : _e.num) || 1
|
|
422
|
+
},
|
|
409
423
|
name: discount.name || discount.discount.title.auto,
|
|
410
424
|
isEditMode: true,
|
|
411
425
|
limited_relation_product_data: {},
|
|
412
|
-
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((
|
|
426
|
+
savedAmount: new import_decimal.default(discount.amount || 0).times((product == null ? void 0 : product.quantity) || (product == null ? void 0 : product.num) || 1).plus(((_f = discount == null ? void 0 : discount.metadata) == null ? void 0 : _f.product_discount_difference) || 0).toNumber(),
|
|
413
427
|
isAvailable: true,
|
|
414
|
-
id: ((
|
|
415
|
-
format_title: ((
|
|
428
|
+
id: ((_g = discount.discount) == null ? void 0 : _g.resource_id) || discount.id,
|
|
429
|
+
format_title: ((_h = discount.discount) == null ? void 0 : _h.title) || discount.format_title,
|
|
416
430
|
isDisabled: true,
|
|
417
431
|
isSelected: true,
|
|
418
|
-
product_id: ((
|
|
432
|
+
product_id: ((_i = discount.discount) == null ? void 0 : _i.product_id) || discount.product_id
|
|
419
433
|
});
|
|
420
434
|
}
|
|
421
435
|
}
|
|
@@ -532,7 +546,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
532
546
|
}
|
|
533
547
|
await this.core.effects.emit(
|
|
534
548
|
`${this.name}:onLoadDiscountList`,
|
|
535
|
-
|
|
549
|
+
newDiscountList
|
|
536
550
|
);
|
|
537
551
|
} catch (error) {
|
|
538
552
|
console.error("[ShopDiscount] 加载准备配置出错:", error);
|
|
@@ -56,14 +56,18 @@ var isAllNormalProduct = (items) => {
|
|
|
56
56
|
};
|
|
57
57
|
var getDiscountAmount = (discount, total, price) => {
|
|
58
58
|
var _a;
|
|
59
|
+
let discountedPrice = 0;
|
|
59
60
|
if (discount.tag === "good_pass") {
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
discountedPrice = new import_decimal.default(price).minus(new import_decimal.default(price || 0)).toNumber();
|
|
62
|
+
} else {
|
|
63
|
+
const isFixedAmount = ((_a = discount == null ? void 0 : discount.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount";
|
|
64
|
+
if (isFixedAmount) {
|
|
65
|
+
discountedPrice = Math.max(new import_decimal.default(price).minus(new import_decimal.default(discount.par_value || 0)).toNumber(), 0);
|
|
66
|
+
} else {
|
|
67
|
+
discountedPrice = new import_decimal.default(100).minus(discount.par_value || 0).div(100).mul(new import_decimal.default(price)).toNumber();
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
|
-
return
|
|
70
|
+
return discountedPrice;
|
|
67
71
|
};
|
|
68
72
|
var getDiscountListAmountTotal = (discount) => {
|
|
69
73
|
return discount.reduce((acc, cur) => {
|