@pisell/private-materials 6.6.60 → 6.6.61

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.
Files changed (133) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/booking/components/footer/amount.js +3 -4
  12. package/es/components/booking/components/footer/utils.js +82 -85
  13. package/es/components/booking/components/voucher/index.js +1 -1
  14. package/es/components/booking/dashboard/index.d.ts +5 -0
  15. package/es/components/booking/dashboard/index.js +9 -6
  16. package/es/components/booking/info/service2/Group/utils.js +30 -1
  17. package/es/components/booking/info2/service/editService/index.js +6 -49
  18. package/es/components/booking/info2/service/editService/utils.d.ts +0 -1
  19. package/es/components/booking/info2/service/editService/utils.js +0 -16
  20. package/es/components/booking/payments/index.js +1 -1
  21. package/es/components/checkout/hooks/useWalletPass.js +23 -15
  22. package/es/components/eftposPay/hooks.d.ts +1 -1
  23. package/es/components/eftposPay/store/index.d.ts +2 -2
  24. package/es/components/index.d.ts +2 -1
  25. package/es/components/index.js +2 -1
  26. package/es/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  27. package/es/components/pisellCashCounting/PisellCashCounting.js +121 -0
  28. package/es/components/pisellCashCounting/PisellCashCounting.less +263 -0
  29. package/es/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  30. package/es/components/pisellCashCounting/components/CashCountingModal/index.js +250 -0
  31. package/es/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  32. package/es/components/pisellCashCounting/hooks.d.ts +21 -0
  33. package/es/components/pisellCashCounting/hooks.js +193 -0
  34. package/es/components/pisellCashCounting/index.d.ts +2 -0
  35. package/es/components/pisellCashCounting/index.js +1 -0
  36. package/es/components/pisellCashCounting/locales.d.ts +118 -0
  37. package/es/components/pisellCashCounting/locales.js +117 -0
  38. package/es/components/pisellCashCounting/types.d.ts +85 -0
  39. package/es/components/pisellCashCounting/types.js +1 -0
  40. package/es/components/pisellCashCounting/utils.d.ts +10 -0
  41. package/es/components/pisellCashCounting/utils.js +40 -0
  42. package/es/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  43. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  44. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +5 -2
  45. package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  46. package/es/components/ticketBooking/components/bookingDataPanel/index.js +5 -2
  47. package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +2 -1
  48. package/es/components/ticketBooking/components/ticketBooking/index.js +156 -37
  49. package/es/components/ticketBooking/index.js +7 -1
  50. package/es/hooks/useResponsive.d.ts +8 -0
  51. package/es/hooks/useResponsive.js +43 -0
  52. package/es/hooks/useThemeTokens.d.ts +7 -0
  53. package/es/hooks/useThemeTokens.js +20 -0
  54. package/es/index.d.ts +1 -0
  55. package/es/index.js +2 -1
  56. package/es/pro/Login2.0/components/phoneValidation.js +65 -58
  57. package/es/pro/NumericStepper/index.d.ts +75 -0
  58. package/es/pro/NumericStepper/index.js +301 -0
  59. package/es/pro/NumericStepper/index.less +364 -0
  60. package/es/pro/keyboards/index.d.ts +2 -0
  61. package/es/pro/keyboards/index.js +1 -0
  62. package/es/pro/keyboards/locales.d.ts +38 -0
  63. package/es/pro/keyboards/locales.js +57 -0
  64. package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  65. package/es/pro/keyboards/numberKeyboard/index.js +523 -0
  66. package/es/pro/keyboards/numberKeyboard/index.less +59 -0
  67. package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  68. package/es/pro/keyboards/numberKeyboard/types.js +1 -0
  69. package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  70. package/es/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  71. package/lib/components/booking/components/footer/amount.js +3 -3
  72. package/lib/components/booking/components/footer/utils.js +11 -15
  73. package/lib/components/booking/components/voucher/index.js +1 -1
  74. package/lib/components/booking/dashboard/index.d.ts +5 -0
  75. package/lib/components/booking/dashboard/index.js +6 -5
  76. package/lib/components/booking/info/service2/Group/utils.js +42 -3
  77. package/lib/components/booking/info2/service/editService/index.js +5 -39
  78. package/lib/components/booking/info2/service/editService/utils.d.ts +0 -1
  79. package/lib/components/booking/info2/service/editService/utils.js +0 -16
  80. package/lib/components/booking/payments/index.js +1 -1
  81. package/lib/components/checkout/hooks/useWalletPass.js +23 -16
  82. package/lib/components/eftposPay/hooks.d.ts +1 -1
  83. package/lib/components/eftposPay/store/index.d.ts +2 -2
  84. package/lib/components/index.d.ts +2 -1
  85. package/lib/components/index.js +3 -0
  86. package/lib/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  87. package/lib/components/pisellCashCounting/PisellCashCounting.js +168 -0
  88. package/lib/components/pisellCashCounting/PisellCashCounting.less +263 -0
  89. package/lib/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  90. package/lib/components/pisellCashCounting/components/CashCountingModal/index.js +171 -0
  91. package/lib/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  92. package/lib/components/pisellCashCounting/hooks.d.ts +21 -0
  93. package/lib/components/pisellCashCounting/hooks.js +189 -0
  94. package/lib/components/pisellCashCounting/index.d.ts +2 -0
  95. package/lib/components/pisellCashCounting/index.js +35 -0
  96. package/lib/components/pisellCashCounting/locales.d.ts +118 -0
  97. package/lib/components/pisellCashCounting/locales.js +141 -0
  98. package/lib/components/pisellCashCounting/types.d.ts +85 -0
  99. package/lib/components/pisellCashCounting/types.js +17 -0
  100. package/lib/components/pisellCashCounting/utils.d.ts +10 -0
  101. package/lib/components/pisellCashCounting/utils.js +59 -0
  102. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  103. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  104. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +3 -2
  105. package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  106. package/lib/components/ticketBooking/components/bookingDataPanel/index.js +10 -3
  107. package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +10 -1
  108. package/lib/components/ticketBooking/components/ticketBooking/index.js +114 -14
  109. package/lib/components/ticketBooking/index.js +11 -1
  110. package/lib/hooks/useResponsive.d.ts +8 -0
  111. package/lib/hooks/useResponsive.js +48 -0
  112. package/lib/hooks/useThemeTokens.d.ts +7 -0
  113. package/lib/hooks/useThemeTokens.js +40 -0
  114. package/lib/index.d.ts +1 -0
  115. package/lib/index.js +3 -0
  116. package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
  117. package/lib/pro/NumericStepper/index.d.ts +75 -0
  118. package/lib/pro/NumericStepper/index.js +338 -0
  119. package/lib/pro/NumericStepper/index.less +364 -0
  120. package/lib/pro/keyboards/index.d.ts +2 -0
  121. package/lib/pro/keyboards/index.js +39 -0
  122. package/lib/pro/keyboards/locales.d.ts +38 -0
  123. package/lib/pro/keyboards/locales.js +61 -0
  124. package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  125. package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
  126. package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
  127. package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  128. package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
  129. package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  130. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  131. package/lowcode/pisell-cash-counting/meta.ts +167 -0
  132. package/lowcode/pisell-cash-counting/snippets.ts +13 -0
  133. package/package.json +4 -4
