@pisell/pisellos 0.10.56 → 0.10.57
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/OpenData/index.js +2 -1
- package/dist/modules/Order/index.d.ts +2 -1
- package/dist/modules/Order/index.js +118 -59
- package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/dist/modules/Order/utils/weighedProduct.js +94 -0
- package/dist/modules/Order/utils.d.ts +1 -1
- package/dist/modules/Order/utils.js +9 -6
- package/dist/modules/Payment/index.d.ts +0 -5
- package/dist/modules/Payment/index.js +35 -85
- package/dist/modules/ProductList/index.js +18 -5
- package/dist/modules/ResourcePlanner/planner.js +10 -8
- package/dist/modules/Rules/index.js +16 -14
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/server/index.js +122 -69
- package/dist/server/modules/floor-plan/index.js +34 -3
- package/dist/server/modules/payment/index.d.ts +25 -6
- package/dist/server/modules/payment/index.js +660 -133
- package/dist/server/test.json +1 -1
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/dist/shared/receipt/customerInvoiceLanguages.js +60 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +5 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.js +46 -4
- package/dist/shared/receipt/small-ticket.d.ts +11 -0
- package/dist/shared/receipt/small-ticket.js +430 -255
- package/dist/shared/receipt/templateVisibility.d.ts +23 -0
- package/dist/shared/receipt/templateVisibility.js +64 -0
- package/dist/solution/BaseSales/index.d.ts +4 -2
- package/dist/solution/BaseSales/index.js +1328 -1214
- package/dist/solution/BaseSales/types.d.ts +5 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +40 -25
- package/dist/solution/BaseSales/utils.js +3 -2
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +4 -1
- package/dist/solution/BookingTicket/index.js +120 -80
- package/dist/solution/OrderInvoicePreview/index.d.ts +10 -0
- package/dist/solution/OrderInvoicePreview/index.js +85 -14
- package/dist/solution/RegisterAndLogin/config.js +54 -11
- package/dist/solution/RegisterAndLogin/index.d.ts +2 -0
- package/dist/solution/RegisterAndLogin/index.js +1 -1
- package/dist/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/dist/solution/RegisterAndLogin/utils.js +36 -16
- package/dist/solution/Sales/index.d.ts +2 -0
- package/dist/solution/Sales/index.js +15 -1
- package/dist/solution/ScanOrder/utils.js +3 -2
- package/dist/solution/UnifiedBookingSales/index.js +12 -13
- package/dist/solution/VenueBooking/index.d.ts +15 -2
- package/dist/solution/VenueBooking/index.js +1062 -785
- package/dist/solution/VenueBooking/types.d.ts +2 -1
- package/dist/solution/VenueBooking/types.js +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/dist/solution/VenueBooking/utils/smartPricing.js +273 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +6 -3
- package/lib/modules/OpenData/index.js +2 -1
- package/lib/modules/Order/index.d.ts +2 -1
- package/lib/modules/Order/index.js +71 -11
- package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/lib/modules/Order/utils/weighedProduct.js +89 -0
- package/lib/modules/Order/utils.d.ts +1 -1
- package/lib/modules/Order/utils.js +5 -3
- package/lib/modules/Payment/index.d.ts +0 -5
- package/lib/modules/Payment/index.js +3 -28
- package/lib/modules/ProductList/index.js +14 -1
- package/lib/modules/ResourcePlanner/planner.js +10 -8
- package/lib/modules/Rules/index.js +16 -14
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/server/index.js +72 -28
- package/lib/server/modules/floor-plan/index.js +29 -1
- package/lib/server/modules/payment/index.d.ts +25 -6
- package/lib/server/modules/payment/index.js +350 -78
- package/lib/server/test.json +1 -1
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/lib/shared/receipt/customerInvoiceLanguages.js +58 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +5 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.js +42 -4
- package/lib/shared/receipt/small-ticket.d.ts +11 -0
- package/lib/shared/receipt/small-ticket.js +234 -30
- package/lib/shared/receipt/templateVisibility.d.ts +23 -0
- package/lib/shared/receipt/templateVisibility.js +63 -0
- package/lib/solution/BaseSales/index.d.ts +4 -2
- package/lib/solution/BaseSales/index.js +79 -18
- package/lib/solution/BaseSales/types.d.ts +5 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -9
- package/lib/solution/BaseSales/utils.js +2 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +4 -1
- package/lib/solution/BookingTicket/index.js +14 -2
- package/lib/solution/OrderInvoicePreview/index.d.ts +10 -0
- package/lib/solution/OrderInvoicePreview/index.js +61 -7
- package/lib/solution/RegisterAndLogin/config.js +57 -11
- package/lib/solution/RegisterAndLogin/index.d.ts +2 -0
- package/lib/solution/RegisterAndLogin/index.js +9 -1
- package/lib/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/lib/solution/RegisterAndLogin/utils.js +24 -17
- package/lib/solution/Sales/index.d.ts +2 -0
- package/lib/solution/Sales/index.js +10 -1
- package/lib/solution/ScanOrder/utils.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.js +5 -6
- package/lib/solution/VenueBooking/index.d.ts +15 -2
- package/lib/solution/VenueBooking/index.js +243 -96
- package/lib/solution/VenueBooking/types.d.ts +2 -1
- package/lib/solution/VenueBooking/types.js +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/lib/solution/VenueBooking/utils/smartPricing.js +224 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +5 -2
- package/package.json +1 -1
|
@@ -182,10 +182,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
182
182
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
|
|
183
183
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshTarget", null);
|
|
184
184
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerPromotionRefreshInFlight", null);
|
|
185
|
+
_defineProperty(_assertThisInitialized(_this), "customerResolveRequests", new Map());
|
|
185
186
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlight", null);
|
|
186
187
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlightTarget", null);
|
|
187
188
|
_defineProperty(_assertThisInitialized(_this), "openDataTarget", null);
|
|
188
|
-
_defineProperty(_assertThisInitialized(_this), "customerResolveRequests", new Map());
|
|
189
189
|
return _this;
|
|
190
190
|
}
|
|
191
191
|
_createClass(BookingTicketImpl, [{
|
|
@@ -2694,8 +2694,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2694
2694
|
confirmDetail: guardCallback(bridge.confirmDetail),
|
|
2695
2695
|
confirmBookingEdit: guardCallback(bridge.confirmBookingEdit),
|
|
2696
2696
|
applyPromotionCode: guardCallback(bridge.applyPromotionCode),
|
|
2697
|
-
requestCustomerSwitch: guardCallback(bridge.requestCustomerSwitch),
|
|
2698
2697
|
openOrder: guardCallback(bridge.openOrder),
|
|
2698
|
+
requestCustomerSwitch: guardCallback(bridge.requestCustomerSwitch),
|
|
2699
2699
|
openProductDetail: bridge.openProductDetail ? function (payload) {
|
|
2700
2700
|
beforeScanDialog();
|
|
2701
2701
|
return bridge.openProductDetail(payload);
|
|
@@ -2790,6 +2790,46 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2790
2790
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
2791
2791
|
}
|
|
2792
2792
|
return handleGlobalScanCode;
|
|
2793
|
+
}() /** 查询码类型;复用原有识别和缓存,不写订单、不打开选择 UI。 */)
|
|
2794
|
+
}, {
|
|
2795
|
+
key: "getGlobalScanCodeType",
|
|
2796
|
+
value: (function () {
|
|
2797
|
+
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code) {
|
|
2798
|
+
var _this8 = this,
|
|
2799
|
+
_formatGlobalScanResu,
|
|
2800
|
+
_formatGlobalScanResu2;
|
|
2801
|
+
var trimmed, scan, raw;
|
|
2802
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2803
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2804
|
+
case 0:
|
|
2805
|
+
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
2806
|
+
if (trimmed) {
|
|
2807
|
+
_context33.next = 3;
|
|
2808
|
+
break;
|
|
2809
|
+
}
|
|
2810
|
+
return _context33.abrupt("return", null);
|
|
2811
|
+
case 3:
|
|
2812
|
+
scan = handleGlobalScan(this.request, function (value) {
|
|
2813
|
+
return _this8.store.products.findProductsByCodeOrBarcode(value);
|
|
2814
|
+
}, this.getSubmitOrderSalesChannel());
|
|
2815
|
+
_context33.next = 6;
|
|
2816
|
+
return scan({
|
|
2817
|
+
type: 'nativeScanner',
|
|
2818
|
+
value: trimmed
|
|
2819
|
+
});
|
|
2820
|
+
case 6:
|
|
2821
|
+
raw = _context33.sent;
|
|
2822
|
+
return _context33.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
|
|
2823
|
+
case 8:
|
|
2824
|
+
case "end":
|
|
2825
|
+
return _context33.stop();
|
|
2826
|
+
}
|
|
2827
|
+
}, _callee33, this);
|
|
2828
|
+
}));
|
|
2829
|
+
function getGlobalScanCodeType(_x23) {
|
|
2830
|
+
return _getGlobalScanCodeType.apply(this, arguments);
|
|
2831
|
+
}
|
|
2832
|
+
return getGlobalScanCodeType;
|
|
2793
2833
|
}())
|
|
2794
2834
|
}, {
|
|
2795
2835
|
key: "resolveBestAddTimePlan",
|
|
@@ -2868,11 +2908,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2868
2908
|
}, {
|
|
2869
2909
|
key: "addAddTimeProductToBooking",
|
|
2870
2910
|
value: (function () {
|
|
2871
|
-
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2872
|
-
return _regeneratorRuntime().wrap(function
|
|
2873
|
-
while (1) switch (
|
|
2911
|
+
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(input) {
|
|
2912
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2913
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2874
2914
|
case 0:
|
|
2875
|
-
return
|
|
2915
|
+
return _context34.abrupt("return", this.addAddTimeProductsToBooking({
|
|
2876
2916
|
booking: input.booking,
|
|
2877
2917
|
products: [input],
|
|
2878
2918
|
coveredMinutes: input.coveredMinutes,
|
|
@@ -2880,11 +2920,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2880
2920
|
}));
|
|
2881
2921
|
case 1:
|
|
2882
2922
|
case "end":
|
|
2883
|
-
return
|
|
2923
|
+
return _context34.stop();
|
|
2884
2924
|
}
|
|
2885
|
-
},
|
|
2925
|
+
}, _callee34, this);
|
|
2886
2926
|
}));
|
|
2887
|
-
function addAddTimeProductToBooking(
|
|
2927
|
+
function addAddTimeProductToBooking(_x24) {
|
|
2888
2928
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
2889
2929
|
}
|
|
2890
2930
|
return addAddTimeProductToBooking;
|
|
@@ -2902,27 +2942,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2902
2942
|
}, {
|
|
2903
2943
|
key: "addAddTimeProductsToBooking",
|
|
2904
2944
|
value: (function () {
|
|
2905
|
-
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2906
|
-
var
|
|
2945
|
+
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(input) {
|
|
2946
|
+
var _this9 = this,
|
|
2907
2947
|
_input$bookingPatch;
|
|
2908
2948
|
var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
|
|
2909
|
-
return _regeneratorRuntime().wrap(function
|
|
2910
|
-
while (1) switch (
|
|
2949
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2950
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2911
2951
|
case 0:
|
|
2912
2952
|
bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
|
|
2913
2953
|
if (bookingUid) {
|
|
2914
|
-
|
|
2954
|
+
_context35.next = 3;
|
|
2915
2955
|
break;
|
|
2916
2956
|
}
|
|
2917
2957
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
|
|
2918
2958
|
case 3:
|
|
2919
2959
|
orderLines = (input.products || []).map(function (line) {
|
|
2920
2960
|
return {
|
|
2921
|
-
product:
|
|
2961
|
+
product: _this9.buildAddTimeOrderLine(line, bookingUid)
|
|
2922
2962
|
};
|
|
2923
2963
|
});
|
|
2924
2964
|
if (this.store.order) {
|
|
2925
|
-
|
|
2965
|
+
_context35.next = 6;
|
|
2926
2966
|
break;
|
|
2927
2967
|
}
|
|
2928
2968
|
throw new Error('order 模块未初始化');
|
|
@@ -2936,55 +2976,55 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2936
2976
|
});
|
|
2937
2977
|
}
|
|
2938
2978
|
if (!(typeof this.store.order.addProductsToOrder === 'function')) {
|
|
2939
|
-
|
|
2979
|
+
_context35.next = 11;
|
|
2940
2980
|
break;
|
|
2941
2981
|
}
|
|
2942
|
-
return
|
|
2982
|
+
return _context35.abrupt("return", this.store.order.addProductsToOrder(orderLines));
|
|
2943
2983
|
case 11:
|
|
2944
2984
|
result = [];
|
|
2945
2985
|
_iterator2 = _createForOfIteratorHelper(orderLines);
|
|
2946
|
-
|
|
2986
|
+
_context35.prev = 13;
|
|
2947
2987
|
_iterator2.s();
|
|
2948
2988
|
case 15:
|
|
2949
2989
|
if ((_step2 = _iterator2.n()).done) {
|
|
2950
|
-
|
|
2990
|
+
_context35.next = 29;
|
|
2951
2991
|
break;
|
|
2952
2992
|
}
|
|
2953
2993
|
line = _step2.value;
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2994
|
+
_context35.t0 = result.splice;
|
|
2995
|
+
_context35.t1 = result;
|
|
2996
|
+
_context35.t2 = [0, result.length];
|
|
2997
|
+
_context35.t3 = _toConsumableArray;
|
|
2998
|
+
_context35.next = 23;
|
|
2959
2999
|
return this.addProductToOrder(line.product);
|
|
2960
3000
|
case 23:
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3001
|
+
_context35.t4 = _context35.sent;
|
|
3002
|
+
_context35.t5 = (0, _context35.t3)(_context35.t4);
|
|
3003
|
+
_context35.t6 = _context35.t2.concat.call(_context35.t2, _context35.t5);
|
|
3004
|
+
_context35.t0.apply.call(_context35.t0, _context35.t1, _context35.t6);
|
|
2965
3005
|
case 27:
|
|
2966
|
-
|
|
3006
|
+
_context35.next = 15;
|
|
2967
3007
|
break;
|
|
2968
3008
|
case 29:
|
|
2969
|
-
|
|
3009
|
+
_context35.next = 34;
|
|
2970
3010
|
break;
|
|
2971
3011
|
case 31:
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
_iterator2.e(
|
|
3012
|
+
_context35.prev = 31;
|
|
3013
|
+
_context35.t7 = _context35["catch"](13);
|
|
3014
|
+
_iterator2.e(_context35.t7);
|
|
2975
3015
|
case 34:
|
|
2976
|
-
|
|
3016
|
+
_context35.prev = 34;
|
|
2977
3017
|
_iterator2.f();
|
|
2978
|
-
return
|
|
3018
|
+
return _context35.finish(34);
|
|
2979
3019
|
case 37:
|
|
2980
|
-
return
|
|
3020
|
+
return _context35.abrupt("return", result);
|
|
2981
3021
|
case 38:
|
|
2982
3022
|
case "end":
|
|
2983
|
-
return
|
|
3023
|
+
return _context35.stop();
|
|
2984
3024
|
}
|
|
2985
|
-
},
|
|
3025
|
+
}, _callee35, this, [[13, 31, 34, 37]]);
|
|
2986
3026
|
}));
|
|
2987
|
-
function addAddTimeProductsToBooking(
|
|
3027
|
+
function addAddTimeProductsToBooking(_x25) {
|
|
2988
3028
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
2989
3029
|
}
|
|
2990
3030
|
return addAddTimeProductsToBooking;
|
|
@@ -2992,42 +3032,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2992
3032
|
}, {
|
|
2993
3033
|
key: "setOtherParams",
|
|
2994
3034
|
value: function () {
|
|
2995
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3035
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
|
|
2996
3036
|
var _ref19,
|
|
2997
3037
|
_ref19$cover,
|
|
2998
3038
|
cover,
|
|
2999
3039
|
invoiceContextChanged,
|
|
3000
|
-
|
|
3001
|
-
return _regeneratorRuntime().wrap(function
|
|
3002
|
-
while (1) switch (
|
|
3040
|
+
_args36 = arguments;
|
|
3041
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3042
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
3003
3043
|
case 0:
|
|
3004
|
-
_ref19 =
|
|
3005
|
-
|
|
3044
|
+
_ref19 = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
|
|
3045
|
+
_context36.next = 3;
|
|
3006
3046
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
3007
3047
|
cover: cover
|
|
3008
3048
|
});
|
|
3009
3049
|
case 3:
|
|
3010
3050
|
invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
3011
3051
|
if (!invoiceContextChanged) {
|
|
3012
|
-
|
|
3052
|
+
_context36.next = 7;
|
|
3013
3053
|
break;
|
|
3014
3054
|
}
|
|
3015
|
-
|
|
3055
|
+
_context36.next = 7;
|
|
3016
3056
|
return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
|
|
3017
3057
|
case 7:
|
|
3018
3058
|
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
|
|
3019
|
-
|
|
3059
|
+
_context36.next = 10;
|
|
3020
3060
|
break;
|
|
3021
3061
|
}
|
|
3022
|
-
|
|
3062
|
+
_context36.next = 10;
|
|
3023
3063
|
return this.configureIdGeneratorFromOpenData();
|
|
3024
3064
|
case 10:
|
|
3025
3065
|
case "end":
|
|
3026
|
-
return
|
|
3066
|
+
return _context36.stop();
|
|
3027
3067
|
}
|
|
3028
|
-
},
|
|
3068
|
+
}, _callee36, this);
|
|
3029
3069
|
}));
|
|
3030
|
-
function setOtherParams(
|
|
3070
|
+
function setOtherParams(_x26) {
|
|
3031
3071
|
return _setOtherParams.apply(this, arguments);
|
|
3032
3072
|
}
|
|
3033
3073
|
return setOtherParams;
|
|
@@ -3044,15 +3084,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3044
3084
|
}, {
|
|
3045
3085
|
key: "handlePrintWristband",
|
|
3046
3086
|
value: function () {
|
|
3047
|
-
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3087
|
+
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(params) {
|
|
3048
3088
|
var _this$getOrderIdentit2;
|
|
3049
3089
|
var deviceTask, deviceId, idempotencyKey;
|
|
3050
|
-
return _regeneratorRuntime().wrap(function
|
|
3051
|
-
while (1) switch (
|
|
3090
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3091
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
3052
3092
|
case 0:
|
|
3053
3093
|
deviceTask = this.getDeviceTaskPlugin();
|
|
3054
3094
|
if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
|
|
3055
|
-
|
|
3095
|
+
_context37.next = 4;
|
|
3056
3096
|
break;
|
|
3057
3097
|
}
|
|
3058
3098
|
this.logger.addLog({
|
|
@@ -3062,7 +3102,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3062
3102
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3063
3103
|
}
|
|
3064
3104
|
});
|
|
3065
|
-
return
|
|
3105
|
+
return _context37.abrupt("return");
|
|
3066
3106
|
case 4:
|
|
3067
3107
|
this.logger.addLog({
|
|
3068
3108
|
type: 'info',
|
|
@@ -3071,10 +3111,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3071
3111
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3072
3112
|
}
|
|
3073
3113
|
});
|
|
3074
|
-
|
|
3114
|
+
_context37.next = 7;
|
|
3075
3115
|
return this.getShortNumberOrDeviceId();
|
|
3076
3116
|
case 7:
|
|
3077
|
-
deviceId =
|
|
3117
|
+
deviceId = _context37.sent;
|
|
3078
3118
|
idempotencyKey = createUuidV4();
|
|
3079
3119
|
deviceTask.dispatch({
|
|
3080
3120
|
action: 'print_all',
|
|
@@ -3094,11 +3134,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3094
3134
|
});
|
|
3095
3135
|
case 10:
|
|
3096
3136
|
case "end":
|
|
3097
|
-
return
|
|
3137
|
+
return _context37.stop();
|
|
3098
3138
|
}
|
|
3099
|
-
},
|
|
3139
|
+
}, _callee37, this);
|
|
3100
3140
|
}));
|
|
3101
|
-
function handlePrintWristband(
|
|
3141
|
+
function handlePrintWristband(_x27) {
|
|
3102
3142
|
return _handlePrintWristband.apply(this, arguments);
|
|
3103
3143
|
}
|
|
3104
3144
|
return handlePrintWristband;
|
|
@@ -3106,11 +3146,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3106
3146
|
}, {
|
|
3107
3147
|
key: "handleRedeem",
|
|
3108
3148
|
value: function () {
|
|
3109
|
-
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3149
|
+
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
|
|
3110
3150
|
var _this$store$order7, _this$store$order7$ge, _this$store$order8, _ref20, _tempOrder$order_id2;
|
|
3111
3151
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
3112
|
-
return _regeneratorRuntime().wrap(function
|
|
3113
|
-
while (1) switch (
|
|
3152
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3153
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3114
3154
|
case 0:
|
|
3115
3155
|
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
3116
3156
|
status = params.is_checkin ? 'used' : 'unused';
|
|
@@ -3134,20 +3174,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3134
3174
|
});
|
|
3135
3175
|
});
|
|
3136
3176
|
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
3137
|
-
|
|
3177
|
+
_context38.next = 11;
|
|
3138
3178
|
break;
|
|
3139
3179
|
}
|
|
3140
|
-
|
|
3180
|
+
_context38.next = 11;
|
|
3141
3181
|
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
3142
3182
|
vouchers: nextVouchers
|
|
3143
3183
|
}));
|
|
3144
3184
|
case 11:
|
|
3145
3185
|
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
3146
3186
|
if (!(voucherIds.length === 0)) {
|
|
3147
|
-
|
|
3187
|
+
_context38.next = 14;
|
|
3148
3188
|
break;
|
|
3149
3189
|
}
|
|
3150
|
-
return
|
|
3190
|
+
return _context38.abrupt("return", {
|
|
3151
3191
|
code: 200,
|
|
3152
3192
|
status: true,
|
|
3153
3193
|
message: '',
|
|
@@ -3158,7 +3198,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3158
3198
|
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
3159
3199
|
orderId = (_ref20 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref20 !== void 0 ? _ref20 : undefined;
|
|
3160
3200
|
orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
|
|
3161
|
-
return
|
|
3201
|
+
return _context38.abrupt("return", this.request.post('/machinecode/batch', {
|
|
3162
3202
|
ids: voucherIds,
|
|
3163
3203
|
status: status,
|
|
3164
3204
|
order_lookup: orderLookup,
|
|
@@ -3169,11 +3209,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3169
3209
|
}));
|
|
3170
3210
|
case 19:
|
|
3171
3211
|
case "end":
|
|
3172
|
-
return
|
|
3212
|
+
return _context38.stop();
|
|
3173
3213
|
}
|
|
3174
|
-
},
|
|
3214
|
+
}, _callee38, this);
|
|
3175
3215
|
}));
|
|
3176
|
-
function handleRedeem(
|
|
3216
|
+
function handleRedeem(_x28) {
|
|
3177
3217
|
return _handleRedeem.apply(this, arguments);
|
|
3178
3218
|
}
|
|
3179
3219
|
return handleRedeem;
|
|
@@ -3185,12 +3225,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3185
3225
|
}, {
|
|
3186
3226
|
key: "destroy",
|
|
3187
3227
|
value: (function () {
|
|
3188
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3228
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3189
3229
|
var _this$scan;
|
|
3190
|
-
return _regeneratorRuntime().wrap(function
|
|
3191
|
-
while (1) switch (
|
|
3230
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3231
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3192
3232
|
case 0:
|
|
3193
|
-
|
|
3233
|
+
_context39.next = 2;
|
|
3194
3234
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
3195
3235
|
case 2:
|
|
3196
3236
|
try {
|
|
@@ -3201,9 +3241,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3201
3241
|
scanCache.clear();
|
|
3202
3242
|
case 4:
|
|
3203
3243
|
case "end":
|
|
3204
|
-
return
|
|
3244
|
+
return _context39.stop();
|
|
3205
3245
|
}
|
|
3206
|
-
},
|
|
3246
|
+
}, _callee39, this);
|
|
3207
3247
|
}));
|
|
3208
3248
|
function destroy() {
|
|
3209
3249
|
return _destroy.apply(this, arguments);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { type CustomerInvoiceLanguageCode, type CustomerInvoiceLanguageOption } from '../../shared/receipt/customerInvoiceLanguages';
|
|
4
|
+
export type { CustomerInvoiceLanguageCode, CustomerInvoiceLanguageOption, } from '../../shared/receipt/customerInvoiceLanguages';
|
|
3
5
|
import type { InvoiceLayoutConfig } from '../../modules/OpenData';
|
|
4
6
|
import { type SmallTicketData } from '../../shared/receipt/small-ticket';
|
|
5
7
|
export interface OrderInvoicePreviewInput {
|
|
@@ -19,6 +21,9 @@ export interface OrderInvoicePreviewResult {
|
|
|
19
21
|
sourceRevision: string;
|
|
20
22
|
generatedAt: string;
|
|
21
23
|
locale: string;
|
|
24
|
+
secondaryLocale?: string;
|
|
25
|
+
languageOptions: CustomerInvoiceLanguageOption[];
|
|
26
|
+
selectedLanguage: CustomerInvoiceLanguageCode;
|
|
22
27
|
orderId: string | number;
|
|
23
28
|
source: Record<string, any>;
|
|
24
29
|
shop: Record<string, any>;
|
|
@@ -40,6 +45,7 @@ export declare class OrderInvoicePreviewImpl extends BaseModule implements Modul
|
|
|
40
45
|
private disposed;
|
|
41
46
|
private input?;
|
|
42
47
|
private activeKey;
|
|
48
|
+
private languageSelection?;
|
|
43
49
|
private pending?;
|
|
44
50
|
private snapshotCache;
|
|
45
51
|
constructor(name?: string);
|
|
@@ -51,6 +57,10 @@ export declare class OrderInvoicePreviewImpl extends BaseModule implements Modul
|
|
|
51
57
|
private loadContext;
|
|
52
58
|
private loadSource;
|
|
53
59
|
prepare(input: OrderInvoicePreviewInput): Promise<OrderInvoicePreviewResult>;
|
|
60
|
+
private getSelectionScope;
|
|
61
|
+
private documentIdentity;
|
|
62
|
+
/** Switch only the ready receipt projection; no fetching or rebuilding data. */
|
|
63
|
+
selectLanguage(code: string): OrderInvoicePreviewResult;
|
|
54
64
|
retry(): Promise<OrderInvoicePreviewResult>;
|
|
55
65
|
destroy(): void;
|
|
56
66
|
}
|