@pisell/pisellos 2.2.323 → 2.2.324
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.js +509 -0
- package/dist/modules/BookingContext/index.d.ts +2 -2
- package/dist/modules/BookingContext/index.js +55 -25
- package/dist/modules/BookingContext/types.d.ts +2 -0
- package/dist/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/dist/modules/BookingContext/utils/calendarBooking.js +207 -0
- package/dist/modules/BookingContext/utils/index.d.ts +1 -0
- package/dist/modules/BookingContext/utils/index.js +1 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +20 -1
- package/dist/modules/BookingContext/utils/productExtend.js +122 -29
- package/dist/modules/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +60 -14
- package/dist/modules/Date/types.d.ts +5 -0
- package/dist/modules/Discount/index.js +1 -0
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/salesSettings.d.ts +32 -0
- package/dist/modules/OpenData/salesSettings.js +80 -0
- package/dist/modules/OpenData/types.d.ts +16 -0
- package/dist/modules/OpenData/utils.d.ts +1 -1
- package/dist/modules/OpenData/utils.js +3 -2
- package/dist/modules/Order/index.d.ts +54 -11
- package/dist/modules/Order/index.js +2699 -1411
- package/dist/modules/Order/types.d.ts +43 -5
- package/dist/modules/Order/types.js +4 -0
- package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/dist/modules/Order/unpaidAmountGap.js +72 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Order/utils.d.ts +3 -1
- package/dist/modules/Order/utils.js +6 -2
- package/dist/modules/ProductList/clientDataVariants.js +6 -2
- package/dist/modules/ProductList/index.d.ts +2 -0
- package/dist/modules/ProductList/index.js +161 -51
- package/dist/modules/ResourcePlanner/planner.js +58 -2
- package/dist/modules/ResourcePlanner/types.d.ts +13 -0
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +58 -39
- package/dist/modules/Schedule/index.d.ts +7 -1
- package/dist/modules/Schedule/index.js +155 -39
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/bookingReadValidation.d.ts +6 -0
- package/dist/modules/bookingReadValidation.js +72 -0
- package/dist/plugins/request.d.ts +2 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.js +1312 -1154
- package/dist/server/modules/order/index.js +2 -1
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/dist/shared/receipt/small-ticket.d.ts +4 -0
- package/dist/shared/receipt/small-ticket.js +70 -12
- package/dist/solution/BaseSales/index.d.ts +39 -5
- package/dist/solution/BaseSales/index.js +1828 -1462
- package/dist/solution/BaseSales/types.d.ts +1 -0
- package/dist/solution/BaseSales/types.js +1 -0
- package/dist/solution/BookingByStep/index.d.ts +17 -3
- package/dist/solution/BookingByStep/index.js +676 -361
- package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/dist/solution/BookingByStep/utils/resources.js +117 -76
- package/dist/solution/BookingTicket/index.d.ts +15 -3
- package/dist/solution/BookingTicket/index.js +249 -135
- package/dist/solution/BookingTicket/types.d.ts +14 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +39 -11
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +88 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/OrderInvoicePreview/index.js +14 -8
- package/dist/solution/ScanOrder/index.d.ts +2 -0
- package/dist/solution/ScanOrder/index.js +166 -67
- package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/dist/solution/ScanOrder/menuAvailability.js +363 -0
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +96 -4
- package/dist/solution/UnifiedBookingSales/index.js +3374 -1177
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +71 -2
- package/dist/solution/UnifiedBookingSales/types.js +7 -1
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +283 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +6 -0
- package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
- package/dist/utils/pos-receipt-auto-print.js +14 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +287 -0
- package/lib/modules/BookingContext/index.d.ts +2 -2
- package/lib/modules/BookingContext/index.js +42 -10
- package/lib/modules/BookingContext/types.d.ts +2 -0
- package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
- package/lib/modules/BookingContext/utils/index.d.ts +1 -0
- package/lib/modules/BookingContext/utils/index.js +11 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +20 -1
- package/lib/modules/BookingContext/utils/productExtend.js +96 -7
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +28 -5
- package/lib/modules/Date/types.d.ts +5 -0
- package/lib/modules/Discount/index.js +1 -0
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/salesSettings.d.ts +32 -0
- package/lib/modules/OpenData/salesSettings.js +70 -0
- package/lib/modules/OpenData/types.d.ts +16 -0
- package/lib/modules/OpenData/utils.d.ts +1 -1
- package/lib/modules/OpenData/utils.js +3 -2
- package/lib/modules/Order/index.d.ts +54 -11
- package/lib/modules/Order/index.js +659 -80
- package/lib/modules/Order/types.d.ts +43 -5
- package/lib/modules/Order/types.js +2 -0
- package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/lib/modules/Order/unpaidAmountGap.js +60 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Order/utils.d.ts +3 -1
- package/lib/modules/Order/utils.js +6 -2
- package/lib/modules/ProductList/clientDataVariants.js +6 -2
- package/lib/modules/ProductList/index.d.ts +2 -0
- package/lib/modules/ProductList/index.js +74 -0
- package/lib/modules/ResourcePlanner/planner.js +52 -1
- package/lib/modules/ResourcePlanner/types.d.ts +13 -0
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +25 -9
- package/lib/modules/Schedule/index.d.ts +7 -1
- package/lib/modules/Schedule/index.js +68 -4
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/bookingReadValidation.d.ts +6 -0
- package/lib/modules/bookingReadValidation.js +56 -0
- package/lib/plugins/request.d.ts +2 -0
- package/lib/server/index.d.ts +5 -0
- package/lib/server/index.js +124 -16
- package/lib/server/modules/order/index.js +2 -1
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/lib/shared/receipt/small-ticket.d.ts +4 -0
- package/lib/shared/receipt/small-ticket.js +63 -8
- package/lib/solution/BaseSales/index.d.ts +39 -5
- package/lib/solution/BaseSales/index.js +212 -18
- package/lib/solution/BaseSales/types.d.ts +1 -0
- package/lib/solution/BaseSales/types.js +1 -0
- package/lib/solution/BookingByStep/index.d.ts +17 -3
- package/lib/solution/BookingByStep/index.js +222 -14
- package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/lib/solution/BookingByStep/utils/resources.js +25 -15
- package/lib/solution/BookingTicket/index.d.ts +15 -3
- package/lib/solution/BookingTicket/index.js +47 -4
- package/lib/solution/BookingTicket/types.d.ts +14 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +37 -6
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +54 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/OrderInvoicePreview/index.js +7 -1
- package/lib/solution/ScanOrder/index.d.ts +2 -0
- package/lib/solution/ScanOrder/index.js +72 -2
- package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/lib/solution/ScanOrder/menuAvailability.js +203 -0
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +96 -4
- package/lib/solution/UnifiedBookingSales/index.js +1316 -73
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +71 -2
- package/lib/solution/UnifiedBookingSales/types.js +4 -1
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +155 -0
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.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
|
@@ -20,6 +20,7 @@ var _resourceSelection = require("./resourceSelection");
|
|
|
20
20
|
var _serviceTimes = require("./serviceTimes");
|
|
21
21
|
var _timeSlices = require("./timeSlices");
|
|
22
22
|
var _flexible = require("./flexible");
|
|
23
|
+
var _calendarBooking = require("./calendarBooking");
|
|
23
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
25
|
/**
|
|
25
26
|
* 上下文(与 info2 state.bookingConfig / state.service / state.date 一一对应)。
|
|
@@ -31,7 +32,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31
32
|
/** Rebuild only the derived booking fields; SKU, quantity, notes and Holder stay intact. */
|
|
32
33
|
function seedRememberedBookingStart(cacheItem, ctx) {
|
|
33
34
|
const remembered = ctx.rememberedTime;
|
|
34
|
-
const invalid = () => Object.assign(new Error('Remembered time requires a valid POS duration
|
|
35
|
+
const invalid = () => Object.assign(new Error('Remembered time requires a valid POS duration interval in the current order.'), {
|
|
35
36
|
code: 'INVALID_REMEMBERED_TIME'
|
|
36
37
|
});
|
|
37
38
|
const duration = cacheItem?.duration;
|
|
@@ -43,12 +44,29 @@ function seedRememberedBookingStart(cacheItem, ctx) {
|
|
|
43
44
|
const date = new Date(`${value}T00:00:00.000Z`);
|
|
44
45
|
return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
45
46
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
47
|
+
const isDateTime = value => {
|
|
48
|
+
const parts = typeof value === 'string' ? /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(?:Z|[+-](\d{2}):(\d{2}))?$/.exec(value) : null;
|
|
49
|
+
return Boolean(parts && isCalendarDate(parts[1]) && Number(parts[2]) <= 23 && Number(parts[3]) <= 59 && Number(parts[4] || 0) <= 59 && Number(parts[5] || 0) <= 23 && Number(parts[6] || 0) <= 59);
|
|
50
|
+
};
|
|
51
|
+
if (String(ctx.channel || '').trim().toLowerCase() !== 'pos' || !isDuration || (0, _serviceTimes.isMultiDayProduct)(cacheItem) || (0, _serviceTimes.isSessionProduct)(cacheItem) || cacheItem?.cartDetailValue?.session || cacheItem?._extend?.other?.session || !isCalendarDate(remembered?.businessDate) || !isDateTime(remembered?.startAt)) throw invalid();
|
|
48
52
|
// Parse the actual instant with the same runtime clock used by the legacy booking helpers.
|
|
49
53
|
// The business-day label must not replace the calendar date of an overnight start.
|
|
50
54
|
const start = (0, _dayjs.default)(remembered.startAt);
|
|
51
55
|
if (!start.isValid()) throw invalid();
|
|
56
|
+
const hasRememberedInterval = remembered.endAt !== undefined || remembered.orderSessionId !== undefined;
|
|
57
|
+
let end;
|
|
58
|
+
let rememberedDuration;
|
|
59
|
+
if (hasRememberedInterval) {
|
|
60
|
+
if (!isDateTime(remembered.endAt) || typeof remembered.orderSessionId !== 'string' || !remembered.orderSessionId.trim() || remembered.orderSessionId !== ctx.orderSessionId || ctx.isOrderSessionCurrent && !ctx.isOrderSessionCurrent(remembered.orderSessionId)) throw invalid();
|
|
61
|
+
end = (0, _dayjs.default)(remembered.endAt);
|
|
62
|
+
const durationMinutes = (end.valueOf() - start.valueOf()) / 60000;
|
|
63
|
+
if (!end.isValid() || !Number.isFinite(durationMinutes) || durationMinutes <= 0) throw invalid();
|
|
64
|
+
const flexible = (0, _flexible.isProductFlexibleDuration)(duration);
|
|
65
|
+
const configuredDurationMinutes = Number(durationValue) * (['hour', 'hours'].includes(durationType) ? 60 : 1);
|
|
66
|
+
if (!flexible && durationMinutes !== configuredDurationMinutes) throw invalid();
|
|
67
|
+
rememberedDuration = flexible ? _flexible.flexibleObj.create(durationMinutes) : durationMinutes;
|
|
68
|
+
}
|
|
69
|
+
const clockFormat = value => value.format(value.millisecond() ? 'HH:mm:ss.SSS' : value.second() ? 'HH:mm:ss' : 'HH:mm');
|
|
52
70
|
const extend = {
|
|
53
71
|
...(cacheItem?._extend || {})
|
|
54
72
|
};
|
|
@@ -61,7 +79,13 @@ function seedRememberedBookingStart(cacheItem, ctx) {
|
|
|
61
79
|
_extend: {
|
|
62
80
|
...extend,
|
|
63
81
|
start_date: start.format('YYYY-MM-DD'),
|
|
64
|
-
start_time:
|
|
82
|
+
start_time: clockFormat(start),
|
|
83
|
+
...(end ? {
|
|
84
|
+
end_date: end.format('YYYY-MM-DD'),
|
|
85
|
+
end_time: clockFormat(end),
|
|
86
|
+
endDate: end,
|
|
87
|
+
duration: rememberedDuration
|
|
88
|
+
} : {})
|
|
65
89
|
}
|
|
66
90
|
};
|
|
67
91
|
}
|
|
@@ -94,6 +118,15 @@ function getFlexibleOption(params) {
|
|
|
94
118
|
const duration = (0, _flexible.getDurationValue)(cacheItem?.duration);
|
|
95
119
|
if (duration !== 'flexible') return null;
|
|
96
120
|
const startDate = (0, _dayjs.default)(`${(0, _dayjs.default)(cacheItem?._extend?.start_date).format('YYYY-MM-DD')} ${useStartTime || cacheItem?._extend?.start_time || '00:00'}`);
|
|
121
|
+
// The current-order interval was validated before rebuilding the cache item.
|
|
122
|
+
// Resource defaults may change, but must never extend its saved end.
|
|
123
|
+
if (params.ctx.rememberedTime?.endAt !== undefined) {
|
|
124
|
+
const timeValue = ((0, _dayjs.default)(params.ctx.rememberedTime.endAt).valueOf() - startDate.valueOf()) / 60000;
|
|
125
|
+
return {
|
|
126
|
+
label: String(timeValue),
|
|
127
|
+
value: _flexible.flexibleObj.create(timeValue)
|
|
128
|
+
};
|
|
129
|
+
}
|
|
97
130
|
const usable = (0, _resources.getUsableTime)(cacheItem);
|
|
98
131
|
const usableEndAt = usable?._extend?.usableTime?.end_at ? (0, _dayjs.default)(usable._extend.usableTime.end_at) : null;
|
|
99
132
|
const endDate = (0, _timeSlices.getEndDate)(startDate, 'flexible', usableEndAt, params.ctx?.shopOpeningHours);
|
|
@@ -138,6 +171,12 @@ function getTimeObj(params) {
|
|
|
138
171
|
durationSlicesBasedOnTime
|
|
139
172
|
};
|
|
140
173
|
}
|
|
174
|
+
function getDefaultBookingStartFallback(cacheItem, ctx) {
|
|
175
|
+
if (ctx.useCurrentTimeAfterRememberedExpiry) return (0, _dayjs.default)(ctx.date ?? (0, _dayjs.default)()).format('YYYY-MM-DDTHH:mm');
|
|
176
|
+
const date = (0, _dayjs.default)(cacheItem?._extend?.start_date ?? ctx.date ?? (0, _dayjs.default)()).format('YYYY-MM-DD');
|
|
177
|
+
const time = ctx.presetStartTime || cacheItem.currentDefaultTime || (0, _dayjs.default)().format('HH:mm');
|
|
178
|
+
return `${date}T${time}`;
|
|
179
|
+
}
|
|
141
180
|
|
|
142
181
|
/**
|
|
143
182
|
* 计算商品行 _extend(包含 start_time / endDate / duration / start_date / end_date / sub_type 等)。
|
|
@@ -157,7 +196,7 @@ function getServiceStartTimeAndEndTime(params) {
|
|
|
157
196
|
duration: null
|
|
158
197
|
};
|
|
159
198
|
}
|
|
160
|
-
const appointmentTimingPreference = getAppointmentTimingPreference(ctx);
|
|
199
|
+
const appointmentTimingPreference = ctx.resolveDefaultBookingStart ? undefined : getAppointmentTimingPreference(ctx);
|
|
161
200
|
const lastServer = ctx.previousService || null;
|
|
162
201
|
const resolveDuration = () => {
|
|
163
202
|
if ((0, _serviceTimes.isMultiDayProduct)(cacheItem)) return (0, _serviceTimes.getDays)(cacheItem, 'days');
|
|
@@ -166,7 +205,14 @@ function getServiceStartTimeAndEndTime(params) {
|
|
|
166
205
|
let _extend = {
|
|
167
206
|
duration: resolveDuration()
|
|
168
207
|
};
|
|
169
|
-
if (
|
|
208
|
+
if (ctx.resolveDefaultBookingStart && !ctx.rememberedTime && !cacheItem._extend?.start_time && !(0, _serviceTimes.isSessionProduct)(cacheItem)) {
|
|
209
|
+
const fallback = params.defaultBookingStartFallback ?? getDefaultBookingStartFallback(cacheItem, ctx);
|
|
210
|
+
const start = ctx.resolveDefaultBookingStart(cacheItem, fallback);
|
|
211
|
+
if (start) {
|
|
212
|
+
_extend.start_date = start.slice(0, 10);
|
|
213
|
+
_extend.start_time = start.slice(11);
|
|
214
|
+
}
|
|
215
|
+
} else if (lastServer) {
|
|
170
216
|
const lastStart = lastServer._extend?.startDate;
|
|
171
217
|
const lastEnd = lastServer._extend?.endDate;
|
|
172
218
|
if (appointmentTimingPreference === 'parallel') {
|
|
@@ -188,10 +234,21 @@ function getServiceStartTimeAndEndTime(params) {
|
|
|
188
234
|
_extend.start_time = (0, _dayjs.default)().format('HH:mm');
|
|
189
235
|
}
|
|
190
236
|
}
|
|
237
|
+
const defaultStartDate = _extend.start_date;
|
|
191
238
|
_extend = {
|
|
192
239
|
..._extend,
|
|
193
240
|
...cacheItem._extend
|
|
194
241
|
};
|
|
242
|
+
// start_date on a new cache item is a calendar anchor, not a manually selected time.
|
|
243
|
+
// Preserve the complete default after a previous booking crossed midnight.
|
|
244
|
+
if (defaultStartDate && !cacheItem._extend?.start_time) {
|
|
245
|
+
_extend.start_date = defaultStartDate;
|
|
246
|
+
if ((0, _serviceTimes.isMultiDayProduct)(cacheItem) && cacheItem._extend?.end_date) {
|
|
247
|
+
const originalDate = (0, _dayjs.default)(cacheItem._extend.start_date ?? ctx.date).startOf('day');
|
|
248
|
+
const shiftDays = (0, _dayjs.default)(defaultStartDate).diff(originalDate, 'day');
|
|
249
|
+
_extend.end_date = (0, _dayjs.default)(cacheItem._extend.end_date).add(shiftDays, 'day').format('YYYY-MM-DD');
|
|
250
|
+
}
|
|
251
|
+
}
|
|
195
252
|
const {
|
|
196
253
|
startDate,
|
|
197
254
|
endDate
|
|
@@ -235,6 +292,28 @@ function getProductExtend(params) {
|
|
|
235
292
|
const {
|
|
236
293
|
isDisabledTime
|
|
237
294
|
} = params;
|
|
295
|
+
if ((0, _calendarBooking.getCalendarBookingRange)(params.cacheItem, params.ctx)) {
|
|
296
|
+
const prepared = (0, _calendarBooking.prepareCalendarBookingCacheItem)(params.cacheItem, params.ctx);
|
|
297
|
+
const capacity = (0, _resources.setDefaultCapacitys)({
|
|
298
|
+
capacitys: prepared.capacity,
|
|
299
|
+
cacheItem: prepared
|
|
300
|
+
});
|
|
301
|
+
return {
|
|
302
|
+
...prepared,
|
|
303
|
+
_extend: {
|
|
304
|
+
...prepared._extend,
|
|
305
|
+
capacity
|
|
306
|
+
},
|
|
307
|
+
_data: {
|
|
308
|
+
...prepared._data,
|
|
309
|
+
capacitys: prepared.capacity,
|
|
310
|
+
calendarManualBooking: params.cacheItem._data?.calendarManualBooking === true || (0, _calendarBooking.isManualBookingProduct)(params.cacheItem),
|
|
311
|
+
calendarBookingEntryKey: (0, _calendarBooking.calendarBookingEntryKey)(params.ctx),
|
|
312
|
+
calendarBookingPreparationKey: (0, _calendarBooking.calendarBookingPreparationKey)(prepared, params.ctx)
|
|
313
|
+
},
|
|
314
|
+
autoClose: !(0, _calendarBooking.calendarBookingNeedsInput)(prepared)
|
|
315
|
+
};
|
|
316
|
+
}
|
|
238
317
|
const hasRememberedTime = params.ctx.rememberedTime !== undefined;
|
|
239
318
|
const cacheItem = hasRememberedTime ? seedRememberedBookingStart(params.cacheItem, params.ctx) : params.cacheItem;
|
|
240
319
|
const ctx = hasRememberedTime ? {
|
|
@@ -258,11 +337,21 @@ function getProductExtend(params) {
|
|
|
258
337
|
cacheItem,
|
|
259
338
|
ctx
|
|
260
339
|
});
|
|
340
|
+
const defaultBookingStartFallback = (!ctx.useCurrentTimeAfterRememberedExpiry ? cacheItem._data?.salesDefaultBookingFallback : undefined) ?? getDefaultBookingStartFallback(cacheItem, ctx);
|
|
261
341
|
_cacheItem._extend = getServiceStartTimeAndEndTime({
|
|
262
342
|
cacheItem,
|
|
263
343
|
timeObj: _cacheItem._data.timeObj,
|
|
264
|
-
ctx
|
|
344
|
+
ctx,
|
|
345
|
+
defaultBookingStartFallback
|
|
265
346
|
});
|
|
347
|
+
if (ctx.resolveDefaultBookingStart && !hasRememberedTime && !(0, _serviceTimes.isSessionProduct)(cacheItem)) {
|
|
348
|
+
const start = `${(0, _dayjs.default)(_cacheItem._extend.start_date).format('YYYY-MM-DD')}T${_cacheItem._extend.start_time}`;
|
|
349
|
+
const previousDefault = cacheItem._data?.salesDefaultBookingStart;
|
|
350
|
+
if (!cacheItem._extend?.start_time || previousDefault && (0, _dayjs.default)(start).valueOf() === (0, _dayjs.default)(previousDefault).valueOf()) {
|
|
351
|
+
_cacheItem._data.salesDefaultBookingStart = start;
|
|
352
|
+
_cacheItem._data.salesDefaultBookingFallback = defaultBookingStartFallback;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
266
355
|
_cacheItem._data.capacitys = cacheItem.capacity;
|
|
267
356
|
_cacheItem._data.resourcesOrigin = (0, _resources.getResourceByIds)(resourcesOriginMap, cacheItem, {
|
|
268
357
|
resourceTab: ctx?.bookingConfig?.config?.resource_tab,
|
|
@@ -15,7 +15,7 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
15
15
|
getDateRange(): ITime[];
|
|
16
16
|
getResourceDates(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
17
17
|
getDateList(): ITime[];
|
|
18
|
-
setDateList(dateList: ITime[]): void;
|
|
18
|
+
setDateList(dateList: ITime[], replaceDates?: boolean): void;
|
|
19
19
|
fetchResourceDates(params: IGetAvailableTimeListParams): Promise<any>;
|
|
20
20
|
/**
|
|
21
21
|
* 将时间向上取整到下一个10分钟整数
|
|
@@ -8,6 +8,7 @@ var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
|
8
8
|
var _BaseModule = require("../BaseModule");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
var _cloneDeep = _interopRequireDefault(require("lodash-es/cloneDeep"));
|
|
11
|
+
var _bookingReadValidation = require("../bookingReadValidation");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
class DateModule extends _BaseModule.BaseModule {
|
|
13
14
|
defaultName = 'date';
|
|
@@ -52,7 +53,7 @@ class DateModule extends _BaseModule.BaseModule {
|
|
|
52
53
|
return this.store.dateRange;
|
|
53
54
|
}
|
|
54
55
|
async getResourceDates(params) {
|
|
55
|
-
if (params.useCache) {
|
|
56
|
+
if (params.useCache && params.errorMode !== 'throw') {
|
|
56
57
|
// 发请求之前,做一道检测,看 dateList 里是否有对应日期,且对应日期里是否都有对应 resource_ids 的资源
|
|
57
58
|
const currentDateList = this.getDateList() || [];
|
|
58
59
|
const currentDateListMap = new Map(currentDateList.map(item => [item.date, item]));
|
|
@@ -65,14 +66,26 @@ class DateModule extends _BaseModule.BaseModule {
|
|
|
65
66
|
return currentDateList;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
let dates;
|
|
70
|
+
try {
|
|
71
|
+
dates = await this.getResourceAvailableTimeList(params);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
params.assertCurrent?.();
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
params.assertCurrent?.();
|
|
77
|
+
this.setDateList(dates, params.errorMode === 'throw');
|
|
70
78
|
return dates;
|
|
71
79
|
}
|
|
72
80
|
getDateList() {
|
|
73
81
|
return this.store.dateList;
|
|
74
82
|
}
|
|
75
|
-
setDateList(dateList) {
|
|
83
|
+
setDateList(dateList, replaceDates = false) {
|
|
84
|
+
if (replaceDates) {
|
|
85
|
+
const incoming = new Map(dateList.map(date => [date.date, date]));
|
|
86
|
+
this.store.dateList = [...(this.store.dateList || []).filter(date => !incoming.has(date.date)), ...(0, _cloneDeep.default)(dateList)];
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
76
89
|
// this.store.dateList = dateList;
|
|
77
90
|
// 并不能直接简单的进行复制
|
|
78
91
|
// 我们需要把每一天的资源都进行一个合并
|
|
@@ -117,8 +130,16 @@ class DateModule extends _BaseModule.BaseModule {
|
|
|
117
130
|
resource_ids,
|
|
118
131
|
front_end_cache_id: useCache && this.cacheId
|
|
119
132
|
}, {
|
|
120
|
-
useCache
|
|
133
|
+
useCache,
|
|
134
|
+
...(params.bookingRead ? {
|
|
135
|
+
bookingRead: true
|
|
136
|
+
} : {})
|
|
121
137
|
});
|
|
138
|
+
if (params.errorMode === 'throw') {
|
|
139
|
+
if (!res || res.code !== undefined && Number(res.code) !== 200 || res.status === false || res.success === false || typeof res.status === 'number' && res.status >= 400 || !(0, _bookingReadValidation.isBookingResourceList)(res.data)) {
|
|
140
|
+
throw new Error(res?.message || 'Invalid booking resource response');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
122
143
|
|
|
123
144
|
// 校正资源时间段数据
|
|
124
145
|
if (res?.data && Array.isArray(res.data)) {
|
|
@@ -126,6 +147,7 @@ class DateModule extends _BaseModule.BaseModule {
|
|
|
126
147
|
}
|
|
127
148
|
return res;
|
|
128
149
|
} catch (error) {
|
|
150
|
+
if (params.errorMode === 'throw') throw error;
|
|
129
151
|
console.error(error);
|
|
130
152
|
}
|
|
131
153
|
}
|
|
@@ -244,6 +266,7 @@ class DateModule extends _BaseModule.BaseModule {
|
|
|
244
266
|
}
|
|
245
267
|
return dates;
|
|
246
268
|
} catch (error) {
|
|
269
|
+
if (params.errorMode === 'throw') throw error;
|
|
247
270
|
return (0, _utils.disableAllDates)(dates);
|
|
248
271
|
}
|
|
249
272
|
}
|
|
@@ -44,6 +44,11 @@ export interface DateModuleAPI {
|
|
|
44
44
|
getResourceDates: (params: IGetAvailableTimeListParams) => Promise<ITime[]>;
|
|
45
45
|
}
|
|
46
46
|
export interface IGetAvailableTimeListParams {
|
|
47
|
+
/** BookingByStep opts in; existing solutions retain unavailable-on-error behavior. */
|
|
48
|
+
errorMode?: 'unavailable' | 'throw';
|
|
49
|
+
bookingRead?: boolean;
|
|
50
|
+
/** Check the selection is still current before committing a response. */
|
|
51
|
+
assertCurrent?: () => void;
|
|
47
52
|
url?: string;
|
|
48
53
|
/** 是否使用缓存 */
|
|
49
54
|
useCache?: boolean;
|
|
@@ -141,6 +141,7 @@ class DiscountModule extends _BaseModule.BaseModule {
|
|
|
141
141
|
} = options || {};
|
|
142
142
|
const result = await this.request.get(`/machinecode/batch-search`, {
|
|
143
143
|
code,
|
|
144
|
+
resolve_ticket_order: 1,
|
|
144
145
|
translate_flag: 1,
|
|
145
146
|
tags: ['entitlement_pass', 'good_pass', 'product_discount_card'],
|
|
146
147
|
// available: 1,
|
|
@@ -4,6 +4,7 @@ import type { ScheduleModule } from '../Schedule';
|
|
|
4
4
|
import type { OpenDataConfig, OpenDataFetchParams, OpenDataAvailabilityResult, InvoiceLayoutConfig, InvoiceTemplateSettings } from './types';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export * from './contactInfo';
|
|
7
|
+
export * from './salesSettings';
|
|
7
8
|
export { computeAvailability, getDefaultInvoiceLayoutConfig, getDefaultInvoiceTemplateSettings, normalizeInvoiceLayoutConfig, normalizeInvoiceLayoutFromTemplateSettings, normalizeInvoiceTemplateSettings, normalizeRawInvoiceTemplateSettings, resolveInvoiceReceiptLocales, } from './utils';
|
|
8
9
|
export declare class OpenDataModule extends BaseModule implements Module {
|
|
9
10
|
protected defaultName: string;
|
|
@@ -89,6 +89,18 @@ Object.keys(_contactInfo).forEach(function (key) {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
+
var _salesSettings = require("./salesSettings");
|
|
93
|
+
Object.keys(_salesSettings).forEach(function (key) {
|
|
94
|
+
if (key === "default" || key === "__esModule") return;
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
96
|
+
if (key in exports && exports[key] === _salesSettings[key]) return;
|
|
97
|
+
Object.defineProperty(exports, key, {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () {
|
|
100
|
+
return _salesSettings[key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
92
104
|
function isRecord(value) {
|
|
93
105
|
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
94
106
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MultiLangObject, OpenDataConfig } from './types';
|
|
2
|
+
export type MultipleBookingScheduling = 'one_after_another' | 'same_start_time';
|
|
3
|
+
export type ResourceSelectionMode = 'customer_optional' | 'customer_required' | 'automatic';
|
|
4
|
+
export interface SalesResourceSetting {
|
|
5
|
+
name?: string | MultiLangObject;
|
|
6
|
+
resourceSelectionMode: ResourceSelectionMode;
|
|
7
|
+
skipResourceSelectionIfSingle: boolean;
|
|
8
|
+
autoAssignmentRule: 'optimal_idle_time';
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedSalesSettings {
|
|
11
|
+
cart: {
|
|
12
|
+
showProductImage: boolean;
|
|
13
|
+
showRemoveButton: boolean;
|
|
14
|
+
};
|
|
15
|
+
product: {
|
|
16
|
+
checkRequiredOptions: boolean;
|
|
17
|
+
};
|
|
18
|
+
stock: {
|
|
19
|
+
checkStock: boolean;
|
|
20
|
+
allowInsufficientStock: boolean;
|
|
21
|
+
showDontRemindAgainToday: boolean;
|
|
22
|
+
};
|
|
23
|
+
reservation: {
|
|
24
|
+
multipleBookingScheduling: MultipleBookingScheduling;
|
|
25
|
+
resourceSettings: Record<string, SalesResourceSetting>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const DEFAULT_SALES_RESOURCE_SETTING: Readonly<SalesResourceSetting>;
|
|
29
|
+
/** PiCoding stores this field as a form-ID map despite its administration schema's array declaration. */
|
|
30
|
+
export declare function normalizeSalesResourceSettings(value: unknown): Record<string, SalesResourceSetting>;
|
|
31
|
+
/** Normalize a successfully loaded OpenData snapshot; callers must propagate loading failures. */
|
|
32
|
+
export declare function normalizeSalesSettings(raw: OpenDataConfig | null | undefined, platform: unknown): ResolvedSalesSettings;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_SALES_RESOURCE_SETTING = void 0;
|
|
7
|
+
exports.normalizeSalesResourceSettings = normalizeSalesResourceSettings;
|
|
8
|
+
exports.normalizeSalesSettings = normalizeSalesSettings;
|
|
9
|
+
var _platform = require("../../utils/platform");
|
|
10
|
+
const DEFAULT_SALES_RESOURCE_SETTING = exports.DEFAULT_SALES_RESOURCE_SETTING = Object.freeze({
|
|
11
|
+
resourceSelectionMode: 'customer_optional',
|
|
12
|
+
skipResourceSelectionIfSingle: true,
|
|
13
|
+
autoAssignmentRule: 'optimal_idle_time'
|
|
14
|
+
});
|
|
15
|
+
function isRecord(value) {
|
|
16
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
17
|
+
}
|
|
18
|
+
function booleanOr(value, fallback) {
|
|
19
|
+
return typeof value === 'boolean' ? value : fallback;
|
|
20
|
+
}
|
|
21
|
+
function normalizeResourceName(value) {
|
|
22
|
+
if (typeof value === 'string') return value.trim() ? value : undefined;
|
|
23
|
+
if (!isRecord(value)) return undefined;
|
|
24
|
+
const entries = Object.entries(value).filter(([, text]) => typeof text === 'string' && text.trim());
|
|
25
|
+
return entries.length ? Object.fromEntries(entries) : undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** PiCoding stores this field as a form-ID map despite its administration schema's array declaration. */
|
|
29
|
+
function normalizeSalesResourceSettings(value) {
|
|
30
|
+
if (!isRecord(value)) return {};
|
|
31
|
+
const entries = Object.entries(value).flatMap(([formId, setting]) => {
|
|
32
|
+
if (!/^[1-9]\d*$/.test(formId) || !isRecord(setting)) return [];
|
|
33
|
+
const name = normalizeResourceName(setting.name);
|
|
34
|
+
const mode = setting.resourceSelectionMode;
|
|
35
|
+
return [[formId, {
|
|
36
|
+
...(name === undefined ? {} : {
|
|
37
|
+
name
|
|
38
|
+
}),
|
|
39
|
+
resourceSelectionMode: mode === 'customer_required' || mode === 'automatic' ? mode : 'customer_optional',
|
|
40
|
+
skipResourceSelectionIfSingle: booleanOr(setting.skipResourceSelectionIfSingle, true),
|
|
41
|
+
// No new allocation algorithm is introduced by this migration.
|
|
42
|
+
autoAssignmentRule: 'optimal_idle_time'
|
|
43
|
+
}]];
|
|
44
|
+
});
|
|
45
|
+
return Object.fromEntries(entries);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Normalize a successfully loaded OpenData snapshot; callers must propagate loading failures. */
|
|
49
|
+
function normalizeSalesSettings(raw, platform) {
|
|
50
|
+
const runtimePlatform = (0, _platform.normalizeRuntimePlatform)(platform);
|
|
51
|
+
const isPos = runtimePlatform === 'pos' || runtimePlatform === 'webpos';
|
|
52
|
+
return {
|
|
53
|
+
cart: {
|
|
54
|
+
showProductImage: booleanOr(raw?.['interface.show_product_image'], true),
|
|
55
|
+
showRemoveButton: isPos || booleanOr(raw?.['interface.show_remove_button'], true)
|
|
56
|
+
},
|
|
57
|
+
product: {
|
|
58
|
+
checkRequiredOptions: booleanOr(raw?.['sale.check_required_options'], true)
|
|
59
|
+
},
|
|
60
|
+
stock: {
|
|
61
|
+
checkStock: !isPos || booleanOr(raw?.['sale.stock_settings'], true),
|
|
62
|
+
allowInsufficientStock: isPos && booleanOr(raw?.['sale.allow_adding_insufficient_stock'], false),
|
|
63
|
+
showDontRemindAgainToday: isPos && booleanOr(raw?.['sale.show_option'], false)
|
|
64
|
+
},
|
|
65
|
+
reservation: {
|
|
66
|
+
multipleBookingScheduling: raw?.['reservation.multiple_booking_scheduling'] === 'one_after_another' ? 'one_after_another' : 'same_start_time',
|
|
67
|
+
resourceSettings: normalizeSalesResourceSettings(raw?.['reservation.resource_setting'])
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -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;
|
|
@@ -67,7 +69,20 @@ export interface OpenDataConfig {
|
|
|
67
69
|
'reservation.auto_confirm_mode'?: string;
|
|
68
70
|
'reservation.auto_confirm_delay_seconds'?: number;
|
|
69
71
|
'reservation.time_slice'?: number | string;
|
|
72
|
+
'reservation.multiple_booking_scheduling'?: 'one_after_another' | 'same_start_time';
|
|
73
|
+
'reservation.resource_setting'?: Record<string, {
|
|
74
|
+
name?: string | MultiLangObject;
|
|
75
|
+
resourceSelectionMode?: 'customer_optional' | 'customer_required' | 'automatic';
|
|
76
|
+
skipResourceSelectionIfSingle?: boolean;
|
|
77
|
+
autoAssignmentRule?: 'optimal_idle_time';
|
|
78
|
+
}>;
|
|
79
|
+
'interface.show_product_image'?: boolean;
|
|
80
|
+
'interface.show_remove_button'?: boolean;
|
|
70
81
|
'sale.allow_item_notes'?: boolean;
|
|
82
|
+
'sale.check_required_options'?: boolean;
|
|
83
|
+
'sale.stock_settings'?: boolean;
|
|
84
|
+
'sale.allow_adding_insufficient_stock'?: boolean;
|
|
85
|
+
'sale.show_option'?: boolean;
|
|
71
86
|
'sale.allow_order_notes'?: boolean;
|
|
72
87
|
'sale.enable_contact_info'?: boolean;
|
|
73
88
|
'sale.first_name.visible'?: boolean;
|
|
@@ -113,6 +128,7 @@ export interface OpenDataConfig {
|
|
|
113
128
|
}>;
|
|
114
129
|
'documents.invoice_template'?: string | number;
|
|
115
130
|
'documents.invoice_edit'?: RawInvoiceEditConfig;
|
|
131
|
+
'documents.pos_receipt_auto_print_payment_statuses'?: PosReceiptAutoPrintPaymentStatus[];
|
|
116
132
|
/** @deprecated 仅保留旧调用方的类型兼容,Invoice 读取逻辑不再消费该字段。 */
|
|
117
133
|
'documents.invoice'?: RawInvoiceLayoutConfig;
|
|
118
134
|
/** @deprecated Invoice 读取逻辑只消费扁平的 documents.invoice_* 字段。 */
|
|
@@ -3,7 +3,7 @@ export declare function getDefaultInvoiceLayoutConfig(): InvoiceLayoutConfig;
|
|
|
3
3
|
export declare function getDefaultInvoiceTemplateSettings(): InvoiceTemplateSettings;
|
|
4
4
|
/**
|
|
5
5
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
6
|
-
*
|
|
6
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveInvoiceReceiptLocales(settings?: InvoiceTemplateSettings | null): string[];
|
|
9
9
|
/**
|
|
@@ -51,12 +51,13 @@ const INVOICE_RECEIPT_LOCALE_MAPPING = {
|
|
|
51
51
|
zh_hk: ['zh_HK'],
|
|
52
52
|
ja: ['ja'],
|
|
53
53
|
pt: ['pt'],
|
|
54
|
-
cn_en: ['en', 'zh_CN']
|
|
54
|
+
cn_en: ['en', 'zh_CN'],
|
|
55
|
+
ja_en: ['ja', 'en']
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
59
|
-
*
|
|
60
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
60
61
|
*/
|
|
61
62
|
function resolveInvoiceReceiptLocales(settings) {
|
|
62
63
|
if (typeof settings?.template !== 'string' || settings.template.trim().length === 0 || settings.template.trim().toUpperCase() === 'DEFAULT' || !isRecord(settings.language)) {
|