@pisell/pisellos 2.3.193 → 2.3.194
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/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/OpenData/types.d.ts +3 -0
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +76 -61
- package/dist/solution/BaseSales/index.d.ts +3 -0
- package/dist/solution/BaseSales/index.js +45 -36
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/index.js +35 -25
- package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
- package/dist/utils/pos-receipt-auto-print.js +14 -0
- package/lib/modules/OpenData/types.d.ts +3 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/server/index.d.ts +2 -0
- package/lib/server/index.js +17 -6
- package/lib/solution/BaseSales/index.d.ts +3 -0
- package/lib/solution/BaseSales/index.js +11 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/index.js +7 -0
- package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
- package/lib/utils/pos-receipt-auto-print.js +13 -0
- package/package.json +1 -1
|
@@ -56,6 +56,7 @@ import dayjs from 'dayjs';
|
|
|
56
56
|
export * from "./types";
|
|
57
57
|
import { isProductQueryHandledByOsServer, PRODUCT_QUERY_DATA_VARIANT_RELATIONS, resolveClientDataVariants, tryResolveClientDataVariants } from "../../modules/ProductList/clientDataVariants";
|
|
58
58
|
import { isCustomerUserPlatform, normalizeRuntimePlatform } from "../../utils/platform";
|
|
59
|
+
import { OS_POS_RECEIPT_AUTO_PRINT_PAYMENT_STATUSES_FIELD } from "../../utils/pos-receipt-auto-print";
|
|
59
60
|
import { QuotationModule } from "../../modules/Quotation";
|
|
60
61
|
import { transformBaseProductToOrderProduct as _transformBaseProductToOrderProduct } from "./utils/transformBaseProductToOrderProduct";
|
|
61
62
|
import { calculateBaseSalesProductBookingPrice } from "./utils/quotationPrice";
|
|
@@ -2121,18 +2122,26 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2121
2122
|
return undefined;
|
|
2122
2123
|
}
|
|
2123
2124
|
}
|
|
2125
|
+
|
|
2126
|
+
/** Only solutions with a current POS business configuration opt into this receipt policy. */
|
|
2127
|
+
}, {
|
|
2128
|
+
key: "getPosReceiptAutoPrintPaymentStatuses",
|
|
2129
|
+
value: function getPosReceiptAutoPrintPaymentStatuses() {
|
|
2130
|
+
return undefined;
|
|
2131
|
+
}
|
|
2124
2132
|
}, {
|
|
2125
2133
|
key: "buildSubmitPayloadEnhancerWithOpenDataConfig",
|
|
2126
2134
|
value: function buildSubmitPayloadEnhancerWithOpenDataConfig(enhancePayload) {
|
|
2127
2135
|
var fulfillmentRefMode = this.getFulfillmentRefMode();
|
|
2128
2136
|
var invoiceLayoutConfig = this.getCachedInvoiceLayoutConfig();
|
|
2129
2137
|
var invoiceTemplateSettings = this.getCachedInvoiceTemplateSettings();
|
|
2130
|
-
|
|
2138
|
+
var receiptPaymentStatuses = this.getPosReceiptAutoPrintPaymentStatuses();
|
|
2139
|
+
if (!fulfillmentRefMode && !invoiceLayoutConfig && !invoiceTemplateSettings && receiptPaymentStatuses === undefined) {
|
|
2131
2140
|
return enhancePayload;
|
|
2132
2141
|
}
|
|
2133
2142
|
return function (payload, ctx) {
|
|
2134
2143
|
var enhancedPayload = enhancePayload ? enhancePayload(payload, ctx) : payload;
|
|
2135
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, enhancedPayload), fulfillmentRefMode ? _defineProperty({}, OS_FULFILLMENT_REF_MODE_FIELD, fulfillmentRefMode) : {}), invoiceLayoutConfig ? _defineProperty({}, OS_INVOICE_LAYOUT_CONFIG_FIELD, cloneDeep(invoiceLayoutConfig)) : {}), invoiceTemplateSettings ? _defineProperty({}, OS_INVOICE_TEMPLATE_SETTINGS_FIELD, cloneDeep(invoiceTemplateSettings)) : {});
|
|
2144
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, enhancedPayload), fulfillmentRefMode ? _defineProperty({}, OS_FULFILLMENT_REF_MODE_FIELD, fulfillmentRefMode) : {}), invoiceLayoutConfig ? _defineProperty({}, OS_INVOICE_LAYOUT_CONFIG_FIELD, cloneDeep(invoiceLayoutConfig)) : {}), invoiceTemplateSettings ? _defineProperty({}, OS_INVOICE_TEMPLATE_SETTINGS_FIELD, cloneDeep(invoiceTemplateSettings)) : {}), receiptPaymentStatuses !== undefined ? _defineProperty({}, OS_POS_RECEIPT_AUTO_PRINT_PAYMENT_STATUSES_FIELD, _toConsumableArray(receiptPaymentStatuses)) : {});
|
|
2136
2145
|
};
|
|
2137
2146
|
}
|
|
2138
2147
|
|
|
@@ -2246,22 +2255,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2246
2255
|
value: (function () {
|
|
2247
2256
|
var _syncOtherParamsToSubModules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(changedParams) {
|
|
2248
2257
|
var _this14 = this;
|
|
2249
|
-
var
|
|
2250
|
-
|
|
2258
|
+
var _ref33,
|
|
2259
|
+
_ref33$cover,
|
|
2251
2260
|
cover,
|
|
2252
2261
|
_args17 = arguments;
|
|
2253
2262
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
2254
2263
|
while (1) switch (_context17.prev = _context17.next) {
|
|
2255
2264
|
case 0:
|
|
2256
|
-
|
|
2265
|
+
_ref33 = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {}, _ref33$cover = _ref33.cover, cover = _ref33$cover === void 0 ? false : _ref33$cover;
|
|
2257
2266
|
_context17.next = 3;
|
|
2258
2267
|
return Promise.all(Object.entries(this.store).map( /*#__PURE__*/function () {
|
|
2259
|
-
var
|
|
2260
|
-
var
|
|
2268
|
+
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref34) {
|
|
2269
|
+
var _ref36, moduleName, subModule, targetModule, nextSubModuleOtherParams;
|
|
2261
2270
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
2262
2271
|
while (1) switch (_context16.prev = _context16.next) {
|
|
2263
2272
|
case 0:
|
|
2264
|
-
|
|
2273
|
+
_ref36 = _slicedToArray(_ref34, 2), moduleName = _ref36[0], subModule = _ref36[1];
|
|
2265
2274
|
if (!_this14.reusedSharedSubModuleNames.has(moduleName)) {
|
|
2266
2275
|
_context16.next = 3;
|
|
2267
2276
|
break;
|
|
@@ -2290,7 +2299,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2290
2299
|
}, _callee16);
|
|
2291
2300
|
}));
|
|
2292
2301
|
return function (_x15) {
|
|
2293
|
-
return
|
|
2302
|
+
return _ref35.apply(this, arguments);
|
|
2294
2303
|
};
|
|
2295
2304
|
}()));
|
|
2296
2305
|
case 3:
|
|
@@ -2424,10 +2433,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2424
2433
|
}
|
|
2425
2434
|
tempOrder.metadata = tempOrder.metadata || {};
|
|
2426
2435
|
if (shouldManageLegalCurrencySnapshot) {
|
|
2427
|
-
var
|
|
2436
|
+
var _ref37, _ref38, _tempOrder$metadata$l, _ref39, _ref40, _tempOrder$metadata$l2, _tempOrder$metadata$l3;
|
|
2428
2437
|
var legalCurrencySnapshot = {
|
|
2429
|
-
currency_code: String((
|
|
2430
|
-
currency_symbol: String((
|
|
2438
|
+
currency_code: String((_ref37 = (_ref38 = currencyCode !== null && currencyCode !== void 0 ? currencyCode : (_tempOrder$metadata$l = tempOrder.metadata.legal_currency_snapshot) === null || _tempOrder$metadata$l === void 0 ? void 0 : _tempOrder$metadata$l.currency_code) !== null && _ref38 !== void 0 ? _ref38 : tempOrder.currency_code) !== null && _ref37 !== void 0 ? _ref37 : ''),
|
|
2439
|
+
currency_symbol: String((_ref39 = (_ref40 = currencySymbol !== null && currencySymbol !== void 0 ? currencySymbol : (_tempOrder$metadata$l2 = tempOrder.metadata.legal_currency_snapshot) === null || _tempOrder$metadata$l2 === void 0 ? void 0 : _tempOrder$metadata$l2.currency_symbol) !== null && _ref40 !== void 0 ? _ref40 : tempOrder.currency_symbol) !== null && _ref39 !== void 0 ? _ref39 : ''),
|
|
2431
2440
|
currency_format: String(((_tempOrder$metadata$l3 = tempOrder.metadata.legal_currency_snapshot) === null || _tempOrder$metadata$l3 === void 0 ? void 0 : _tempOrder$metadata$l3.currency_format) || (isVirtualSettlement ? 'symbol_first' : tempOrder.currency_format) || 'symbol_first')
|
|
2432
2441
|
};
|
|
2433
2442
|
if (JSON.stringify(tempOrder.metadata.legal_currency_snapshot || {}) !== JSON.stringify(legalCurrencySnapshot)) {
|
|
@@ -2659,7 +2668,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2659
2668
|
key: "loadSalesDetail",
|
|
2660
2669
|
value: (function () {
|
|
2661
2670
|
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(orderIdOrParams) {
|
|
2662
|
-
var loadSequence,
|
|
2671
|
+
var loadSequence, _ref41, _ref42, _ref43, _ref44, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, loadedSalesDetail, shouldFilterPendingPayments, remoteRecord, mergeSourceRecord, currentTempOrder, mergedRecord, record;
|
|
2663
2672
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
2664
2673
|
while (1) switch (_context20.prev = _context20.next) {
|
|
2665
2674
|
case 0:
|
|
@@ -2677,7 +2686,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2677
2686
|
};
|
|
2678
2687
|
externalSaleNumber = params.externalSaleNumber || params.external_sale_number;
|
|
2679
2688
|
preloadedSalesDetail = params.preloadedSalesDetail;
|
|
2680
|
-
lookup = (
|
|
2689
|
+
lookup = (_ref41 = (_ref42 = (_ref43 = (_ref44 = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : externalSaleNumber) !== null && _ref44 !== void 0 ? _ref44 : params.orderNumber) !== null && _ref43 !== void 0 ? _ref43 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_id) !== null && _ref42 !== void 0 ? _ref42 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.external_sale_number) !== null && _ref41 !== void 0 ? _ref41 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_number;
|
|
2681
2690
|
if (!(!preloadedSalesDetail && (lookup === undefined || lookup === null || lookup === ''))) {
|
|
2682
2691
|
_context20.next = 11;
|
|
2683
2692
|
break;
|
|
@@ -3643,9 +3652,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3643
3652
|
}, {
|
|
3644
3653
|
key: "getDiscountConfigOrderIdentityKey",
|
|
3645
3654
|
value: function getDiscountConfigOrderIdentityKey(tempOrder) {
|
|
3646
|
-
var _this$store$order12, _this$store$order12$g,
|
|
3655
|
+
var _this$store$order12, _this$store$order12$g, _ref45, _identity$orderId, _tempOrder$request_un, _ref46, _identity$externalSal, _ref47, _ref48, _identity$localId, _tempOrder$_extend3;
|
|
3647
3656
|
var identity = (_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getOrderIdentity) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.call(_this$store$order12);
|
|
3648
|
-
return JSON.stringify([(
|
|
3657
|
+
return JSON.stringify([(_ref45 = (_identity$orderId = identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _identity$orderId !== void 0 ? _identity$orderId : tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _ref45 !== void 0 ? _ref45 : '', (_tempOrder$request_un = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.request_unique_idempotency_token) !== null && _tempOrder$request_un !== void 0 ? _tempOrder$request_un : '', (_ref46 = (_identity$externalSal = identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) !== null && _identity$externalSal !== void 0 ? _identity$externalSal : tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) !== null && _ref46 !== void 0 ? _ref46 : '', (_ref47 = (_ref48 = (_identity$localId = identity === null || identity === void 0 ? void 0 : identity.localId) !== null && _identity$localId !== void 0 ? _identity$localId : tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.localId) !== null && _ref48 !== void 0 ? _ref48 : this.cacheId) !== null && _ref47 !== void 0 ? _ref47 : '']);
|
|
3649
3658
|
}
|
|
3650
3659
|
}, {
|
|
3651
3660
|
key: "loadDiscountConfig",
|
|
@@ -3755,7 +3764,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3755
3764
|
key: discountConfigCacheKey,
|
|
3756
3765
|
epoch: requestEpoch,
|
|
3757
3766
|
promise: prepareConfigPromise.then( /*#__PURE__*/function () {
|
|
3758
|
-
var
|
|
3767
|
+
var _ref49 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(discountList) {
|
|
3759
3768
|
var _discountModule$setOr;
|
|
3760
3769
|
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
3761
3770
|
while (1) switch (_context35.prev = _context35.next) {
|
|
@@ -3780,7 +3789,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3780
3789
|
}, _callee35);
|
|
3781
3790
|
}));
|
|
3782
3791
|
return function (_x24) {
|
|
3783
|
-
return
|
|
3792
|
+
return _ref49.apply(this, arguments);
|
|
3784
3793
|
};
|
|
3785
3794
|
}())
|
|
3786
3795
|
};
|
|
@@ -4452,10 +4461,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4452
4461
|
product.discount_list = filterSelectedDiscountDetails(product.discount_list);
|
|
4453
4462
|
if (Array.isArray(product.product_bundle)) {
|
|
4454
4463
|
product.product_bundle = product.product_bundle.map(function (bundle) {
|
|
4455
|
-
var
|
|
4464
|
+
var _ref50, _bundle$original_pric;
|
|
4456
4465
|
var nextBundleDiscountList = filterSelectedDiscountDetails(bundle === null || bundle === void 0 ? void 0 : bundle.discount_list);
|
|
4457
4466
|
var shouldRestoreBundlePrice = nextBundleDiscountList.length === 0;
|
|
4458
|
-
var restoredBundlePrice = (
|
|
4467
|
+
var restoredBundlePrice = (_ref50 = (_bundle$original_pric = bundle === null || bundle === void 0 ? void 0 : bundle.original_price) !== null && _bundle$original_pric !== void 0 ? _bundle$original_pric : bundle === null || bundle === void 0 ? void 0 : bundle.product_price) !== null && _ref50 !== void 0 ? _ref50 : bundle === null || bundle === void 0 ? void 0 : bundle.price;
|
|
4459
4468
|
return _objectSpread(_objectSpread(_objectSpread({}, bundle), shouldRestoreBundlePrice ? {
|
|
4460
4469
|
price: restoredBundlePrice,
|
|
4461
4470
|
bundle_selling_price: restoredBundlePrice
|
|
@@ -5330,7 +5339,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5330
5339
|
key: "syncPaymentsToOrder",
|
|
5331
5340
|
value: function () {
|
|
5332
5341
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(params) {
|
|
5333
|
-
var
|
|
5342
|
+
var _ref51, _params$businessCode, _this$otherParams38, _this$otherParams39, _params$channel2;
|
|
5334
5343
|
var businessCode, channel, enhancePayload, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
5335
5344
|
return _regeneratorRuntime().wrap(function _callee50$(_context50) {
|
|
5336
5345
|
while (1) switch (_context50.prev = _context50.next) {
|
|
@@ -5341,7 +5350,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5341
5350
|
}
|
|
5342
5351
|
throw new Error('order 模块未初始化');
|
|
5343
5352
|
case 2:
|
|
5344
|
-
businessCode = (
|
|
5353
|
+
businessCode = (_ref51 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams38 = this.otherParams) === null || _this$otherParams38 === void 0 ? void 0 : _this$otherParams38.businessCode) !== null && _ref51 !== void 0 ? _ref51 : (_this$otherParams39 = this.otherParams) === null || _this$otherParams39 === void 0 ? void 0 : _this$otherParams39.business_code;
|
|
5345
5354
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
5346
5355
|
enhancePayload = this.buildSubmitPayloadEnhancerWithOpenDataConfig(params.enhancePayload);
|
|
5347
5356
|
syncParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -5606,7 +5615,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5606
5615
|
var _this$otherParams40,
|
|
5607
5616
|
_paymentRecord$paymen,
|
|
5608
5617
|
_paymentRecord$create,
|
|
5609
|
-
|
|
5618
|
+
_ref52,
|
|
5610
5619
|
_paymentRecord$origin,
|
|
5611
5620
|
_this22 = this;
|
|
5612
5621
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
@@ -5628,7 +5637,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5628
5637
|
var paymentTime = (_paymentRecord$paymen = paymentRecord.payment_time) !== null && _paymentRecord$paymen !== void 0 ? _paymentRecord$paymen : paymentTimestamp;
|
|
5629
5638
|
var createdAt = (_paymentRecord$create = paymentRecord.created_at) !== null && _paymentRecord$create !== void 0 ? _paymentRecord$create : paymentTimestamp;
|
|
5630
5639
|
var serviceCharge = paymentRecord.service_charge && _typeof(paymentRecord.service_charge) === 'object' ? paymentRecord.service_charge : null;
|
|
5631
|
-
var calculatedServiceFee = serviceCharge ? new Decimal((
|
|
5640
|
+
var calculatedServiceFee = serviceCharge ? new Decimal((_ref52 = (_paymentRecord$origin = paymentRecord.origin_amount) !== null && _paymentRecord$origin !== void 0 ? _paymentRecord$origin : paymentRecord.amount) !== null && _ref52 !== void 0 ? _ref52 : 0).times(serviceCharge.percentage || 0).plus(serviceCharge.amount || 0).toDecimalPlaces(2).toFixed(2) : undefined;
|
|
5632
5641
|
var payments = this.store.order.addOrderPayment(_objectSpread(_objectSpread(_objectSpread({}, normalizedPaymentRecord), calculatedServiceFee !== undefined ? {
|
|
5633
5642
|
service_fee: calculatedServiceFee
|
|
5634
5643
|
} : {}), {}, {
|
|
@@ -5913,7 +5922,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5913
5922
|
}, {
|
|
5914
5923
|
key: "buildWalletInitBusinessData",
|
|
5915
5924
|
value: function buildWalletInitBusinessData(params) {
|
|
5916
|
-
var _this$store$order22, _params$order_wait_pa,
|
|
5925
|
+
var _this$store$order22, _params$order_wait_pa, _ref53, _tempOrder$is_price_i;
|
|
5917
5926
|
var snapshot = (_this$store$order22 = this.store.order) === null || _this$store$order22 === void 0 ? void 0 : _this$store$order22.getOrderSnapshot();
|
|
5918
5927
|
var tempOrder = snapshot === null || snapshot === void 0 ? void 0 : snapshot.tempOrder;
|
|
5919
5928
|
var amount = snapshot === null || snapshot === void 0 ? void 0 : snapshot.amount;
|
|
@@ -5929,7 +5938,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5929
5938
|
},
|
|
5930
5939
|
products: this.getWalletProductList(),
|
|
5931
5940
|
order_wait_pay_amount: (_params$order_wait_pa = params === null || params === void 0 ? void 0 : params.order_wait_pay_amount) !== null && _params$order_wait_pa !== void 0 ? _params$order_wait_pa : Number(amount.amountGap || 0),
|
|
5932
|
-
is_price_include_tax: (
|
|
5941
|
+
is_price_include_tax: (_ref53 = (_tempOrder$is_price_i = tempOrder.is_price_include_tax) !== null && _tempOrder$is_price_i !== void 0 ? _tempOrder$is_price_i : this.otherParams.is_price_include_tax) !== null && _ref53 !== void 0 ? _ref53 : 1
|
|
5933
5942
|
}, snapshot.identity.orderId ? {
|
|
5934
5943
|
payment_order_id: String(snapshot.identity.orderId)
|
|
5935
5944
|
} : {});
|
|
@@ -6023,9 +6032,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6023
6032
|
var walletPassName = fundRecord.wallet_pass_name;
|
|
6024
6033
|
var title = walletPassName && _typeof(walletPassName) === 'object' ? walletPassName.default || Object.values(walletPassName)[0] : walletPassName;
|
|
6025
6034
|
var code = String((payment === null || payment === void 0 ? void 0 : payment.code) || '').toUpperCase();
|
|
6026
|
-
var tag = ((_Object$entries$find = Object.entries(WALLET_PAYMENT_CODE_BY_TAG).find(function (
|
|
6027
|
-
var
|
|
6028
|
-
paymentCode =
|
|
6035
|
+
var tag = ((_Object$entries$find = Object.entries(WALLET_PAYMENT_CODE_BY_TAG).find(function (_ref54) {
|
|
6036
|
+
var _ref55 = _slicedToArray(_ref54, 2),
|
|
6037
|
+
paymentCode = _ref55[1];
|
|
6029
6038
|
return paymentCode === code;
|
|
6030
6039
|
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]) || fundRecord.tag;
|
|
6031
6040
|
return {
|
|
@@ -7141,7 +7150,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7141
7150
|
key: "sendCustomerPayLink",
|
|
7142
7151
|
value: (function () {
|
|
7143
7152
|
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(params) {
|
|
7144
|
-
var orderIds,
|
|
7153
|
+
var orderIds, _ref56, _ref57, _submitResult$data$or, _submitResult$data, _submitResult$data2, submitResult, orderId;
|
|
7145
7154
|
return _regeneratorRuntime().wrap(function _callee70$(_context70) {
|
|
7146
7155
|
while (1) switch (_context70.prev = _context70.next) {
|
|
7147
7156
|
case 0:
|
|
@@ -7162,7 +7171,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7162
7171
|
});
|
|
7163
7172
|
case 6:
|
|
7164
7173
|
submitResult = _context70.sent;
|
|
7165
|
-
orderId = (
|
|
7174
|
+
orderId = (_ref56 = (_ref57 = (_submitResult$data$or = submitResult === null || submitResult === void 0 || (_submitResult$data = submitResult.data) === null || _submitResult$data === void 0 ? void 0 : _submitResult$data.order_id) !== null && _submitResult$data$or !== void 0 ? _submitResult$data$or : submitResult === null || submitResult === void 0 ? void 0 : submitResult.order_id) !== null && _ref57 !== void 0 ? _ref57 : submitResult === null || submitResult === void 0 || (_submitResult$data2 = submitResult.data) === null || _submitResult$data2 === void 0 ? void 0 : _submitResult$data2.id) !== null && _ref56 !== void 0 ? _ref56 : submitResult === null || submitResult === void 0 ? void 0 : submitResult.id;
|
|
7166
7175
|
if (orderId) {
|
|
7167
7176
|
_context70.next = 10;
|
|
7168
7177
|
break;
|
|
@@ -7387,7 +7396,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7387
7396
|
});
|
|
7388
7397
|
_context74.next = 7;
|
|
7389
7398
|
return forEachPriceQueryGroup(Array.from(groups.values()), /*#__PURE__*/function () {
|
|
7390
|
-
var
|
|
7399
|
+
var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(group) {
|
|
7391
7400
|
var priceQueries, resolvedProducts;
|
|
7392
7401
|
return _regeneratorRuntime().wrap(function _callee73$(_context73) {
|
|
7393
7402
|
while (1) switch (_context73.prev = _context73.next) {
|
|
@@ -7418,7 +7427,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7418
7427
|
}, _callee73);
|
|
7419
7428
|
}));
|
|
7420
7429
|
return function (_x61) {
|
|
7421
|
-
return
|
|
7430
|
+
return _ref58.apply(this, arguments);
|
|
7422
7431
|
};
|
|
7423
7432
|
}(), normalizeRuntimePlatform((_this$otherParams43 = this.otherParams) === null || _this$otherParams43 === void 0 ? void 0 : _this$otherParams43.platform) === 'pos' ? 4 : groups.size);
|
|
7424
7433
|
case 7:
|
|
@@ -8015,15 +8024,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
8015
8024
|
value: function () {
|
|
8016
8025
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(params) {
|
|
8017
8026
|
var _this$otherParams46;
|
|
8018
|
-
var
|
|
8019
|
-
|
|
8027
|
+
var _ref59,
|
|
8028
|
+
_ref59$cover,
|
|
8020
8029
|
cover,
|
|
8021
8030
|
previousPickupTimingScope,
|
|
8022
8031
|
_args85 = arguments;
|
|
8023
8032
|
return _regeneratorRuntime().wrap(function _callee85$(_context85) {
|
|
8024
8033
|
while (1) switch (_context85.prev = _context85.next) {
|
|
8025
8034
|
case 0:
|
|
8026
|
-
|
|
8035
|
+
_ref59 = _args85.length > 1 && _args85[1] !== undefined ? _args85[1] : {}, _ref59$cover = _ref59.cover, cover = _ref59$cover === void 0 ? false : _ref59$cover;
|
|
8027
8036
|
previousPickupTimingScope = this.getPickupTimingScope();
|
|
8028
8037
|
if (cover) {
|
|
8029
8038
|
this.otherParams = _objectSpread({}, params);
|
|
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
328
328
|
date: string;
|
|
329
329
|
status: string;
|
|
330
330
|
week: string;
|
|
331
|
-
weekNum: 0 |
|
|
331
|
+
weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
332
332
|
}[]>;
|
|
333
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
334
334
|
private getScheduleDataByIds;
|
|
@@ -10,6 +10,7 @@ import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAva
|
|
|
10
10
|
import type { BusinessAvailability } from '../../modules/BusinessAvailability';
|
|
11
11
|
import { BookingTicket } from '../BookingTicket';
|
|
12
12
|
import type { BaseSalesSubmitSalesOrderParams } from '../BaseSales/types';
|
|
13
|
+
import { type PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
|
|
13
14
|
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
14
15
|
export * from './types';
|
|
15
16
|
export * from './salesSettings';
|
|
@@ -224,6 +225,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
224
225
|
clearOpenDataCache(): void;
|
|
225
226
|
getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
|
|
226
227
|
getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
|
|
228
|
+
protected getPosReceiptAutoPrintPaymentStatuses(): PosReceiptAutoPrintPaymentStatus[] | undefined;
|
|
227
229
|
protected isInvoiceOpenDataCacheCurrent(): boolean;
|
|
228
230
|
/**
|
|
229
231
|
* Load a resource policy without depending on the legacy appointmentBooking solution.
|
|
@@ -57,6 +57,7 @@ import { activeVenueMenus, createVenueCatalogSessionAdapter, productMatchesVenue
|
|
|
57
57
|
import { BookingTicket } from "../BookingTicket";
|
|
58
58
|
import { addLocalCalendarDays, captureRuntimeOffsetMinutes, extractFixedOffsetMinutes, formatLocalDate, formatLocalDateTime, formatLocalTime, localDateTimeToScalar, localDateToScalar, localDateToScalarStart, parseLocalDate, parseLocalDateTime } from "../../modules/ResourcePlanner/localClock";
|
|
59
59
|
import { isCustomerUserPlatform, isSelfServicePlatform, normalizeRuntimePlatform } from "../../utils/platform";
|
|
60
|
+
import { normalizePosReceiptAutoPrintPaymentStatuses } from "../../utils/pos-receipt-auto-print";
|
|
60
61
|
import { ItemRuleEvaluator } from "../../model/strategy/adapter/itemRule";
|
|
61
62
|
export * from "./types";
|
|
62
63
|
export * from "./salesSettings";
|
|
@@ -3596,12 +3597,21 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
3596
3597
|
}
|
|
3597
3598
|
return getInvoiceTemplateSettings;
|
|
3598
3599
|
}()
|
|
3600
|
+
}, {
|
|
3601
|
+
key: "getPosReceiptAutoPrintPaymentStatuses",
|
|
3602
|
+
value: function getPosReceiptAutoPrintPaymentStatuses() {
|
|
3603
|
+
var _this$otherParams35, _this$runtimeOpenData;
|
|
3604
|
+
var platform = normalizeRuntimePlatform((_this$otherParams35 = this.otherParams) === null || _this$otherParams35 === void 0 ? void 0 : _this$otherParams35.platform);
|
|
3605
|
+
if (platform !== 'pos' && platform !== 'webpos') return undefined;
|
|
3606
|
+
if (!this.isInvoiceOpenDataCacheCurrent() || this.runtimeOpenDataModule !== this.store.openData || this.runtimeOpenDataCore !== this.core) return undefined;
|
|
3607
|
+
return normalizePosReceiptAutoPrintPaymentStatuses((_this$runtimeOpenData = this.runtimeOpenDataSnapshot) === null || _this$runtimeOpenData === void 0 ? void 0 : _this$runtimeOpenData['documents.pos_receipt_auto_print_payment_statuses']);
|
|
3608
|
+
}
|
|
3599
3609
|
}, {
|
|
3600
3610
|
key: "isInvoiceOpenDataCacheCurrent",
|
|
3601
3611
|
value: function isInvoiceOpenDataCacheCurrent() {
|
|
3602
|
-
var _this$
|
|
3603
|
-
var businessCode = String(((_this$
|
|
3604
|
-
var channel = String(((_this$
|
|
3612
|
+
var _this$otherParams36, _this$otherParams37;
|
|
3613
|
+
var businessCode = String(((_this$otherParams36 = this.otherParams) === null || _this$otherParams36 === void 0 ? void 0 : _this$otherParams36.businessCode) || '').trim();
|
|
3614
|
+
var channel = String(((_this$otherParams37 = this.otherParams) === null || _this$otherParams37 === void 0 ? void 0 : _this$otherParams37.channel) || '').trim();
|
|
3605
3615
|
if (!businessCode || !channel) return false;
|
|
3606
3616
|
return this.openDataTarget === "".concat(businessCode, "+").concat(channel) && this.runtimeOpenDataScope === this.getRuntimeOpenDataScope();
|
|
3607
3617
|
}
|
|
@@ -4037,10 +4047,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4037
4047
|
}, {
|
|
4038
4048
|
key: "createVenueCatalogSession",
|
|
4039
4049
|
value: function createVenueCatalogSession(params) {
|
|
4040
|
-
var _this$
|
|
4050
|
+
var _this$otherParams38,
|
|
4041
4051
|
_params$sessionKey,
|
|
4042
4052
|
_this14 = this;
|
|
4043
|
-
if (!isCustomerUserPlatform((_this$
|
|
4053
|
+
if (!isCustomerUserPlatform((_this$otherParams38 = this.otherParams) === null || _this$otherParams38 === void 0 ? void 0 : _this$otherParams38.platform)) {
|
|
4044
4054
|
throw venueCatalogError('VENUE_CATALOG_PLATFORM_UNSUPPORTED', 'Venue catalog sessions require a customer platform.');
|
|
4045
4055
|
}
|
|
4046
4056
|
var ids = params.menu_list_ids;
|
|
@@ -4460,7 +4470,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4460
4470
|
key: "loadCatalogProductDetail",
|
|
4461
4471
|
value: function () {
|
|
4462
4472
|
var _loadCatalogProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params, loadSnapshot) {
|
|
4463
|
-
var _this$
|
|
4473
|
+
var _this$otherParams39, _this$core$server, _this$core$server$has, _this$otherParams40, _this$otherParams41, _this$otherParams$bus4, _this$otherParams42, _this$otherParams43, _this$core$getPlugin, _this$core3, _this$core$getPlugin$, _this$otherParams44, _response$data$item2, _response$data4, _raw$id3, _this$store$products, _this$store$products$;
|
|
4464
4474
|
var _cloneDeep2, product_id, _ignoredIds, catalogParams, schedule_date, schedule_datetime, scopedParams, member, baseUrl, localPath, handledByOsServer, channelMap, channel, businessCode, strategy_context, customerId, queryPayload, response, raw, resolved, detail, _i2, _arr2, key;
|
|
4465
4475
|
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
4466
4476
|
while (1) switch (_context41.prev = _context41.next) {
|
|
@@ -4490,7 +4500,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4490
4500
|
}
|
|
4491
4501
|
return _context41.abrupt("return", undefined);
|
|
4492
4502
|
case 11:
|
|
4493
|
-
baseUrl = String(this.request.baseUrl || (isCustomerUserPlatform((_this$
|
|
4503
|
+
baseUrl = String(this.request.baseUrl || (isCustomerUserPlatform((_this$otherParams39 = this.otherParams) === null || _this$otherParams39 === void 0 ? void 0 : _this$otherParams39.platform) ? '/h5' : '/shop')).replace(/\/+$/, '');
|
|
4494
4504
|
localPath = "/product/query/".concat(product_id);
|
|
4495
4505
|
handledByOsServer = ((_this$core$server = this.core.server) === null || _this$core$server === void 0 || (_this$core$server$has = _this$core$server.hasRoute) === null || _this$core$server$has === void 0 ? void 0 : _this$core$server$has.call(_this$core$server, 'get', "".concat(baseUrl).concat(localPath))) === true;
|
|
4496
4506
|
channelMap = {
|
|
@@ -4500,8 +4510,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4500
4510
|
scan_to_order_2: 'online-store',
|
|
4501
4511
|
scan_to_order_3: 'scantoorder3'
|
|
4502
4512
|
};
|
|
4503
|
-
channel = channelMap[(_this$
|
|
4504
|
-
businessCode = (_this$otherParams$bus4 = (_this$
|
|
4513
|
+
channel = channelMap[(_this$otherParams40 = this.otherParams) === null || _this$otherParams40 === void 0 ? void 0 : _this$otherParams40.channel] || ((_this$otherParams41 = this.otherParams) === null || _this$otherParams41 === void 0 ? void 0 : _this$otherParams41.channel);
|
|
4514
|
+
businessCode = (_this$otherParams$bus4 = (_this$otherParams42 = this.otherParams) === null || _this$otherParams42 === void 0 ? void 0 : _this$otherParams42.businessCode) !== null && _this$otherParams$bus4 !== void 0 ? _this$otherParams$bus4 : (_this$otherParams43 = this.otherParams) === null || _this$otherParams43 === void 0 ? void 0 : _this$otherParams43.business_code;
|
|
4505
4515
|
strategy_context = _objectSpread(_objectSpread(_objectSpread({}, channel ? {
|
|
4506
4516
|
channel: channel
|
|
4507
4517
|
} : {}), businessCode ? {
|
|
@@ -4517,7 +4527,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4517
4527
|
open_bundle: 1,
|
|
4518
4528
|
with_schedule: 1,
|
|
4519
4529
|
with: _toConsumableArray(PRODUCT_QUERY_DATA_VARIANT_RELATIONS)
|
|
4520
|
-
}, isCustomerUserPlatform((_this$
|
|
4530
|
+
}, isCustomerUserPlatform((_this$otherParams44 = this.otherParams) === null || _this$otherParams44 === void 0 ? void 0 : _this$otherParams44.platform) ? {} : {
|
|
4521
4531
|
open_quotation: 1
|
|
4522
4532
|
});
|
|
4523
4533
|
_context41.next = 23;
|
|
@@ -5036,10 +5046,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
5036
5046
|
}, {
|
|
5037
5047
|
key: "buildUnifiedOrderProduct",
|
|
5038
5048
|
value: function buildUnifiedOrderProduct(sourceProduct, ownershipKey, product) {
|
|
5039
|
-
var _sourceProduct$_exten, _this$
|
|
5049
|
+
var _sourceProduct$_exten, _this$otherParams45, _bookingQuote$pricing, _ref50, _sourceProduct$_exten2, _sourceProduct$_exten3, _sourceProduct$metada, _sourceProduct$id, _ref51, _sourceProduct$produc, _ref52, _ref53, _sourceProduct$quanti, _sourceProduct$price, _ref54, _ref55, _sourceProduct$sellin;
|
|
5040
5050
|
var normalizedProductRaw = (product === null || product === void 0 ? void 0 : product.raw) || {};
|
|
5041
5051
|
var bookingQuote = (_sourceProduct$_exten = sourceProduct._extend) === null || _sourceProduct$_exten === void 0 ? void 0 : _sourceProduct$_exten.bookingPriceQuote;
|
|
5042
|
-
var isPos = normalizeRuntimePlatform((_this$
|
|
5052
|
+
var isPos = normalizeRuntimePlatform((_this$otherParams45 = this.otherParams) === null || _this$otherParams45 === void 0 ? void 0 : _this$otherParams45.platform) === 'pos';
|
|
5043
5053
|
var quoteMethod = isPos ? bookingQuote === null || bookingQuote === void 0 || (_bookingQuote$pricing = bookingQuote.pricing_method) === null || _bookingQuote$pricing === void 0 ? void 0 : _bookingQuote$pricing.type : undefined;
|
|
5044
5054
|
var hasDurationQuote = quoteMethod === 'duration_based';
|
|
5045
5055
|
var quoteSourcePrice = bookingQuote === null || bookingQuote === void 0 ? void 0 : bookingQuote.sourceUnitPrice;
|
|
@@ -5783,7 +5793,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
5783
5793
|
value: (function () {
|
|
5784
5794
|
var _queryBookingResourceDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(params) {
|
|
5785
5795
|
var _this19 = this,
|
|
5786
|
-
_this$
|
|
5796
|
+
_this$otherParams46;
|
|
5787
5797
|
var date, resourceIds, core, request, generation, scope, assertCurrent, resourceQuery, timezone, resources, byId;
|
|
5788
5798
|
return _regeneratorRuntime().wrap(function _callee53$(_context53) {
|
|
5789
5799
|
while (1) switch (_context53.prev = _context53.next) {
|
|
@@ -5833,7 +5843,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
5833
5843
|
resourceIds: resourceIds
|
|
5834
5844
|
}; // Match normalizeAvailabilityPrepareDescriptor so confirmation reuses exactly
|
|
5835
5845
|
// the same resource/date coverage as the selection projection.
|
|
5836
|
-
timezone = String(((_this$
|
|
5846
|
+
timezone = String(((_this$otherParams46 = this.otherParams) === null || _this$otherParams46 === void 0 ? void 0 : _this$otherParams46.businessTimezone) || Intl.DateTimeFormat().resolvedOptions().timeZone || 'Asia/Shanghai').trim();
|
|
5837
5847
|
if (!this.isVenueCatalogLocalPricingActive()) {
|
|
5838
5848
|
_context53.next = 27;
|
|
5839
5849
|
break;
|
|
@@ -6962,7 +6972,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6962
6972
|
value: (function () {
|
|
6963
6973
|
var _getProductTimeRanges = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(contextId) {
|
|
6964
6974
|
var _this$otherParams$pla3,
|
|
6965
|
-
_this$
|
|
6975
|
+
_this$otherParams47,
|
|
6966
6976
|
_context$prepareParam2,
|
|
6967
6977
|
_extractFixedOffsetMi3,
|
|
6968
6978
|
_this26 = this;
|
|
@@ -6995,7 +7005,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6995
7005
|
projectionEntry = _yield$this$ensureAva.projectionEntry;
|
|
6996
7006
|
contextVersion = context.activeVersion;
|
|
6997
7007
|
strictAvailability = context.prepareParams.strictAvailability === true;
|
|
6998
|
-
isPosAvailabilityRequest = String((_this$otherParams$pla3 = (_this$
|
|
7008
|
+
isPosAvailabilityRequest = String((_this$otherParams$pla3 = (_this$otherParams47 = this.otherParams) === null || _this$otherParams47 === void 0 ? void 0 : _this$otherParams47.platform) !== null && _this$otherParams$pla3 !== void 0 ? _this$otherParams$pla3 : '').trim().toLowerCase() === 'pos';
|
|
6999
7009
|
isEditingContext = Boolean((_context$prepareParam2 = context.prepareParams.editingProductLineUids) === null || _context$prepareParam2 === void 0 ? void 0 : _context$prepareParam2.length);
|
|
7000
7010
|
editingOffset = (_extractFixedOffsetMi3 = extractFixedOffsetMinutes(projectionEntry.projection.meta.now)) !== null && _extractFixedOffsetMi3 !== void 0 ? _extractFixedOffsetMi3 : this.getAvailabilityRuntimeOffsetMinutes(); // This new editing input represents an absolute instant. Normalize it once
|
|
7001
7011
|
// to the projection's fixed business clock before the wall-clock planner.
|
|
@@ -7068,7 +7078,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7068
7078
|
key: "queryBookingAvailability",
|
|
7069
7079
|
value: (function () {
|
|
7070
7080
|
var _queryBookingAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(contextId, request) {
|
|
7071
|
-
var _this$otherParams$pla4, _this$
|
|
7081
|
+
var _this$otherParams$pla4, _this$otherParams48, _context$prepareParam3;
|
|
7072
7082
|
var _yield$this$ensureAva2, context, projectionEntry, refreshed, strictAvailability, isPosAvailabilityRequest, rememberedTimeByProductId, queryRequest, result, contextVersion, contextualResult;
|
|
7073
7083
|
return _regeneratorRuntime().wrap(function _callee66$(_context66) {
|
|
7074
7084
|
while (1) switch (_context66.prev = _context66.next) {
|
|
@@ -7082,7 +7092,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7082
7092
|
refreshed = _yield$this$ensureAva2.refreshed;
|
|
7083
7093
|
this.assertContextualQueryFreshness(context, request);
|
|
7084
7094
|
strictAvailability = context.prepareParams.strictAvailability === true;
|
|
7085
|
-
isPosAvailabilityRequest = String((_this$otherParams$pla4 = (_this$
|
|
7095
|
+
isPosAvailabilityRequest = String((_this$otherParams$pla4 = (_this$otherParams48 = this.otherParams) === null || _this$otherParams48 === void 0 ? void 0 : _this$otherParams48.platform) !== null && _this$otherParams$pla4 !== void 0 ? _this$otherParams$pla4 : '').trim().toLowerCase() === 'pos';
|
|
7086
7096
|
rememberedTimeByProductId = request.selectionIntent === 'remembered' ? this.resolveOrderRememberedTimes(context, projectionEntry.projection, request.rememberedTimeByProductId, request.orderSessionId) : undefined;
|
|
7087
7097
|
queryRequest = request.target === 'date' || request.target === 'product' ? _objectSpread(_objectSpread({}, request), {}, {
|
|
7088
7098
|
dateRange: request.dateRange || this.getAvailabilityBusinessDateRange(projectionEntry.projection)
|
|
@@ -7215,14 +7225,14 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7215
7225
|
value: function () {
|
|
7216
7226
|
var _removeBookingProductsOutsideStartDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(startDate) {
|
|
7217
7227
|
var _this$getTempOrder5,
|
|
7218
|
-
_this$
|
|
7228
|
+
_this$otherParams49,
|
|
7219
7229
|
_this27 = this;
|
|
7220
7230
|
var products, targetDate, identities;
|
|
7221
7231
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
|
7222
7232
|
while (1) switch (_context67.prev = _context67.next) {
|
|
7223
7233
|
case 0:
|
|
7224
7234
|
products = ((_this$getTempOrder5 = this.getTempOrder()) === null || _this$getTempOrder5 === void 0 ? void 0 : _this$getTempOrder5.products) || [];
|
|
7225
|
-
if (!(((_this$
|
|
7235
|
+
if (!(((_this$otherParams49 = this.otherParams) === null || _this$otherParams49 === void 0 ? void 0 : _this$otherParams49.enforceSingleBookingStartDate) !== true)) {
|
|
7226
7236
|
_context67.next = 3;
|
|
7227
7237
|
break;
|
|
7228
7238
|
}
|
|
@@ -7262,13 +7272,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7262
7272
|
value: (function () {
|
|
7263
7273
|
var _commitAvailabilitySelection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(contextId, params) {
|
|
7264
7274
|
var _this$otherParams$pla5,
|
|
7265
|
-
_this$
|
|
7275
|
+
_this$otherParams50,
|
|
7266
7276
|
_this$availabilityCon,
|
|
7267
7277
|
_params$availabilityC3,
|
|
7268
7278
|
_this$store$order11,
|
|
7269
7279
|
_this$store$order11$e,
|
|
7270
7280
|
_this28 = this;
|
|
7271
|
-
var normalizedContextId, isEditingSelection, isPartyReplacement, isRememberedSelection, isOrderRememberedSelection, strictAvailability, hasCommitGuard, rememberedOrder, getRememberedCommitIdentity, rememberedCommitIdentity, availabilityCommitTargetGuard, guardedCommitPublished, _params$bookingCount, _ref65, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _this$otherParams$pla6, _this$
|
|
7281
|
+
var normalizedContextId, isEditingSelection, isPartyReplacement, isRememberedSelection, isOrderRememberedSelection, strictAvailability, hasCommitGuard, rememberedOrder, getRememberedCommitIdentity, rememberedCommitIdentity, availabilityCommitTargetGuard, guardedCommitPublished, _params$bookingCount, _ref65, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _this$otherParams$pla6, _this$otherParams51, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla7, _this$otherParams52, _params$orderProduct$3, _params$orderProduct6, _existingBooking$hold, _existingBooking$meta, _ref66, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$meta3, _existingBooking$hold2, _params$orderProduct9, _transformed$metadata, _nextContext$activeVe, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, selectedProduct, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, candidateDurationMinutes, candidateStartTime, allowPosAvailabilityOverride, candidateBusinessDate, rememberedTimeByProductId, refreshedRanges, refreshedCandidateBase, product, validation, forced, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, availabilityCommitGuard, existingBooking, existingBookingUid, booking, legacyBooking, legacyResources, selectedResources, resourceKeys, transformed, productLineUid, bookingUid, productLineUids, bookingUids, relatedRetailProducts, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref67, _transformed$product_4, _this$getTempOrder6, _this$getTempOrder7, _params$salesNotes, _params$salesNotes2, _ref68, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, targetStillCurrent, nextContext, result, emit, release;
|
|
7272
7282
|
return _regeneratorRuntime().wrap(function _callee68$(_context68) {
|
|
7273
7283
|
while (1) switch (_context68.prev = _context68.next) {
|
|
7274
7284
|
case 0:
|
|
@@ -7291,7 +7301,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7291
7301
|
case 7:
|
|
7292
7302
|
isRememberedSelection = params.selectionIntent === 'remembered';
|
|
7293
7303
|
isOrderRememberedSelection = isRememberedSelection && params.orderSessionId !== undefined;
|
|
7294
|
-
if (!(isRememberedSelection && (String((_this$otherParams$pla5 = (_this$
|
|
7304
|
+
if (!(isRememberedSelection && (String((_this$otherParams$pla5 = (_this$otherParams50 = this.otherParams) === null || _this$otherParams50 === void 0 ? void 0 : _this$otherParams50.platform) !== null && _this$otherParams$pla5 !== void 0 ? _this$otherParams$pla5 : '').trim().toLowerCase() !== 'pos' || params.mode !== 'add'))) {
|
|
7295
7305
|
_context68.next = 11;
|
|
7296
7306
|
break;
|
|
7297
7307
|
}
|
|
@@ -7485,7 +7495,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7485
7495
|
selectedProduct = baseProjection.products.find(function (item) {
|
|
7486
7496
|
return sameAvailabilityId(item.id, params.candidate.productId);
|
|
7487
7497
|
});
|
|
7488
|
-
if (!(isRememberedSelection && (String((_this$otherParams$pla6 = (_this$
|
|
7498
|
+
if (!(isRememberedSelection && (String((_this$otherParams$pla6 = (_this$otherParams51 = this.otherParams) === null || _this$otherParams51 === void 0 ? void 0 : _this$otherParams51.platform) !== null && _this$otherParams$pla6 !== void 0 ? _this$otherParams$pla6 : '').trim().toLowerCase() !== 'pos' || params.mode !== 'add' || (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.kind) !== 'duration'))) {
|
|
7489
7499
|
_context68.next = 74;
|
|
7490
7500
|
break;
|
|
7491
7501
|
}
|
|
@@ -7548,7 +7558,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7548
7558
|
this.assertAvailabilityCommitWriteCAS(commitWriteGuard);
|
|
7549
7559
|
candidateDurationMinutes = getCandidateDurationMinutes(params.candidate);
|
|
7550
7560
|
candidateStartTime = getCandidateStartTime(params.candidate);
|
|
7551
|
-
allowPosAvailabilityOverride = String((_this$otherParams$pla7 = (_this$
|
|
7561
|
+
allowPosAvailabilityOverride = String((_this$otherParams$pla7 = (_this$otherParams52 = this.otherParams) === null || _this$otherParams52 === void 0 ? void 0 : _this$otherParams52.platform) !== null && _this$otherParams$pla7 !== void 0 ? _this$otherParams$pla7 : '').trim().toLowerCase() === 'pos' && !isRememberedSelection && !strictAvailability;
|
|
7552
7562
|
candidateBusinessDate = params.candidate.businessDate || ((selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.kind) === 'duration' && this.usesDurationTimeGrid(refreshedProjection) ? getDurationBusinessDate(refreshedProjection, params.candidate.startAt) : params.candidate.startAt.slice(0, 10));
|
|
7553
7563
|
rememberedTimeByProductId = isOrderRememberedSelection ? this.resolveOrderRememberedTimes(context, refreshedProjection, _defineProperty({}, String(params.candidate.productId), {
|
|
7554
7564
|
startAt: params.candidate.bookingStartAt,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const OS_POS_RECEIPT_AUTO_PRINT_PAYMENT_STATUSES_FIELD = "_os_pos_receipt_auto_print_payment_statuses";
|
|
2
|
+
export type PosReceiptAutoPrintPaymentStatus = 'paid' | 'partially_paid' | 'payment_processing';
|
|
3
|
+
/** Missing/invalid configuration preserves legacy behavior; an empty array disables auto receipts. */
|
|
4
|
+
export declare function normalizePosReceiptAutoPrintPaymentStatuses(value: unknown): PosReceiptAutoPrintPaymentStatus[] | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
export var OS_POS_RECEIPT_AUTO_PRINT_PAYMENT_STATUSES_FIELD = '_os_pos_receipt_auto_print_payment_statuses';
|
|
8
|
+
/** Missing/invalid configuration preserves legacy behavior; an empty array disables auto receipts. */
|
|
9
|
+
export function normalizePosReceiptAutoPrintPaymentStatuses(value) {
|
|
10
|
+
if (!Array.isArray(value)) return undefined;
|
|
11
|
+
return _toConsumableArray(new Set(value.filter(function (status) {
|
|
12
|
+
return status === 'paid' || status === 'partially_paid' || status === 'payment_processing';
|
|
13
|
+
})));
|
|
14
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ScheduleItem } from '../Schedule/types';
|
|
2
|
+
import type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
|
|
3
|
+
export type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
|
|
2
4
|
export interface MultiLangObject {
|
|
3
5
|
en?: string;
|
|
4
6
|
ja?: string;
|
|
@@ -126,6 +128,7 @@ export interface OpenDataConfig {
|
|
|
126
128
|
}>;
|
|
127
129
|
'documents.invoice_template'?: string | number;
|
|
128
130
|
'documents.invoice_edit'?: RawInvoiceEditConfig;
|
|
131
|
+
'documents.pos_receipt_auto_print_payment_statuses'?: PosReceiptAutoPrintPaymentStatus[];
|
|
129
132
|
/** @deprecated 仅保留旧调用方的类型兼容,Invoice 读取逻辑不再消费该字段。 */
|
|
130
133
|
'documents.invoice'?: RawInvoiceLayoutConfig;
|
|
131
134
|
/** @deprecated Invoice 读取逻辑只消费扁平的 documents.invoice_* 字段。 */
|
|
@@ -637,7 +637,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
637
637
|
generateIdempotencyToken(): string;
|
|
638
638
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
639
639
|
createOrder(params: CommitOrderParams['query']): {
|
|
640
|
-
type: "
|
|
640
|
+
type: "appointment_booking" | "virtual";
|
|
641
641
|
platform: string;
|
|
642
642
|
sales_channel: string;
|
|
643
643
|
order_sales_channel: string;
|
|
@@ -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(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
package/lib/server/index.d.ts
CHANGED
|
@@ -563,6 +563,8 @@ declare class Server {
|
|
|
563
563
|
* Android 结账自动小票由当前设备设置控制;其它平台保持原有行为。
|
|
564
564
|
*/
|
|
565
565
|
private shouldAutoPrintCheckoutReceipt;
|
|
566
|
+
/** Only receipt auto-printing uses this policy; vouchers retain their paid-order gate. */
|
|
567
|
+
private shouldAutoPrintReceiptForPaymentStatus;
|
|
566
568
|
private shouldBuildSmallTicketData;
|
|
567
569
|
private shouldPrintSyncedOrder;
|
|
568
570
|
private hasPaymentStatus;
|