@@ -323,7 +323,7 @@ var processItemsTax = (items, state, options) => {
323
323
  }
324
324
  }
325
325
  }
326
- return { originTax: expectedOriginTax, tax: expectedTax, taxDecimal: preciseTax };
326
+ return { originTax: expectedOriginTax, tax: expectedTax };
327
327
  };
328
328
  var clearTaxFee = (state) => {
329
329
  var _a, _b;
@@ -376,7 +376,7 @@ var getTax = (state, options) => {
376
376
  computed
377
377
  });
378
378
  totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
379
- totalTax = totalTax.plus(serviceResult.taxDecimal);
379
+ totalTax = totalTax.plus(serviceResult.tax);
380
380
  }
381
381
  if ((_c = state == null ? void 0 : state.addons) == null ? void 0 : _c.value) {
382
382
  const addonsResult = processItemsTax(state.addons.value, state, {
@@ -385,7 +385,7 @@ var getTax = (state, options) => {
385
385
  computed
386
386
  });
387
387
  totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
388
- totalTax = totalTax.plus(addonsResult.taxDecimal);
388
+ totalTax = totalTax.plus(addonsResult.tax);
389
389
  }
390
390
  }
391
391
  return {
@@ -111,14 +111,13 @@ var formatProductBundle = (bundle) => {
111
111
  } catch (error) {
112
112
  }
113
113
  return bundle.map((d) => {
114
- var _a;
115
114
  const option = formatProductOption(d.option);
116
115
  const option_price = option.reduce((temp, item) => {
117
116
  return temp + Number(item.num) * item.custom_add_price;
118
117
  }, 0);
119
118
  const product_discount_difference = ((d == null ? void 0 : d.discount_list) || []).reduce((pre, cur) => {
120
- var _a2;
121
- return pre + (((_a2 = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a2.product_discount_difference) || 0);
119
+ var _a;
120
+ return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
122
121
  }, 0);
123
122
  return {
124
123
  "is_charge_tax": d.is_charge_tax,
@@ -139,7 +138,7 @@ var formatProductBundle = (bundle) => {
139
138
  "bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
140
139
  // "bundle_sum_price": d?.original_price || d?.original_total,
141
140
  "metadata": {
142
- custom_product_bundle_map_id: ((_a = d == null ? void 0 : d.metadata) == null ? void 0 : _a.custom_product_bundle_map_id) || d._id,
141
+ custom_product_bundle_map_id: d._id,
143
142
  // 子商品单数量附加费
144
143
  "surcharge_fee": d.surcharge_fee,
145
144
  // 可选,附加费均摊舍入金额
@@ -254,10 +253,13 @@ var formatHolders = (state, item, values) => {
254
253
  return obj;
255
254
  };
256
255
  var formatProductPrice = (item) => {
257
- var _a, _b, _c, _d;
256
+ var _a, _b, _c, _d, _e, _f, _g;
258
257
  const other = (_a = item._extend) == null ? void 0 : _a.other;
259
258
  let price = Number((item == null ? void 0 : item.price) ?? ((_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.price));
260
- if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
259
+ if ((0, import_utils5.isString)((_c = item._extend) == null ? void 0 : _c.priceOverride) || (0, import_utils5.isNumber)((_d = item._extend) == null ? void 0 : _d.priceOverride)) {
260
+ price = Number((_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.price);
261
+ }
262
+ if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_f = item == null ? void 0 : item.variant) == null ? void 0 : _f.length) > 0) {
261
263
  const variant = item.variant.find(
262
264
  (d) => d.id === (other == null ? void 0 : other.product_variant_id)
263
265
  );
@@ -266,7 +268,7 @@ var formatProductPrice = (item) => {
266
268
  }
267
269
  }
268
270
  if (other == null ? void 0 : other.option) {
269
- price = (_d = other == null ? void 0 : other.option) == null ? void 0 : _d.reduce((pre, cur) => {
271
+ price = (_g = other == null ? void 0 : other.option) == null ? void 0 : _g.reduce((pre, cur) => {
270
272
  return pre + Number(cur.price) * Number(cur.num);
271
273
  }, price);
272
274
  }
@@ -371,7 +373,7 @@ var getMainProductSellingPrice = (item) => {
371
373
  }
372
374
  return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
373
375
  };
374
- var formatProducts = (item, quantity, options) => {
376
+ var formatProducts = (item, quantity) => {
375
377
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
376
378
  const total = Number(item._extend.total);
377
379
  const origin_total = Number(item._extend.origin_total);
@@ -385,9 +387,6 @@ var formatProducts = (item, quantity, options) => {
385
387
  ...d.metadata,
386
388
  unique_identification_number: `${item._extend.unique_identification_number}_${d.discount.resource_id}`
387
389
  };
388
- if ((options == null ? void 0 : options.isServiceEdit) && (options == null ? void 0 : options.isMultiDay)) {
389
- delete d.id;
390
- }
391
390
  });
392
391
  const notManualDiscount = discount_list.filter(
393
392
  (item2) => item2.type !== "product"
@@ -528,10 +527,7 @@ var formatBookings = (data, values) => {
528
527
  item._extend.unique_identification_number = unique_identification_number;
529
528
  }
530
529
  const booking = {
531
- product: formatProducts(item, void 0, {
532
- isServiceEdit: data.service.edit,
533
- isMultiDay
534
- }),
530
+ product: formatProducts(item),
535
531
  relation_products: formatRelationDetails(item._extend.relation_details),
536
532
  id: item.booking_id || 0,
537
533
  relation_id: item._extend.relation_id || 0,
@@ -111,7 +111,7 @@ var VoucherCard = (props) => {
111
111
  const val = (_a2 = state.service.value || []) == null ? void 0 : _a2.map((value) => {
112
112
  var _a3, _b2, _c2;
113
113
  return {
114
- // booking_id: value.booking_id,
114
+ booking_id: value.booking_id,
115
115
  id: value.id,
116
116
  price: value.price,
117
117
  total: (_a3 = value == null ? void 0 : value._extend) == null ? void 0 : _a3.total,
@@ -5,6 +5,11 @@ export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivEleme
5
5
  valueColor?: string;
6
6
  otherParams?: Record<string, any>;
7
7
  refreshKey?: string;
8
+ /**
9
+ * 组件是否可见。为 false 时会暂停内部的定时刷新 interval,避免后台无意义地拉数据。
10
+ * 默认 true,保持原有行为向后兼容。
11
+ */
12
+ isVisible?: boolean;
8
13
  onDataChange?: (data: {
9
14
  groupsOnSiteNow: string | number;
10
15
  peopleOnSiteNow: string | number;
@@ -65,6 +65,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
65
65
  labelColor,
66
66
  valueColor,
67
67
  refreshKey,
68
+ isVisible = true,
68
69
  onDataChange,
69
70
  ...others
70
71
  } = props;
@@ -144,7 +145,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
144
145
  calcBookingDataCount();
145
146
  };
146
147
  const calcBookingDataCount = () => {
147
- var _a2, _b2, _c, _d, _e, _f;
148
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
148
149
  let groupsOnSiteNow = statisticData.groups_today_num || 0;
149
150
  let peopleOnSiteNow = statisticData.people_on_site_now_num || (hasTurnstileApp ? 0 : "-");
150
151
  let totalVisitorsToday = ((_a2 = statisticData.total_visitors_today) == null ? void 0 : _a2.num) || 0;
@@ -154,8 +155,8 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
154
155
  let upcoming = ((_e = statisticData.upcoming_visitors) == null ? void 0 : _e.num) || 0;
155
156
  let upcomingChildren = ((_f = statisticData.upcoming_visitors) == null ? void 0 : _f.statistics) || [];
156
157
  let overdue = statisticData.overdue_visitors_num || (hasTurnstileApp ? 0 : "-");
157
- let completed = statisticData.completed_visitors.num || 0;
158
- let completedChildren = statisticData.completed_visitors.statistics || [];
158
+ let completed = ((_g = statisticData.completed_visitors) == null ? void 0 : _g.num) || 0;
159
+ let completedChildren = ((_h = statisticData.completed_visitors) == null ? void 0 : _h.statistics) || [];
159
160
  let departed = statisticData.departed_visitors_num || (hasTurnstileApp ? 0 : "-");
160
161
  onDataChange == null ? void 0 : onDataChange(
161
162
  {
@@ -236,6 +237,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
236
237
  ]);
237
238
  };
238
239
  (0, import_react.useEffect)(() => {
240
+ if (!isVisible) return;
239
241
  getData();
240
242
  const timer = setInterval(() => {
241
243
  getData();
@@ -243,10 +245,9 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
243
245
  return () => {
244
246
  clearInterval(timer);
245
247
  };
246
- }, [JSON.stringify(otherParams), refreshKey]);
248
+ }, [JSON.stringify(otherParams), refreshKey, isVisible]);
247
249
  (0, import_react.useImperativeHandle)(ref, () => ({
248
250
  refresh: () => {
249
- debugger;
250
251
  getData();
251
252
  }
252
253
  }));
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/booking/info/service2/Group/utils.ts
@@ -31,7 +41,9 @@ module.exports = __toCommonJS(utils_exports);
31
41
  var import_utils = require("@pisell/utils");
32
42
  var import_utils2 = require("../../../utils");
33
43
  var import_distributeDiscount = require("../../service/serviceManager/distributeDiscount");
34
- var import_utils3 = require("../../../../ticketBooking/utils");
44
+ var import_utils3 = require("../../../info2/service/editService/utils");
45
+ var import_utils4 = require("../../../../ticketBooking/utils");
46
+ var import_decimal = __toESM(require("decimal.js"));
35
47
  var getGroupTotalPrice = (items) => {
36
48
  return items.reduce((prev, next) => {
37
49
  prev.duration += next._extend.duration;
@@ -100,7 +112,7 @@ var createBookingItemsByGroup = (item, isBatchEdit) => {
100
112
  cacheItem._extend.total = totalPrice;
101
113
  cacheItem._extend.origin_total = origin_total ?? totalPrice;
102
114
  cacheItem._extend.items = void 0;
103
- cacheItem._serviceKey = (0, import_utils3.genServiceKey)(cacheItem);
115
+ cacheItem._serviceKey = (0, import_utils4.genServiceKey)(cacheItem);
104
116
  bookings.push(cacheItem);
105
117
  }
106
118
  if (isBatchEdit) {
@@ -108,7 +120,34 @@ var createBookingItemsByGroup = (item, isBatchEdit) => {
108
120
  const groupOriginTotalPrice = item._extend.origin_total;
109
121
  const discountAmount = (groupOriginTotalPrice - groupTotalPrice) * -1;
110
122
  if (discountAmount !== 0) {
111
- bookings = (0, import_distributeDiscount.distributeDiscountOrIncrease)(bookings, discountAmount, groupOriginTotalPrice);
123
+ if (groupOriginTotalPrice !== 0) {
124
+ bookings = (0, import_distributeDiscount.distributeDiscountOrIncrease)(bookings, discountAmount, groupOriginTotalPrice);
125
+ bookings = bookings.map((booking) => {
126
+ var _a2, _b2;
127
+ return (0, import_utils3.setProductPrice)(booking, {
128
+ newTotal: (_a2 = booking == null ? void 0 : booking._extend) == null ? void 0 : _a2.total,
129
+ origin_total: (_b2 = booking == null ? void 0 : booking._extend) == null ? void 0 : _b2.origin_total
130
+ });
131
+ });
132
+ } else {
133
+ const count = bookings.length;
134
+ const avgTotal = new import_decimal.default(groupTotalPrice).div(count).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
135
+ let assignedSum = new import_decimal.default(0);
136
+ bookings = bookings.map((booking, i) => {
137
+ const newTotal = i === count - 1 ? new import_decimal.default(groupTotalPrice).sub(assignedSum).toNumber() : avgTotal.toNumber();
138
+ if (i !== count - 1) {
139
+ assignedSum = assignedSum.add(avgTotal);
140
+ }
141
+ return {
142
+ ...booking,
143
+ _extend: {
144
+ ...booking._extend,
145
+ total: newTotal,
146
+ price: newTotal
147
+ }
148
+ };
149
+ });
150
+ }
112
151
  }
113
152
  }
114
153
  console.log("bookings", bookings);
@@ -64,7 +64,6 @@ var import_utils9 = require("../../../info/service2/Group/utils");
64
64
  var import_useShopDiscountModule = require("../../../../ticketBooking/hooks/pisellos/useShopDiscountModule");
65
65
  var import_DiscountChangeModal = __toESM(require("./DiscountChangeModal"));
66
66
  var import_decimal = __toESM(require("decimal.js"));
67
- var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
68
67
  var submitLock = false;
69
68
  var Info = (_, ref) => {
70
69
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
@@ -80,7 +79,6 @@ var Info = (_, ref) => {
80
79
  const useEndDate = import_antd.Form.useWatch("end_date", form);
81
80
  const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
82
81
  const [discountChangeModalOpen, setDiscountChangeModalOpen] = (0, import_react.useState)(false);
83
- const context = (0, import_useEngineContext.default)();
84
82
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
85
83
  const resourcesRef = (0, import_react.useRef)(null);
86
84
  const isChangeTotal = (0, import_react.useRef)(false);
@@ -502,23 +500,17 @@ var Info = (_, ref) => {
502
500
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
503
501
  }, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
504
502
  const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
505
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
503
+ var _a2, _b2, _c2, _d2, _e2;
506
504
  const item = state.service.cacheItem;
507
505
  let values = form.getFieldsValue();
508
506
  const isSession = (0, import_utils6.isSessionProduct)(item);
509
507
  const sessionValue = {};
510
- let oldSession = {};
511
508
  if (isSession) {
512
509
  sessionValue.startEndTime = {
513
510
  startDate: (_a2 = item == null ? void 0 : item._extend) == null ? void 0 : _a2.start_date,
514
511
  endDate: (_b2 = item == null ? void 0 : item._extend) == null ? void 0 : _b2.end_date,
515
512
  duration: (_c2 = item == null ? void 0 : item._extend) == null ? void 0 : _c2.duration
516
513
  };
517
- oldSession = {
518
- start_date: (0, import_dayjs.default)((_d2 = item == null ? void 0 : item._extend) == null ? void 0 : _d2.start_date).format("YYYY-MM-DD"),
519
- end_date: (0, import_dayjs.default)((_e2 = item == null ? void 0 : item._extend) == null ? void 0 : _e2.end_date).format("YYYY-MM-DD"),
520
- duration: (_f2 = item == null ? void 0 : item._extend) == null ? void 0 : _f2.duration
521
- };
522
514
  }
523
515
  state.action({
524
516
  type: "pisell1.handleOpenProductModal",
@@ -533,16 +525,15 @@ var Info = (_, ref) => {
533
525
  number: (0, import_utils3.getIsShowNumber)(item, state)
534
526
  },
535
527
  isOS: isSession,
536
- customer_id: (_h2 = (_g2 = state.client) == null ? void 0 : _g2.value) == null ? void 0 : _h2.id,
528
+ customer_id: (_e2 = (_d2 = state.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
537
529
  value: {
538
530
  ...item._extend.other,
539
- bundle: (0, import_utils8.mergeBundles)(item._extend.other),
540
531
  ...sessionValue,
541
532
  quantity: values.quantity || item._extend.quantity
542
533
  }
543
534
  },
544
535
  callback: (e2, extension_type, detail) => {
545
- var _a3, _b3, _c3, _d3, _e3, _f3, _g3, _h3, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
536
+ var _a3, _b3, _c3, _d3, _e3;
546
537
  isEditedRef.current = true;
547
538
  const _detail = detail || item;
548
539
  let other = JSON.parse(JSON.stringify(e2));
@@ -579,29 +570,6 @@ var Info = (_, ref) => {
579
570
  } catch (err) {
580
571
  }
581
572
  const sessionDetail = (0, import_utils5.editSessionProduct)(cacheItem, e2.session);
582
- try {
583
- (0, import_utils.sendWarningLog)({
584
- title: "修改商品数据",
585
- content: [
586
- { key: "productId", value: item.id },
587
- { key: "isSession", value: isSession },
588
- { key: "oldSession", value: JSON.stringify(oldSession) },
589
- { key: "sessionValue", value: JSON.stringify({
590
- startTime: (_d3 = e2.session) == null ? void 0 : _d3.start_time,
591
- endTime: (_e3 = e2.session) == null ? void 0 : _e3.end_time,
592
- startDate: (0, import_dayjs.default)((_f3 = e2.session) == null ? void 0 : _f3.start_at).format("YYYY-MM-DD"),
593
- endDate: (0, import_dayjs.default)((_g3 = e2.session) == null ? void 0 : _g3.end_at).format("YYYY-MM-DD"),
594
- duration: (_h3 = e2.session) == null ? void 0 : _h3.duration
595
- }) },
596
- { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
597
- {
598
- key: "店铺id",
599
- value: (_o2 = (_n2 = (_m2 = (_l2 = (_k2 = (_j2 = (_i2 = context.appHelper) == null ? void 0 : _i2.utils) == null ? void 0 : _j2.store) == null ? void 0 : _k2.getState) == null ? void 0 : _l2.call(_k2)) == null ? void 0 : _m2.global) == null ? void 0 : _n2.globalConfig) == null ? void 0 : _o2.id
600
- }
601
- ]
602
- });
603
- } catch (err) {
604
- }
605
573
  if (sessionDetail) {
606
574
  setTimeout(() => {
607
575
  form.setFieldsValue({
@@ -615,7 +583,7 @@ var Info = (_, ref) => {
615
583
  origin_total = (0, import_utils6.getProductOriginTotalPrice)(cacheItem);
616
584
  }
617
585
  cacheItem._extend.origin_total = origin_total;
618
- (((_p2 = cacheItem._extend) == null ? void 0 : _p2.items) || []).forEach((item2) => item2._extend.origin_total = origin_total);
586
+ (((_d3 = cacheItem._extend) == null ? void 0 : _d3.items) || []).forEach((item2) => item2._extend.origin_total = origin_total);
619
587
  dispatch({
620
588
  type: "setService",
621
589
  payload: {
@@ -624,7 +592,7 @@ var Info = (_, ref) => {
624
592
  });
625
593
  form.setFieldsValue({
626
594
  total: _total,
627
- capacity: (_q2 = cacheItem._extend) == null ? void 0 : _q2.capacity,
595
+ capacity: (_e3 = cacheItem._extend) == null ? void 0 : _e3.capacity,
628
596
  quantity: (e2 == null ? void 0 : e2.quantity) || (values == null ? void 0 : values.quantity) || 1
629
597
  });
630
598
  }
@@ -1055,8 +1023,6 @@ var Info = (_, ref) => {
1055
1023
  var _a2, _b2, _c2;
1056
1024
  delete cacheItem.discount_list;
1057
1025
  (_c2 = (_b2 = (_a2 = cacheItem._extend.other) == null ? void 0 : _a2.bundle) == null ? void 0 : _b2.forEach) == null ? void 0 : _c2.call(_b2, (bundle) => {
1058
- var _a3;
1059
- (_a3 = bundle == null ? void 0 : bundle.metadata) == null ? true : delete _a3.custom_product_bundle_map_id;
1060
1026
  bundle == null ? true : delete bundle.discount_list;
1061
1027
  bundle == null ? true : delete bundle.booking_id;
1062
1028
  bundle == null ? true : delete bundle.bundle_selling_price;
@@ -32,7 +32,6 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
32
32
  * @returns 折扣列表
33
33
  */
34
34
  export declare const getProductAllDiscountList: (cacheItem: any) => any;
35
- export declare const mergeBundles: (other: any) => any[];
36
35
  /**
37
36
  * 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
38
37
  * @param other - callback 返回的新数据
@@ -32,7 +32,6 @@ __export(utils_exports, {
32
32
  getAutoAllocationStorage: () => getAutoAllocationStorage,
33
33
  getProductAllDiscountList: () => getProductAllDiscountList,
34
34
  mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
35
- mergeBundles: () => mergeBundles,
36
35
  setAutoAllocationStorage: () => setAutoAllocationStorage,
37
36
  setProductPrice: () => setProductPrice
38
37
  });
@@ -97,20 +96,6 @@ var getProductAllDiscountList = (cacheItem) => {
97
96
  discountList.push(...bundleDiscountList);
98
97
  return discountList;
99
98
  };
100
- var mergeBundles = (other) => {
101
- const bundle = (other == null ? void 0 : other.bundle) || [];
102
- const newBundle = [];
103
- bundle.forEach((item) => {
104
- const newItem = newBundle.find((newItem2) => newItem2.id === item.id);
105
- if (newItem) {
106
- newItem.num += item.num || 1;
107
- newItem.quantity += item.quantity || 1;
108
- } else {
109
- newBundle.push({ ...item });
110
- }
111
- });
112
- return newBundle;
113
- };
114
99
  var mergeBundleWithOriginalPrice = (other, originalOther) => {
115
100
  var _a, _b;
116
101
  if (!((_a = other == null ? void 0 : other.bundle) == null ? void 0 : _a.length) || !((_b = originalOther == null ? void 0 : originalOther.bundle) == null ? void 0 : _b.length)) return other;
@@ -130,7 +115,6 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
130
115
  getAutoAllocationStorage,
131
116
  getProductAllDiscountList,
132
117
  mergeBundleWithOriginalPrice,
133
- mergeBundles,
134
118
  setAutoAllocationStorage,
135
119
  setProductPrice
136
120
  });
@@ -134,7 +134,7 @@ var Payments = (0, import_model.Provider)((props) => {
134
134
  item.service_fee,
135
135
  2,
136
136
  (state == null ? void 0 : state.amountSymbol) || "$"
137
- ), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time || item.created_at).format(
137
+ ), ")") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-list-item-date" }, (0, import_dayjs.default)(item.payment_time).format(
138
138
  "HH:mm YYYY/MM/DD"
139
139
  ), /* @__PURE__ */ import_react.default.createElement("span", { className: "payment-list-item-platform-type" }, item.platform && import_utils.locales.getText("pisell2.text.platform.type")(
140
140
  item.platform
@@ -43,10 +43,14 @@ var import_usePaymentLogger = __toESM(require("./usePaymentLogger"));
43
43
  var import_utils3 = require("../../booking/utils");
44
44
  var import_pisellos = require("../../ticketBooking/hooks/pisellos");
45
45
  var import_useShopDiscountModule = require("../../ticketBooking/hooks/pisellos/useShopDiscountModule");
46
+ var import_context = require("../../ticketBooking/context");
47
+ var import_utils4 = require("../../ticketBooking/utils");
46
48
  var useWalletPass = (props) => {
47
49
  const { onSelectChange, customAmount, clientId } = props;
48
50
  const logger = (0, import_usePaymentLogger.default)();
49
51
  const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
52
+ const osKey = (0, import_context.useOsKey)();
53
+ const moduleKey = (0, import_utils4.getShopDiscountKey)(osKey || "ticket");
50
54
  const [walletRecommendList, setWalletRecommendList] = (0, import_react.useState)([]);
51
55
  const [userIdentificationCodes, setUserIdentificationCodes] = (0, import_react.useState)(
52
56
  []
@@ -506,7 +510,7 @@ var useWalletPass = (props) => {
506
510
  );
507
511
  setDiscountList(sortedDiscountList);
508
512
  (_a = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a.emit(
509
- "shopDiscount:onSelectedDiscountListChange",
513
+ `${moduleKey}:onSelectedDiscountListChange`,
510
514
  detail
511
515
  );
512
516
  return;
@@ -603,24 +607,27 @@ var useWalletPass = (props) => {
603
607
  }
604
608
  });
605
609
  const handleSelectDiscount = (0, import_ahooks.useMemoizedFn)((value, option) => {
606
- var _a, _b, _c;
610
+ var _a;
607
611
  setLoading(true);
608
- const isSelected = value.includes(option.id);
609
- const detail = shopDiscount.setDiscountSelected({
610
- discountId: option.id,
611
- isSelected
612
- });
613
- if (!((_b = (_a = detail == null ? void 0 : detail.discountList) == null ? void 0 : _a.find((item) => item.id === option.id)) == null ? void 0 : _b.isSelected)) {
612
+ try {
613
+ const isSelected = value.includes(option.id);
614
+ const detail = shopDiscount.setDiscountSelected({
615
+ discountId: option.id,
616
+ isSelected
617
+ });
618
+ const sortedDiscountList = sortDiscountListWithInitialOrder(
619
+ detail.discountList
620
+ );
621
+ setDiscountList(sortedDiscountList);
622
+ (_a = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a.emit(
623
+ `${moduleKey}:onSelectedDiscountListChange`,
624
+ detail
625
+ );
626
+ } catch (err) {
627
+ console.log(err, "1234err");
628
+ } finally {
614
629
  setLoading(false);
615
630
  }
616
- const sortedDiscountList = sortDiscountListWithInitialOrder(
617
- detail.discountList
618
- );
619
- setDiscountList(sortedDiscountList);
620
- (_c = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _c.emit(
621
- "shopDiscount:onSelectedDiscountListChange",
622
- detail
623
- );
624
631
  });
625
632
  const clearDisabledWalletData = (0, import_ahooks.useMemoizedFn)(() => {
626
633
  setDisabledWalletData([]);
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly" | "huifu">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -301,8 +301,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
301
301
  amount?: string | number | undefined;
302
302
  mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
303
303
  order_id?: string | number | undefined;
304
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu" | undefined;
305
- action?: "pay" | "amount" | "deviceList" | undefined;
304
+ eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | "huifu" | undefined;
305
+ action?: "amount" | "pay" | "deviceList" | undefined;
306
306
  key?: number | undefined;
307
307
  step?: number | undefined;
308
308
  title?: string | undefined;
@@ -20,4 +20,5 @@ import PinModal from './pinModal';
20
20
  import PinVerifyModal from './pinVerifyModal';
21
21
  import { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from './authentication/admin';
22
22
  import Registry from './systemSettings/registry';
23
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, };
23
+ import PisellCashCounting from './pisellCashCounting';
24
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, PisellCashCounting, };
@@ -45,6 +45,7 @@ __export(components_exports, {
45
45
  POSOperatorAuth: () => import_admin.POSOperatorAuth,
46
46
  PinModal: () => import_pinModal.default,
47
47
  PinVerifyModal: () => import_pinVerifyModal.default,
48
+ PisellCashCounting: () => import_pisellCashCounting.default,
48
49
  PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
49
50
  ProductExtension: () => import_productExtension.default,
50
51
  Registry: () => import_registry.default,
@@ -83,6 +84,7 @@ var import_pinModal = __toESM(require("./pinModal"));
83
84
  var import_pinVerifyModal = __toESM(require("./pinVerifyModal"));
84
85
  var import_admin = require("./authentication/admin");
85
86
  var import_registry = __toESM(require("./systemSettings/registry"));
87
+ var import_pisellCashCounting = __toESM(require("./pisellCashCounting"));
86
88
  // Annotate the CommonJS export names for ESM import in node:
87
89
  0 && (module.exports = {
88
90
  Booking,
@@ -101,6 +103,7 @@ var import_registry = __toESM(require("./systemSettings/registry"));
101
103
  POSOperatorAuth,
102
104
  PinModal,
103
105
  PinVerifyModal,
106
+ PisellCashCounting,
104
107
  PisellSelectCustomerModal,
105
108
  ProductExtension,
106
109
  Registry,
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { PisellCashCountingProps } from './types';
3
+ import './PisellCashCounting.less';
4
+ declare const PisellCashCounting: React.FC<PisellCashCountingProps>;
5
+ export default PisellCashCounting;