@pisell/pisellos 0.0.510 → 0.0.512
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/Order/index.d.ts +3 -6
- package/dist/modules/Order/index.js +129 -62
- package/dist/modules/Order/types.d.ts +23 -5
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils.d.ts +64 -11
- package/dist/modules/Order/utils.js +269 -43
- package/dist/modules/SalesSummary/utils.js +33 -68
- package/dist/modules/Summary/utils.js +6 -21
- package/dist/solution/ScanOrder/index.d.ts +10 -5
- package/dist/solution/ScanOrder/index.js +605 -492
- package/dist/solution/ScanOrder/types.d.ts +43 -2
- package/dist/solution/ScanOrder/types.js +13 -0
- package/dist/solution/ScanOrder/utils.d.ts +26 -12
- package/dist/solution/ScanOrder/utils.js +130 -82
- package/dist/solution/VenueBooking/index.d.ts +2 -5
- package/dist/solution/VenueBooking/index.js +35 -27
- package/lib/modules/Order/index.d.ts +3 -6
- package/lib/modules/Order/index.js +98 -24
- package/lib/modules/Order/types.d.ts +23 -5
- package/lib/modules/Order/utils.d.ts +64 -11
- package/lib/modules/Order/utils.js +167 -15
- package/lib/modules/SalesSummary/utils.js +13 -47
- package/lib/modules/Summary/utils.js +4 -18
- package/lib/solution/ScanOrder/index.d.ts +10 -5
- package/lib/solution/ScanOrder/index.js +60 -4
- package/lib/solution/ScanOrder/types.d.ts +43 -2
- package/lib/solution/ScanOrder/utils.d.ts +26 -12
- package/lib/solution/ScanOrder/utils.js +76 -68
- package/lib/solution/VenueBooking/index.d.ts +2 -5
- package/lib/solution/VenueBooking/index.js +13 -6
- package/package.json +1 -1
|
@@ -1244,7 +1244,7 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
/** 勾选/取消勾选某张折扣券,重新计算折扣并持久化 */
|
|
1246
1246
|
async setDiscountSelected(params) {
|
|
1247
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1247
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1248
1248
|
this.logMethodStart("setDiscountSelected", params);
|
|
1249
1249
|
try {
|
|
1250
1250
|
if (!this.store.order)
|
|
@@ -1311,11 +1311,18 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1311
1311
|
(sum, pd) => sum + (pd.amount || 0),
|
|
1312
1312
|
0
|
|
1313
1313
|
);
|
|
1314
|
-
const
|
|
1315
|
-
product.
|
|
1314
|
+
const optionSum = (0, import_utils3.sumOptionUnitPrice)(product.product_option_item);
|
|
1315
|
+
const sourcePrice = ((_d = product.metadata) == null ? void 0 : _d.source_product_price) ?? (((_e = product.metadata) == null ? void 0 : _e.main_product_original_price) != null ? new import_decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? "0");
|
|
1316
|
+
const newSourceSellingPrice = new import_decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
1317
|
+
const newMainSellingPrice = new import_decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
1316
1318
|
if (product.metadata) {
|
|
1317
|
-
product.metadata.main_product_selling_price =
|
|
1319
|
+
product.metadata.main_product_selling_price = newMainSellingPrice;
|
|
1320
|
+
product.metadata.price_schema_version = 2;
|
|
1318
1321
|
}
|
|
1322
|
+
product.selling_price = (0, import_utils3.composeLinePrice)({
|
|
1323
|
+
mainPrice: newMainSellingPrice,
|
|
1324
|
+
bundle: product.product_bundle
|
|
1325
|
+
});
|
|
1319
1326
|
}
|
|
1320
1327
|
import_Order.OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1321
1328
|
await (discountModule == null ? void 0 : discountModule.setDiscountList(nextDiscountList));
|
|
@@ -1323,8 +1330,8 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1323
1330
|
const afterApplyTarget = this.store.order.getDiscountList().find((d) => d.id === params.discountId) || null;
|
|
1324
1331
|
await this.store.order.recalculateSummary({ createIfMissing: true });
|
|
1325
1332
|
this.store.order.persistTempOrder();
|
|
1326
|
-
const finalSummary = ((
|
|
1327
|
-
const finalProduct = ((
|
|
1333
|
+
const finalSummary = ((_f = this.store.order.getTempOrder()) == null ? void 0 : _f.summary) || null;
|
|
1334
|
+
const finalProduct = ((_h = (_g = this.store.order.getTempOrder()) == null ? void 0 : _g.products) == null ? void 0 : _h[0]) || null;
|
|
1328
1335
|
this.logMethodSuccess("setDiscountSelected", params);
|
|
1329
1336
|
const finalTarget = this.store.order.getDiscountList().find((d) => d.id === params.discountId) || null;
|
|
1330
1337
|
return this.store.order.getDiscountList();
|