@pisell/pisellos 2.2.198 → 2.2.199
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/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +7 -3
- package/dist/modules/Cart/utils/cartProduct.js +11 -1
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Order/index.js +155 -104
- package/dist/modules/Order/types.d.ts +1 -0
- package/dist/modules/Order/utils.d.ts +33 -2
- package/dist/modules/Order/utils.js +112 -55
- package/dist/modules/SalesSummary/utils.js +97 -63
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +294 -190
- package/dist/server/modules/order/index.d.ts +8 -0
- package/dist/server/modules/order/index.js +536 -317
- package/dist/server/modules/order/types.d.ts +2 -0
- package/dist/solution/BaseSales/index.js +2 -1
- package/dist/solution/BaseSales/types.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +19 -4
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/ScanOrder/types.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +26 -9
- package/dist/solution/VenueBooking/index.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +4 -1
- package/lib/modules/Cart/utils/cartProduct.js +11 -1
- package/lib/modules/Cart/utils/changePrice.js +12 -20
- package/lib/modules/Order/index.js +58 -6
- package/lib/modules/Order/types.d.ts +1 -0
- package/lib/modules/Order/utils.d.ts +33 -2
- package/lib/modules/Order/utils.js +44 -9
- package/lib/modules/SalesSummary/utils.js +41 -44
- package/lib/server/index.d.ts +3 -0
- package/lib/server/index.js +82 -3
- package/lib/server/modules/order/index.d.ts +8 -0
- package/lib/server/modules/order/index.js +106 -4
- package/lib/server/modules/order/types.d.ts +2 -0
- package/lib/solution/BaseSales/index.js +2 -1
- package/lib/solution/BaseSales/types.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +15 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/ScanOrder/types.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +28 -10
- package/lib/solution/VenueBooking/index.js +2 -1
- package/package.json +1 -1
|
@@ -75,6 +75,7 @@ function createEmptySummary() {
|
|
|
75
75
|
shipping_tax_fee: "0.00",
|
|
76
76
|
tax_fee: "0.00",
|
|
77
77
|
surcharge_fee: "0.00",
|
|
78
|
+
surcharges: [],
|
|
78
79
|
discount_amount: "0.00",
|
|
79
80
|
deposit_amount: "0.00",
|
|
80
81
|
expect_amount: "0.00",
|
|
@@ -436,16 +437,33 @@ function normalizeOrderProduct(product) {
|
|
|
436
437
|
};
|
|
437
438
|
});
|
|
438
439
|
}
|
|
439
|
-
const normalizedBundle = bundleInput.map((item) =>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
440
|
+
const normalizedBundle = bundleInput.map((item) => {
|
|
441
|
+
const magnitudeSource = {
|
|
442
|
+
...item,
|
|
443
|
+
// 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
|
|
444
|
+
// helper 会按历史净额兜底,避免 option 二次扣减。
|
|
445
|
+
price: item.price ?? item.custom_price
|
|
446
|
+
};
|
|
447
|
+
const normalizedItem = {
|
|
448
|
+
...item,
|
|
449
|
+
bundle_id: item.bundle_id ?? item.id,
|
|
450
|
+
bundle_product_id: item.bundle_product_id ?? item._bundle_product_id,
|
|
451
|
+
bundle_group_id: item.bundle_group_id ?? item.group_id,
|
|
452
|
+
// price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
|
|
453
|
+
price: item.price ?? item.custom_price ?? item.bundle_selling_price ?? "0.00",
|
|
454
|
+
price_type: item.price_type ?? item.custom_price_type ?? "",
|
|
455
|
+
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ""
|
|
456
|
+
};
|
|
457
|
+
normalizedItem.bundle_selling_price = (0, import_utils.getBundleSellingMagnitude)(magnitudeSource).toFixed(2);
|
|
458
|
+
if (normalizedItem.price_type === "markdown" && (normalizedItem.price_type_ext === "" || normalizedItem.price_type_ext === void 0 || normalizedItem.price_type_ext === null)) {
|
|
459
|
+
normalizedItem.custom_price = normalizedItem.custom_price ?? normalizedItem.price;
|
|
460
|
+
normalizedItem.price = normalizedItem.bundle_selling_price;
|
|
461
|
+
}
|
|
462
|
+
if ((normalizedItem.price_type === "markdown" || normalizedItem.price_type === "markup") && (normalizedItem.price_type_ext === "" || normalizedItem.price_type_ext === void 0 || normalizedItem.price_type_ext === null)) {
|
|
463
|
+
delete normalizedItem.original_total;
|
|
464
|
+
}
|
|
465
|
+
return normalizedItem;
|
|
466
|
+
});
|
|
449
467
|
const normalizedOptions = (0, import_utils.normalizeProductSkuOptions)((_e = product.product_sku) == null ? void 0 : _e.option);
|
|
450
468
|
const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
|
|
451
469
|
const productSku = {
|
|
@@ -1395,7 +1395,8 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1395
1395
|
getOrderProducts() {
|
|
1396
1396
|
if (!this.store.order)
|
|
1397
1397
|
throw new Error("order 模块未初始化");
|
|
1398
|
-
|
|
1398
|
+
const products = this.store.order.getOrderProducts();
|
|
1399
|
+
return products;
|
|
1399
1400
|
}
|
|
1400
1401
|
async getSummary() {
|
|
1401
1402
|
this.logMethodStart("getSummary");
|