@pisell/pisellos 2.3.5 → 2.3.7
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/core/index.js +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +17 -13
- package/dist/modules/Order/index.d.ts +12 -1
- package/dist/modules/Order/index.js +260 -160
- package/dist/modules/Order/types.d.ts +5 -0
- package/dist/modules/Order/utils.d.ts +4 -0
- package/dist/modules/Order/utils.js +31 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Rules/index.d.ts +3 -3
- package/dist/modules/Rules/index.js +8 -3
- package/dist/modules/Rules/types.d.ts +2 -1
- package/dist/server/index.js +4 -3
- package/dist/server/modules/order/index.d.ts +4 -4
- package/dist/server/modules/order/index.js +4 -4
- package/dist/solution/BaseSales/index.js +93 -68
- package/dist/solution/BaseSales/types.d.ts +1 -0
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/lib/core/index.js +1 -1
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +11 -1
- package/lib/modules/Order/index.d.ts +12 -1
- package/lib/modules/Order/index.js +135 -26
- package/lib/modules/Order/types.d.ts +5 -0
- package/lib/modules/Order/utils.d.ts +4 -0
- package/lib/modules/Order/utils.js +39 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Rules/index.d.ts +3 -3
- package/lib/modules/Rules/index.js +4 -3
- package/lib/modules/Rules/types.d.ts +2 -1
- package/lib/server/index.js +1 -4
- package/lib/server/modules/order/index.d.ts +4 -4
- package/lib/server/modules/order/index.js +4 -4
- package/lib/solution/BaseSales/index.js +40 -19
- package/lib/solution/BaseSales/types.d.ts +1 -0
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -5
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -540,6 +540,11 @@ export interface SyncPaymentsToOrderParams {
|
|
|
540
540
|
}
|
|
541
541
|
export interface SyncPaymentsToOrderResult<T = any> {
|
|
542
542
|
isFullyPaid: boolean;
|
|
543
|
+
isOrderFullyPaid: boolean;
|
|
544
|
+
isDepositFullyPaid: boolean;
|
|
545
|
+
paymentStage: 'deposit' | 'normal';
|
|
546
|
+
depositAmount: string;
|
|
547
|
+
orderExpectedAmount: string;
|
|
543
548
|
submitResult?: T;
|
|
544
549
|
}
|
|
545
550
|
export interface OrderIdentitySnapshot {
|
|
@@ -254,6 +254,10 @@ export declare function clearTempOrderHolderAssignments(tempOrder: OrderTempOrde
|
|
|
254
254
|
* getOrderProductLineUid({ metadata: { unique_identification_number: 'line-1' } }); // 'line-1'
|
|
255
255
|
*/
|
|
256
256
|
export declare function getOrderProductLineUid(product: Record<string, any> | null | undefined): string | null;
|
|
257
|
+
export declare function getRuntimeProductOrigin(tempOrder: OrderTempOrder | null | undefined, product: any): Record<string, any> | null;
|
|
258
|
+
export declare function isHolderConfigRequired(holderConfig: any): boolean;
|
|
259
|
+
export declare function productRequiresFormSubject(tempOrder: OrderTempOrder | null | undefined, product: any): boolean;
|
|
260
|
+
export declare function resolveIsFormSubject(tempOrder: OrderTempOrder | null | undefined, product?: any): boolean;
|
|
257
261
|
/**
|
|
258
262
|
* 判断展示字段是否为空(含 i18n 对象全空)。
|
|
259
263
|
*
|
|
@@ -1287,6 +1287,37 @@ export function getOrderProductLineUid(product) {
|
|
|
1287
1287
|
if (uid === undefined || uid === null || uid === '') return null;
|
|
1288
1288
|
return String(uid);
|
|
1289
1289
|
}
|
|
1290
|
+
export function getRuntimeProductOrigin(tempOrder, product) {
|
|
1291
|
+
var _tempOrder$_extend2, _tempOrder$_extend3;
|
|
1292
|
+
var uid = getOrderProductLineUid(product);
|
|
1293
|
+
if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend2 = tempOrder._extend) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2[uid]) !== null && _tempOrder$_extend2 !== void 0 && _tempOrder$_extend2.origin) {
|
|
1294
|
+
return tempOrder._extend.productsByUid[uid].origin;
|
|
1295
|
+
}
|
|
1296
|
+
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
1297
|
+
var _ref32, _item$product_id, _ref33, _product$product_id;
|
|
1298
|
+
return item === product || getOrderProductLineUid(item) === uid || String((_ref32 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref32 !== void 0 ? _ref32 : '') === String((_ref33 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref33 !== void 0 ? _ref33 : '');
|
|
1299
|
+
});
|
|
1300
|
+
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1301
|
+
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[matchedUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin) || null : null;
|
|
1302
|
+
}
|
|
1303
|
+
export function isHolderConfigRequired(holderConfig) {
|
|
1304
|
+
if (!holderConfig || _typeof(holderConfig) !== 'object') return false;
|
|
1305
|
+
if (holderConfig.status === 'disable') return false;
|
|
1306
|
+
return Number(holderConfig.required) === 1;
|
|
1307
|
+
}
|
|
1308
|
+
export function productRequiresFormSubject(tempOrder, product) {
|
|
1309
|
+
var runtimeOrigin = getRuntimeProductOrigin(tempOrder, product);
|
|
1310
|
+
return isHolderConfigRequired(product === null || product === void 0 ? void 0 : product.holder_config) || isHolderConfigRequired(runtimeOrigin === null || runtimeOrigin === void 0 ? void 0 : runtimeOrigin.holder_config);
|
|
1311
|
+
}
|
|
1312
|
+
export function resolveIsFormSubject(tempOrder, product) {
|
|
1313
|
+
var _tempOrder$holder;
|
|
1314
|
+
// 旧版预约维度的 holder 类型仍然生效;新版则从当前商品 holder_config 判断。
|
|
1315
|
+
if ((tempOrder === null || tempOrder === void 0 || (_tempOrder$holder = tempOrder.holder) === null || _tempOrder$holder === void 0 ? void 0 : _tempOrder$holder.type) === 'form') return true;
|
|
1316
|
+
if (product) return productRequiresFormSubject(tempOrder, product);
|
|
1317
|
+
return ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).some(function (item) {
|
|
1318
|
+
return productRequiresFormSubject(tempOrder, item);
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1290
1321
|
|
|
1291
1322
|
/**
|
|
1292
1323
|
* 判断展示字段是否为空(含 i18n 对象全空)。
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
|
|
3
|
+
import { Rules, RulesModuleAPI, DiscountResult, RulesFormSubject, UnavailableReason } from './types';
|
|
4
4
|
import { Discount } from '../Discount/types';
|
|
5
5
|
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
6
6
|
import { WindowPlugin } from '../../plugins';
|
|
@@ -24,7 +24,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
24
24
|
holders: {
|
|
25
25
|
form_record_id: number;
|
|
26
26
|
}[];
|
|
27
|
-
isFormSubject:
|
|
27
|
+
isFormSubject: RulesFormSubject;
|
|
28
28
|
}): {
|
|
29
29
|
isAvailable: boolean;
|
|
30
30
|
discountList: Discount[];
|
|
@@ -43,7 +43,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
43
43
|
holders: {
|
|
44
44
|
form_record_id: number;
|
|
45
45
|
}[];
|
|
46
|
-
isFormSubject:
|
|
46
|
+
isFormSubject: RulesFormSubject;
|
|
47
47
|
orderTotalAmount: number;
|
|
48
48
|
}, options?: {
|
|
49
49
|
isSelected?: boolean;
|
|
@@ -118,7 +118,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
118
118
|
// 非表单类型 holder 视为匹配
|
|
119
119
|
if (((_discount$holder = discount.holder) === null || _discount$holder === void 0 ? void 0 : _discount$holder.holder_type) !== 'form') return true;
|
|
120
120
|
// 主预约holder, 目前(20251124)默认只考虑单个holder的情况
|
|
121
|
-
|
|
121
|
+
// 旧版 holders[0].form_record_id 新版 holders[0]
|
|
122
|
+
var orderHolderId = Array.isArray(holders) && holders.length > 0 ? holders[0].form_record_id || holders[0] : undefined;
|
|
122
123
|
var productHolderId = Array.isArray(product.holder_id) ? product.holder_id[0] : product.holder_id;
|
|
123
124
|
// 商品不需要选holder,则不对比holder,直接返回true,
|
|
124
125
|
if (!product.isNeedHolder) return true;
|
|
@@ -323,6 +324,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
323
324
|
holders = _ref2.holders,
|
|
324
325
|
isFormSubject = _ref2.isFormSubject,
|
|
325
326
|
orderTotalAmount = _ref2.orderTotalAmount;
|
|
327
|
+
var resolveIsFormSubject = function resolveIsFormSubject(product) {
|
|
328
|
+
return typeof isFormSubject === 'function' ? Boolean(isFormSubject(product)) : Boolean(isFormSubject);
|
|
329
|
+
};
|
|
330
|
+
|
|
326
331
|
// 识别出来是不是在编辑的界面里又新增了商品
|
|
327
332
|
// 这种情况下,如果有可用的优惠券,也会自动勾选上
|
|
328
333
|
var isEditModeAddNewProduct = productList.find(function (n) {
|
|
@@ -885,7 +890,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
885
890
|
// 拿到discount配置的holder信息 product信息 product.holder 加在 isLimitedProduct
|
|
886
891
|
var _tempVar = (flatItem === null || flatItem === void 0 ? void 0 : flatItem.type) === 'bundle' ? flatItem === null || flatItem === void 0 ? void 0 : flatItem.parentProduct : flatItem === null || flatItem === void 0 ? void 0 : flatItem.product;
|
|
887
892
|
var isHolderMatch = _this3.checkHolderMatch(discount, {
|
|
888
|
-
isNeedHolder:
|
|
893
|
+
isNeedHolder: resolveIsFormSubject(_tempVar) && !(_tempVar !== null && _tempVar !== void 0 && _tempVar.isNormalProduct),
|
|
889
894
|
holder_id: (_tempVar === null || _tempVar === void 0 ? void 0 : _tempVar.holder_id) || product.holder_id
|
|
890
895
|
}, holders);
|
|
891
896
|
var timeLimit = true;
|
|
@@ -1088,7 +1093,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1088
1093
|
// 拿到discount配置的holder信息 product信息 product.holder 不可用return false
|
|
1089
1094
|
var _tempVar = (flatItem === null || flatItem === void 0 ? void 0 : flatItem.type) === 'bundle' ? flatItem === null || flatItem === void 0 ? void 0 : flatItem.parentProduct : flatItem === null || flatItem === void 0 ? void 0 : flatItem.product;
|
|
1090
1095
|
var isHolderMatch = _this3.checkHolderMatch(discount, {
|
|
1091
|
-
isNeedHolder:
|
|
1096
|
+
isNeedHolder: resolveIsFormSubject(_tempVar) && !(_tempVar !== null && _tempVar !== void 0 && _tempVar.isNormalProduct),
|
|
1092
1097
|
holder_id: (_tempVar === null || _tempVar === void 0 ? void 0 : _tempVar.holder_id) || product.holder_id
|
|
1093
1098
|
}, holders);
|
|
1094
1099
|
// 如果 holder 不匹配,则不适用
|
|
@@ -22,6 +22,7 @@ export interface DiscountResult {
|
|
|
22
22
|
productList: any[];
|
|
23
23
|
discountList: any[];
|
|
24
24
|
}
|
|
25
|
+
export type RulesFormSubject = boolean | ((product: any) => boolean);
|
|
25
26
|
export interface RulesModuleAPI {
|
|
26
27
|
setRulesList: (rulesList: Rules[]) => Promise<void>;
|
|
27
28
|
clear: () => Promise<void>;
|
|
@@ -31,7 +32,7 @@ export interface RulesModuleAPI {
|
|
|
31
32
|
holders: {
|
|
32
33
|
form_record_id: number;
|
|
33
34
|
}[];
|
|
34
|
-
isFormSubject:
|
|
35
|
+
isFormSubject: RulesFormSubject;
|
|
35
36
|
orderTotalAmount: number;
|
|
36
37
|
}) => DiscountResult;
|
|
37
38
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -1205,7 +1205,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1205
1205
|
_context17.prev = 41;
|
|
1206
1206
|
_context17.t0 = _context17["catch"](21);
|
|
1207
1207
|
errorMessage = _context17.t0 instanceof Error ? _context17.t0.message : String(_context17.t0);
|
|
1208
|
-
_this.
|
|
1208
|
+
_this.logInfo('handleOrderSalesDetail: 请求失败', {
|
|
1209
1209
|
lookup: lookup,
|
|
1210
1210
|
backendPath: backendPath,
|
|
1211
1211
|
error: errorMessage
|
|
@@ -4038,6 +4038,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
4038
4038
|
shop_order_number: next.shop_order_number,
|
|
4039
4039
|
shop_full_order_number: next.shop_full_order_number
|
|
4040
4040
|
});
|
|
4041
|
+
// 删除 数据体中的 vouchers,对小票和后端来说他们不需要,这个字段只是单向同步给前端用的,而且目前对订单来说还没什么用
|
|
4041
4042
|
return _context42.abrupt("return", next);
|
|
4042
4043
|
case 28:
|
|
4043
4044
|
_context42.prev = 28;
|
|
@@ -4684,9 +4685,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
4684
4685
|
}, {
|
|
4685
4686
|
key: "shouldBuildSmallTicketData",
|
|
4686
4687
|
value: function shouldBuildSmallTicketData(order) {
|
|
4687
|
-
var
|
|
4688
|
+
var _ref54, _order$small_ticket_d;
|
|
4688
4689
|
if (!order || _typeof(order) !== 'object') return false;
|
|
4689
|
-
if (hasSmallTicketData(
|
|
4690
|
+
// if (hasSmallTicketData(order.payment_info?.small_ticket_data)) return false;
|
|
4690
4691
|
return Number((_ref54 = (_order$small_ticket_d = order.small_ticket_data_flag) !== null && _order$small_ticket_d !== void 0 ? _order$small_ticket_d : order.smallTicketDataFlag) !== null && _ref54 !== void 0 ? _ref54 : 0) === 1;
|
|
4691
4692
|
}
|
|
4692
4693
|
}, {
|
|
@@ -31,10 +31,10 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
31
31
|
private emitOrdersChanged;
|
|
32
32
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
* 记录信息日志
|
|
35
|
+
* @param title 日志标题
|
|
36
|
+
* @param metadata 日志元数据
|
|
37
|
+
*/
|
|
38
38
|
private logInfo;
|
|
39
39
|
/**
|
|
40
40
|
* 记录错误日志
|
|
@@ -177,10 +177,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
177
177
|
return initialize;
|
|
178
178
|
}()
|
|
179
179
|
/**
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
* 记录信息日志
|
|
181
|
+
* @param title 日志标题
|
|
182
|
+
* @param metadata 日志元数据
|
|
183
|
+
*/
|
|
184
184
|
}, {
|
|
185
185
|
key: "logInfo",
|
|
186
186
|
value: function logInfo(title, metadata) {
|
|
@@ -36,7 +36,7 @@ import { OrderModule } from "../../modules/Order";
|
|
|
36
36
|
import Decimal from 'decimal.js';
|
|
37
37
|
import { cloneDeep, mergeWith } from 'lodash-es';
|
|
38
38
|
import { createModule } from "../BookingByStep/types";
|
|
39
|
-
import { composeLinePrice, createUuidV4, ensureProductSku, getProductSkuOptions, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
39
|
+
import { composeLinePrice, createUuidV4, ensureProductSku, getProductSkuOptions, resolveIsFormSubject, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
40
40
|
import dayjs from 'dayjs';
|
|
41
41
|
export * from "./types";
|
|
42
42
|
import { QuotationModule } from "../../modules/Quotation";
|
|
@@ -1489,7 +1489,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1489
1489
|
value: function () {
|
|
1490
1490
|
var _loadDiscountConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
|
|
1491
1491
|
var _this$getOrderIdentit, _tempOrder$customer, _tempOrder$_extend, _tempOrder$_extend2, _discountModule$getDi, _discountModule$getOr, _discountModule$getDi2;
|
|
1492
|
-
var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _tempOrder$holder,
|
|
1492
|
+
var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _tempOrder$holder, _orderStore$summary, holders, orderTotalAmount, result, _iterator, _step, _product$metadata5, _tempOrder$_extend3, _product$metadata$sou, _product$metadata6, _product$metadata7, _product$original_pri, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, summary;
|
|
1493
1493
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1494
1494
|
while (1) switch (_context15.prev = _context15.next) {
|
|
1495
1495
|
case 0:
|
|
@@ -1583,18 +1583,20 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1583
1583
|
});
|
|
1584
1584
|
case 40:
|
|
1585
1585
|
if (!rulesModule) {
|
|
1586
|
-
_context15.next =
|
|
1586
|
+
_context15.next = 78;
|
|
1587
1587
|
break;
|
|
1588
1588
|
}
|
|
1589
|
-
holders = (_tempOrder$holder = tempOrder.holder)
|
|
1590
|
-
|
|
1591
|
-
|
|
1589
|
+
holders = ((_tempOrder$holder = tempOrder.holder) === null || _tempOrder$holder === void 0 ? void 0 : _tempOrder$holder.form_record) || [];
|
|
1590
|
+
orderTotalAmount = Number(((_orderStore$summary = orderStore.summary) === null || _orderStore$summary === void 0 ? void 0 : _orderStore$summary.total_amount) || 0);
|
|
1591
|
+
console.log('[BaseSales.applyDiscountConfig.calcDiscount]');
|
|
1592
1592
|
result = rulesModule.calcDiscount({
|
|
1593
1593
|
productList: tempOrder.products,
|
|
1594
1594
|
discountList: nextDiscountList,
|
|
1595
1595
|
holders: holders,
|
|
1596
|
-
isFormSubject:
|
|
1597
|
-
|
|
1596
|
+
isFormSubject: function isFormSubject(product) {
|
|
1597
|
+
return resolveIsFormSubject(tempOrder, product);
|
|
1598
|
+
},
|
|
1599
|
+
orderTotalAmount: orderTotalAmount
|
|
1598
1600
|
}) || {
|
|
1599
1601
|
productList: tempOrder.products,
|
|
1600
1602
|
discountList: nextDiscountList
|
|
@@ -1603,22 +1605,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1603
1605
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
1604
1606
|
}
|
|
1605
1607
|
_iterator = _createForOfIteratorHelper(tempOrder.products || []);
|
|
1606
|
-
_context15.prev =
|
|
1608
|
+
_context15.prev = 47;
|
|
1607
1609
|
_iterator.s();
|
|
1608
|
-
case
|
|
1610
|
+
case 49:
|
|
1609
1611
|
if ((_step = _iterator.n()).done) {
|
|
1610
|
-
_context15.next =
|
|
1612
|
+
_context15.next = 64;
|
|
1611
1613
|
break;
|
|
1612
1614
|
}
|
|
1613
1615
|
product = _step.value;
|
|
1614
1616
|
productUid = (_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.unique_identification_number;
|
|
1615
1617
|
runtimeOrigin = productUid ? (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[productUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin : undefined;
|
|
1616
1618
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
1617
|
-
_context15.next =
|
|
1619
|
+
_context15.next = 55;
|
|
1618
1620
|
break;
|
|
1619
1621
|
}
|
|
1620
|
-
return _context15.abrupt("continue",
|
|
1621
|
-
case
|
|
1622
|
+
return _context15.abrupt("continue", 62);
|
|
1623
|
+
case 55:
|
|
1622
1624
|
totalPerUnitDiscount = (product.discount_list || []).reduce(function (sum, pd) {
|
|
1623
1625
|
return sum + Number(pd.amount || 0);
|
|
1624
1626
|
}, 0);
|
|
@@ -1634,58 +1636,58 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1634
1636
|
mainPrice: newMainSellingPrice,
|
|
1635
1637
|
bundle: product.product_bundle
|
|
1636
1638
|
});
|
|
1637
|
-
case 60:
|
|
1638
|
-
_context15.next = 47;
|
|
1639
|
-
break;
|
|
1640
1639
|
case 62:
|
|
1641
|
-
_context15.next =
|
|
1640
|
+
_context15.next = 49;
|
|
1642
1641
|
break;
|
|
1643
1642
|
case 64:
|
|
1644
|
-
_context15.
|
|
1645
|
-
|
|
1643
|
+
_context15.next = 69;
|
|
1644
|
+
break;
|
|
1645
|
+
case 66:
|
|
1646
|
+
_context15.prev = 66;
|
|
1647
|
+
_context15.t0 = _context15["catch"](47);
|
|
1646
1648
|
_iterator.e(_context15.t0);
|
|
1647
|
-
case
|
|
1648
|
-
_context15.prev =
|
|
1649
|
+
case 69:
|
|
1650
|
+
_context15.prev = 69;
|
|
1649
1651
|
_iterator.f();
|
|
1650
|
-
return _context15.finish(
|
|
1651
|
-
case
|
|
1652
|
+
return _context15.finish(69);
|
|
1653
|
+
case 72:
|
|
1652
1654
|
if (!result.discountList) {
|
|
1653
|
-
_context15.next =
|
|
1655
|
+
_context15.next = 78;
|
|
1654
1656
|
break;
|
|
1655
1657
|
}
|
|
1656
1658
|
nextDiscountList = this.mergeHistoricalDiscountList(result.discountList, tempOrder.products || []);
|
|
1657
1659
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1658
|
-
_context15.next =
|
|
1660
|
+
_context15.next = 77;
|
|
1659
1661
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1660
|
-
case
|
|
1662
|
+
case 77:
|
|
1661
1663
|
tempOrder.discount_list = nextDiscountList.filter(function (discount) {
|
|
1662
1664
|
return discount.isSelected;
|
|
1663
1665
|
});
|
|
1664
|
-
case
|
|
1665
|
-
_context15.next =
|
|
1666
|
+
case 78:
|
|
1667
|
+
_context15.next = 80;
|
|
1666
1668
|
return this.store.order.recalculateSummary({
|
|
1667
1669
|
createIfMissing: true
|
|
1668
1670
|
});
|
|
1669
|
-
case
|
|
1671
|
+
case 80:
|
|
1670
1672
|
summary = _context15.sent;
|
|
1671
1673
|
this.store.order.persistTempOrder();
|
|
1672
|
-
_context15.next =
|
|
1674
|
+
_context15.next = 84;
|
|
1673
1675
|
return this.effectsEmit('onDiscountApplied', {
|
|
1674
1676
|
productList: tempOrder.products || [],
|
|
1675
1677
|
discountList: nextDiscountList,
|
|
1676
1678
|
selectedDiscountList: tempOrder.discount_list || [],
|
|
1677
1679
|
tempOrder: tempOrder
|
|
1678
1680
|
});
|
|
1679
|
-
case
|
|
1681
|
+
case 84:
|
|
1680
1682
|
return _context15.abrupt("return", {
|
|
1681
1683
|
productList: tempOrder.products || [],
|
|
1682
1684
|
discountList: nextDiscountList
|
|
1683
1685
|
});
|
|
1684
|
-
case
|
|
1686
|
+
case 85:
|
|
1685
1687
|
case "end":
|
|
1686
1688
|
return _context15.stop();
|
|
1687
1689
|
}
|
|
1688
|
-
}, _callee15, this, [[
|
|
1690
|
+
}, _callee15, this, [[47, 66, 69, 72]]);
|
|
1689
1691
|
}));
|
|
1690
1692
|
function loadDiscountConfig(_x10) {
|
|
1691
1693
|
return _loadDiscountConfig.apply(this, arguments);
|
|
@@ -1697,7 +1699,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1697
1699
|
value: function () {
|
|
1698
1700
|
var _bestDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(cb) {
|
|
1699
1701
|
var _discountModule$getOr2, _discountModule$getDi3;
|
|
1700
|
-
var tempOrder, orderStore, discountModule, rulesModule, originalDiscountList, currentDiscountList, nextDiscountList, result, _tempOrder$
|
|
1702
|
+
var tempOrder, orderStore, discountModule, rulesModule, originalDiscountList, currentDiscountList, nextDiscountList, result, _tempOrder$holder2, _orderStore$summary2, holders, orderTotalAmount;
|
|
1701
1703
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1702
1704
|
while (1) switch (_context16.prev = _context16.next) {
|
|
1703
1705
|
case 0:
|
|
@@ -1722,31 +1724,33 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1722
1724
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1723
1725
|
case 12:
|
|
1724
1726
|
if (!rulesModule) {
|
|
1725
|
-
_context16.next =
|
|
1727
|
+
_context16.next = 25;
|
|
1726
1728
|
break;
|
|
1727
1729
|
}
|
|
1728
|
-
holders = (_tempOrder$
|
|
1729
|
-
|
|
1730
|
-
|
|
1730
|
+
holders = ((_tempOrder$holder2 = tempOrder.holder) === null || _tempOrder$holder2 === void 0 ? void 0 : _tempOrder$holder2.form_record) || [];
|
|
1731
|
+
orderTotalAmount = Number(((_orderStore$summary2 = orderStore.summary) === null || _orderStore$summary2 === void 0 ? void 0 : _orderStore$summary2.total_amount) || 0);
|
|
1732
|
+
console.log('[BaseSales.bestDiscount.calcDiscount]');
|
|
1731
1733
|
result = rulesModule.calcDiscount({
|
|
1732
1734
|
productList: tempOrder.products,
|
|
1733
1735
|
discountList: nextDiscountList,
|
|
1734
1736
|
holders: holders,
|
|
1735
|
-
isFormSubject:
|
|
1736
|
-
|
|
1737
|
+
isFormSubject: function isFormSubject(product) {
|
|
1738
|
+
return resolveIsFormSubject(tempOrder, product);
|
|
1739
|
+
},
|
|
1740
|
+
orderTotalAmount: orderTotalAmount
|
|
1737
1741
|
}) || result;
|
|
1738
1742
|
if (result.productList) {
|
|
1739
1743
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
1740
1744
|
}
|
|
1741
1745
|
if (!result.discountList) {
|
|
1742
|
-
_context16.next =
|
|
1746
|
+
_context16.next = 25;
|
|
1743
1747
|
break;
|
|
1744
1748
|
}
|
|
1745
1749
|
nextDiscountList = this.mergeHistoricalDiscountList(result.discountList, tempOrder.products || []);
|
|
1746
1750
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1747
|
-
_context16.next =
|
|
1751
|
+
_context16.next = 23;
|
|
1748
1752
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1749
|
-
case
|
|
1753
|
+
case 23:
|
|
1750
1754
|
tempOrder.discount_list = nextDiscountList.filter(function (discount) {
|
|
1751
1755
|
return discount.isSelected;
|
|
1752
1756
|
});
|
|
@@ -1754,16 +1758,16 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1754
1758
|
productList: tempOrder.products,
|
|
1755
1759
|
discountList: nextDiscountList
|
|
1756
1760
|
};
|
|
1757
|
-
case
|
|
1758
|
-
_context16.next =
|
|
1761
|
+
case 25:
|
|
1762
|
+
_context16.next = 27;
|
|
1759
1763
|
return this.store.order.recalculateSummary({
|
|
1760
1764
|
createIfMissing: true
|
|
1761
1765
|
});
|
|
1762
|
-
case
|
|
1766
|
+
case 27:
|
|
1763
1767
|
this.store.order.persistTempOrder();
|
|
1764
1768
|
cb === null || cb === void 0 || cb(result);
|
|
1765
1769
|
return _context16.abrupt("return", result);
|
|
1766
|
-
case
|
|
1770
|
+
case 30:
|
|
1767
1771
|
case "end":
|
|
1768
1772
|
return _context16.stop();
|
|
1769
1773
|
}
|
|
@@ -1834,7 +1838,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1834
1838
|
key: "setDiscountSelected",
|
|
1835
1839
|
value: function () {
|
|
1836
1840
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
|
|
1837
|
-
var _tempOrder$
|
|
1841
|
+
var _tempOrder$holder3, list, updated, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds, _iterator2, _step2, d, selectedResourceIds, _iterator3, _step3, _product$metadata8, _tempOrder$_extend4, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
|
|
1838
1842
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1839
1843
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1840
1844
|
case 0:
|
|
@@ -1857,19 +1861,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1857
1861
|
orderStore = this.store.order.store || {};
|
|
1858
1862
|
discountModule = orderStore.discount;
|
|
1859
1863
|
rulesModule = orderStore.rules;
|
|
1860
|
-
holders = (_tempOrder$
|
|
1861
|
-
form_record_id: tempOrder.holder.form_record_id
|
|
1862
|
-
}] : [];
|
|
1864
|
+
holders = ((_tempOrder$holder3 = tempOrder.holder) === null || _tempOrder$holder3 === void 0 ? void 0 : _tempOrder$holder3.form_record) || [];
|
|
1863
1865
|
nextDiscountList = updated;
|
|
1864
1866
|
_context18.next = 14;
|
|
1865
1867
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
|
|
1866
1868
|
case 14:
|
|
1867
1869
|
if (rulesModule) {
|
|
1870
|
+
orderTotalAmount = Number(((_orderStore$summary3 = orderStore.summary) === null || _orderStore$summary3 === void 0 ? void 0 : _orderStore$summary3.total_amount) || 0);
|
|
1871
|
+
console.log('[BaseSales.setDiscountSelected.calcDiscount]');
|
|
1868
1872
|
result = rulesModule.calcDiscount({
|
|
1869
1873
|
productList: tempOrder.products,
|
|
1870
1874
|
discountList: updated,
|
|
1871
1875
|
holders: holders,
|
|
1872
|
-
isFormSubject:
|
|
1876
|
+
isFormSubject: function isFormSubject(product) {
|
|
1877
|
+
return resolveIsFormSubject(tempOrder, product);
|
|
1878
|
+
},
|
|
1879
|
+
orderTotalAmount: orderTotalAmount
|
|
1873
1880
|
}, {
|
|
1874
1881
|
discountId: params.discountId,
|
|
1875
1882
|
isSelected: params.isSelected
|
|
@@ -2261,7 +2268,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2261
2268
|
value: function () {
|
|
2262
2269
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(params) {
|
|
2263
2270
|
var _ref18, _params$businessCode, _this$otherParams18, _this$otherParams19, _params$channel;
|
|
2264
|
-
var businessCode, channel, syncParams, syncState, payments, syncResult;
|
|
2271
|
+
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
2265
2272
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2266
2273
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2267
2274
|
case 0:
|
|
@@ -2299,21 +2306,38 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2299
2306
|
return this.store.order.syncPaymentsToOrder(syncParams);
|
|
2300
2307
|
case 14:
|
|
2301
2308
|
syncResult = _context24.sent;
|
|
2302
|
-
|
|
2303
|
-
|
|
2309
|
+
latestPayments = this.store.order.getOrderPayments();
|
|
2310
|
+
amountSnapshot = this.store.order.getOrderAmountSnapshot();
|
|
2311
|
+
orderSnapshot = this.store.order.getOrderSnapshot();
|
|
2312
|
+
syncPayload = {
|
|
2304
2313
|
ok: true,
|
|
2305
2314
|
syncResult: syncResult,
|
|
2306
|
-
payments:
|
|
2315
|
+
payments: latestPayments,
|
|
2307
2316
|
params: syncParams,
|
|
2308
|
-
amountSnapshot:
|
|
2309
|
-
orderSnapshot:
|
|
2310
|
-
|
|
2311
|
-
|
|
2317
|
+
amountSnapshot: amountSnapshot,
|
|
2318
|
+
orderSnapshot: orderSnapshot,
|
|
2319
|
+
isFullyPaid: syncResult.isFullyPaid,
|
|
2320
|
+
isOrderFullyPaid: syncResult.isOrderFullyPaid,
|
|
2321
|
+
isDepositFullyPaid: syncResult.isDepositFullyPaid,
|
|
2322
|
+
paymentStage: syncResult.paymentStage,
|
|
2323
|
+
depositAmount: syncResult.depositAmount,
|
|
2324
|
+
orderExpectedAmount: syncResult.orderExpectedAmount
|
|
2325
|
+
};
|
|
2326
|
+
_context24.next = 21;
|
|
2327
|
+
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, syncPayload);
|
|
2328
|
+
case 21:
|
|
2329
|
+
if (!(syncResult.isDepositFullyPaid && !syncResult.isOrderFullyPaid)) {
|
|
2330
|
+
_context24.next = 24;
|
|
2331
|
+
break;
|
|
2332
|
+
}
|
|
2333
|
+
_context24.next = 24;
|
|
2334
|
+
return this.effectsEmit(BaseSalesHookNames.onDepositPaymentSyncEnd, syncPayload);
|
|
2335
|
+
case 24:
|
|
2312
2336
|
return _context24.abrupt("return", syncResult);
|
|
2313
|
-
case
|
|
2314
|
-
_context24.prev =
|
|
2337
|
+
case 27:
|
|
2338
|
+
_context24.prev = 27;
|
|
2315
2339
|
_context24.t0 = _context24["catch"](11);
|
|
2316
|
-
_context24.next =
|
|
2340
|
+
_context24.next = 31;
|
|
2317
2341
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, {
|
|
2318
2342
|
ok: false,
|
|
2319
2343
|
error: _context24.t0,
|
|
@@ -2322,13 +2346,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2322
2346
|
amountSnapshot: this.store.order.getOrderAmountSnapshot(),
|
|
2323
2347
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
2324
2348
|
});
|
|
2325
|
-
case
|
|
2349
|
+
case 31:
|
|
2326
2350
|
throw _context24.t0;
|
|
2327
|
-
case
|
|
2351
|
+
case 32:
|
|
2328
2352
|
case "end":
|
|
2329
2353
|
return _context24.stop();
|
|
2330
2354
|
}
|
|
2331
|
-
}, _callee24, this, [[11,
|
|
2355
|
+
}, _callee24, this, [[11, 27]]);
|
|
2332
2356
|
}));
|
|
2333
2357
|
function syncPaymentsToOrder(_x20) {
|
|
2334
2358
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
@@ -2393,7 +2417,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2393
2417
|
var amountSnapshot = this.store.order.getOrderAmountSnapshot();
|
|
2394
2418
|
var syncState = this.store.order.getOrderSyncState();
|
|
2395
2419
|
if (amountSnapshot && syncState !== 'submitting') {
|
|
2396
|
-
var
|
|
2420
|
+
var completion = this.store.order.getPaymentCompletion(payments);
|
|
2421
|
+
var paymentStatus = completion.isOrderFullyPaid ? 'paid' : 'partially_paid';
|
|
2397
2422
|
void this.syncPaymentsToOrder({
|
|
2398
2423
|
payments: payments,
|
|
2399
2424
|
paymentStatus: paymentStatus,
|
|
@@ -14,6 +14,7 @@ export declare const BaseSalesHookNames: {
|
|
|
14
14
|
readonly onCartValidationChanged: "onCartValidationChanged";
|
|
15
15
|
readonly onPaymentSyncStart: "onPaymentSyncStart";
|
|
16
16
|
readonly onPaymentSyncEnd: "onPaymentSyncEnd";
|
|
17
|
+
readonly onDepositPaymentSyncEnd: "onDepositPaymentSyncEnd";
|
|
17
18
|
};
|
|
18
19
|
export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
|
|
19
20
|
export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
|
|
@@ -9,7 +9,8 @@ export var BaseSalesHookNames = {
|
|
|
9
9
|
onRefresh: 'onRefresh',
|
|
10
10
|
onCartValidationChanged: 'onCartValidationChanged',
|
|
11
11
|
onPaymentSyncStart: 'onPaymentSyncStart',
|
|
12
|
-
onPaymentSyncEnd: 'onPaymentSyncEnd'
|
|
12
|
+
onPaymentSyncEnd: 'onPaymentSyncEnd',
|
|
13
|
+
onDepositPaymentSyncEnd: 'onDepositPaymentSyncEnd'
|
|
13
14
|
};
|
|
14
15
|
export function createBaseSalesHook(moduleName, hookName) {
|
|
15
16
|
return "".concat(moduleName, ":").concat(hookName);
|
|
@@ -105,7 +105,9 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
105
105
|
var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
|
|
106
106
|
var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
|
|
107
107
|
var sourceProductPrice = toPriceString((_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref22 !== void 0 ? _ref22 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref21 !== void 0 ? _ref21 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref20 !== void 0 ? _ref20 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref17 !== void 0 ? _ref17 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
|
|
108
|
-
var
|
|
108
|
+
var explicitLineTotal = (_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total;
|
|
109
|
+
var hasExplicitLineTotal = Number.isFinite(Number(explicitLineTotal));
|
|
110
|
+
var lineCompositeTotal = toPriceString(explicitLineTotal, sourceProductPrice);
|
|
109
111
|
var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
|
|
110
112
|
var productOptionItem = normalizeProductSkuOptions(normalizeOptionItems((_ref24 = (_ref25 = (_payload$product_sku$ = (_payload$product_sku = payload.product_sku) === null || _payload$product_sku === void 0 ? void 0 : _payload$product_sku.option) !== null && _payload$product_sku$ !== void 0 ? _payload$product_sku$ : payload.option) !== null && _ref25 !== void 0 ? _ref25 : payload.options) !== null && _ref24 !== void 0 ? _ref24 : payload.product_option_item));
|
|
111
113
|
var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle, hasPriceOverride);
|
|
@@ -148,7 +150,7 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
148
150
|
mainPrice: 0,
|
|
149
151
|
bundle: productBundle
|
|
150
152
|
});
|
|
151
|
-
var derivedMainSelling = Number(lineCompositeTotal) - Number(bundleOnlyComposite);
|
|
153
|
+
var derivedMainSelling = hasExplicitLineTotal ? Number(lineCompositeTotal) - Number(bundleOnlyComposite) : Number(mainProductOriginalPrice);
|
|
152
154
|
var mainProductSellingPrice = toPriceString(Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice));
|
|
153
155
|
var metadata = _objectSpread(_objectSpread({
|
|
154
156
|
unique: payload.unique,
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 2 | 6 | 3 | 4 | 5;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
package/lib/core/index.js
CHANGED