@pisell/private-materials 6.6.39 → 6.6.40

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 (59) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/booking/addons/model.d.ts +10 -1
  8. package/es/components/booking/forms/model.d.ts +10 -1
  9. package/es/components/booking/info/model.d.ts +10 -1
  10. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  11. package/es/components/booking/info/service2/utils.d.ts +1 -1
  12. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  13. package/es/components/booking/info2/service/editService/index.js +25 -0
  14. package/es/components/booking/model.d.ts +9 -1
  15. package/es/components/booking/notes/model.d.ts +10 -1
  16. package/es/components/booking/payments/model.d.ts +10 -1
  17. package/es/components/booking/utils.d.ts +2 -2
  18. package/es/components/eftposPay/amount.d.ts +1 -1
  19. package/es/components/eftposPay/device.d.ts +1 -1
  20. package/es/components/eftposPay/hooks.d.ts +2 -2
  21. package/es/components/eftposPay/store/index.d.ts +5 -5
  22. package/es/components/pay/toC/model.d.ts +9 -1
  23. package/es/components/schedules/model.d.ts +9 -1
  24. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  25. package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  26. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  27. package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  28. package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  29. package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  30. package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  31. package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  32. package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  33. package/lib/components/booking/addons/model.d.ts +10 -1
  34. package/lib/components/booking/forms/model.d.ts +10 -1
  35. package/lib/components/booking/info/model.d.ts +10 -1
  36. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  37. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  38. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  39. package/lib/components/booking/info2/service/editService/index.js +25 -7
  40. package/lib/components/booking/model.d.ts +9 -1
  41. package/lib/components/booking/notes/model.d.ts +10 -1
  42. package/lib/components/booking/payments/model.d.ts +10 -1
  43. package/lib/components/booking/utils.d.ts +2 -2
  44. package/lib/components/eftposPay/amount.d.ts +1 -1
  45. package/lib/components/eftposPay/device.d.ts +1 -1
  46. package/lib/components/eftposPay/hooks.d.ts +2 -2
  47. package/lib/components/eftposPay/store/index.d.ts +5 -5
  48. package/lib/components/pay/toC/model.d.ts +9 -1
  49. package/lib/components/schedules/model.d.ts +9 -1
  50. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  51. package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  52. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  53. package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  54. package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  55. package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  56. package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  57. package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  58. package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  59. package/package.json +1 -1
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -216,4 +216,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
216
216
  * @Author: WangHan
217
217
  * @Date: 2024-12-24 11:32
218
218
  */
219
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
219
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -50,6 +50,7 @@ import dayjs from "dayjs";
50
50
  import { createBookingItemsByGroup, getGroupTotalPrice } from "../../../info/service2/Group/utils";
51
51
  import { useShopDiscountModule } from "../../../../ticketBooking/hooks/pisellos/useShopDiscountModule";
52
52
  import DiscountChangeModal from "./DiscountChangeModal";
53
+ import Decimal from "decimal.js";
53
54
  var submitLock = false;
54
55
  var Info = function Info(_, ref) {
55
56
  var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI5, _state$service$cacheI7, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI12, _state$bookingConfig5, _state$service$cacheI13, _state$service$cacheI14, _state$service9, _state$service$resour2, _state$service$cacheI16, _state$service$cacheI17, _state$client2;
@@ -346,6 +347,30 @@ var Info = function Info(_, ref) {
346
347
  _extend.startDate = startDate;
347
348
  _extend.endDate = endDate;
348
349
  }
350
+ if (isChangeTotal.current) {
351
+ var _extend$other, _extend$other2;
352
+ // 计算折扣比例
353
+ var discountRatio = new Decimal(values.total).div(_item._extend.origin_total);
354
+
355
+ // 处理子商品
356
+ var _bundles = (_extend === null || _extend === void 0 || (_extend$other = _extend.other) === null || _extend$other === void 0 ? void 0 : _extend$other.bundle) || [];
357
+ var childProductsTotal = new Decimal(0);
358
+ if (_bundles.length > 0) {
359
+ _bundles.forEach(function (bundle) {
360
+ // 计算子商品折扣后的单价(保留两位小数)
361
+ var discountedPrice = new Decimal(bundle.original_price).mul(discountRatio).toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
362
+ bundle.bundle_selling_price = discountedPrice.toNumber();
363
+
364
+ // 累计子商品折扣后总价
365
+ childProductsTotal = childProductsTotal.add(discountedPrice.mul(bundle.quantity));
366
+ });
367
+ }
368
+
369
+ // 计算主商品折扣后的单价
370
+ var mainProductTotal = new Decimal(values.total).sub(childProductsTotal);
371
+ var mainProductQuantity = ((_extend$other2 = _extend.other) === null || _extend$other2 === void 0 ? void 0 : _extend$other2.quantity) || _extend.quantity || 1;
372
+ _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
373
+ }
349
374
  if (_extend.bundle_edit !== undefined) {
350
375
  _extend.bundle_edit = 1;
351
376
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -109,4 +110,11 @@ export declare const walkInData: {
109
110
  id: number;
110
111
  nickname: string;
111
112
  };
112
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -175,10 +175,10 @@ export declare const getProductOriginTotalPrice: (item: any) => number;
175
175
  export declare const getDuration: (duration: number | {
176
176
  type: string;
177
177
  value: number;
178
- }) => number | {
178
+ }) => number | "flexible" | {
179
179
  type: string;
180
180
  value: number;
181
- } | "flexible";
181
+ };
182
182
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
183
183
  export declare const getIsEdit: (state: any) => boolean;
184
184
  export {};
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -178,7 +178,7 @@ export declare const updateCustom: (payload: {
178
178
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
179
179
  type: EActionTypes;
180
180
  payload: {
181
- status: "success" | "warn" | "loading" | "fail" | "question";
181
+ status: "loading" | "success" | "warn" | "fail" | "question";
182
182
  };
183
183
  };
184
184
  /**
@@ -299,10 +299,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
299
299
  name?: string | undefined;
300
300
  symbol?: string | undefined;
301
301
  amount?: string | number | undefined;
302
- mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
302
+ mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
303
303
  order_id?: string | number | undefined;
304
- eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu" | undefined;
305
- action?: "amount" | "pay" | "deviceList" | undefined;
304
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu" | undefined;
305
+ action?: "pay" | "amount" | "deviceList" | undefined;
306
306
  key?: number | undefined;
307
307
  step?: number | undefined;
308
308
  title?: string | undefined;
@@ -312,7 +312,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
312
312
  net?: boolean | undefined;
313
313
  component?: string | undefined;
314
314
  form?: string | undefined;
315
- status?: "success" | "warn" | "loading" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
315
+ status?: "loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
316
316
  warn?: string | undefined;
317
317
  steps?: {
318
318
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -29,4 +30,11 @@ export interface PayGroup {
29
30
  _order: any;
30
31
  front_order_uuid?: string;
31
32
  }
32
- export declare const Provider: any, Context: any;
33
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
34
+ state: FormState;
35
+ } & {
36
+ dispatch: (params: {
37
+ type: string;
38
+ payload: any;
39
+ }) => void;
40
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,4 +69,11 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: any, Context: any;
72
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
+ state: FormState;
74
+ } & {
75
+ dispatch: (params: {
76
+ type: string;
77
+ payload: any;
78
+ }) => void;
79
+ }>;
@@ -47,7 +47,7 @@ declare type ScanData = {
47
47
  };
48
48
  };
49
49
  export declare const formatScanCustomer: (data: ScanData) => {
50
- searchType: "customer" | "product" | "walletPass" | "wallet" | "local_product";
50
+ searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
51
51
  data: any;
52
52
  scanCode: string;
53
53
  } | null;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Capacity: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
5
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
6
  export default Capacity;
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const CardMask: ({ props }: {
5
5
  props: SkuStatusOverlayConfig;
6
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
7
7
  export default CardMask;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const Countdown: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
7
7
  export default Countdown;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Duration: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
5
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
6
  export default Duration;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const MemberPrice: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
7
7
  export default MemberPrice;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Resource: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
5
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
6
  export default Resource;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Stock: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
5
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
6
  export default Stock;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Time: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
5
+ }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
6
  export default Time;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -216,4 +216,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
216
216
  * @Author: WangHan
217
217
  * @Date: 2024-12-24 11:32
218
218
  */
219
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
219
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -63,6 +63,7 @@ var import_dayjs = __toESM(require("dayjs"));
63
63
  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
+ var import_decimal = __toESM(require("decimal.js"));
66
67
  var submitLock = false;
67
68
  var Info = (_, ref) => {
68
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;
@@ -236,7 +237,7 @@ var Info = (_, ref) => {
236
237
  }
237
238
  };
238
239
  const onFinish = (values, cacheItem) => {
239
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2;
240
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
240
241
  let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
241
242
  if (isShowTimeAndResource && !isSuccess) {
242
243
  return;
@@ -270,6 +271,23 @@ var Info = (_, ref) => {
270
271
  _extend.startDate = startDate;
271
272
  _extend.endDate = endDate;
272
273
  }
274
+ if (isChangeTotal.current) {
275
+ const discountRatio = new import_decimal.default(values.total).div(_item._extend.origin_total);
276
+ const bundles2 = ((_c2 = _extend == null ? void 0 : _extend.other) == null ? void 0 : _c2.bundle) || [];
277
+ let childProductsTotal = new import_decimal.default(0);
278
+ if (bundles2.length > 0) {
279
+ bundles2.forEach((bundle) => {
280
+ const discountedPrice = new import_decimal.default(bundle.original_price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
281
+ bundle.bundle_selling_price = discountedPrice.toNumber();
282
+ childProductsTotal = childProductsTotal.add(
283
+ discountedPrice.mul(bundle.quantity)
284
+ );
285
+ });
286
+ }
287
+ const mainProductTotal = new import_decimal.default(values.total).sub(childProductsTotal);
288
+ const mainProductQuantity = ((_d2 = _extend.other) == null ? void 0 : _d2.quantity) || _extend.quantity || 1;
289
+ _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
290
+ }
273
291
  if (_extend.bundle_edit !== void 0) {
274
292
  _extend.bundle_edit = 1;
275
293
  }
@@ -277,7 +295,7 @@ var Info = (_, ref) => {
277
295
  _item._time = (/* @__PURE__ */ new Date()).getTime();
278
296
  _item._serviceKey = (0, import_utils3.genServiceKey)(_item);
279
297
  _item._holderKey = (0, import_utils3.genHolderKey)(_item);
280
- if (((_d2 = (_c2 = _item._extend) == null ? void 0 : _c2.holder_id) == null ? void 0 : _d2.length) > 1 || ((_e2 = _item._extend) == null ? void 0 : _e2.quantity) > 1 && ((_g2 = (_f2 = _item._extend) == null ? void 0 : _f2.holder_id) == null ? void 0 : _g2.length) >= 1) {
298
+ if (((_f2 = (_e2 = _item._extend) == null ? void 0 : _e2.holder_id) == null ? void 0 : _f2.length) > 1 || ((_g2 = _item._extend) == null ? void 0 : _g2.quantity) > 1 && ((_i2 = (_h2 = _item._extend) == null ? void 0 : _h2.holder_id) == null ? void 0 : _i2.length) >= 1) {
281
299
  let holder_ids = _item._extend.holder_id;
282
300
  _item._extend.holder_id = holder_ids[0];
283
301
  holder_ids = holder_ids.slice(1);
@@ -296,11 +314,11 @@ var Info = (_, ref) => {
296
314
  }
297
315
  }
298
316
  let _id = _item == null ? void 0 : _item._id;
299
- let groupId = (_h2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _h2.groupId;
300
- const origin_total = (_l2 = (_k2 = (_j2 = (_i2 = _item._extend) == null ? void 0 : _i2.items) == null ? void 0 : _j2[0]) == null ? void 0 : _k2._extend) == null ? void 0 : _l2.origin_total;
317
+ let groupId = (_j2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _j2.groupId;
318
+ const origin_total = (_n2 = (_m2 = (_l2 = (_k2 = _item._extend) == null ? void 0 : _k2.items) == null ? void 0 : _l2[0]) == null ? void 0 : _m2._extend) == null ? void 0 : _n2.origin_total;
301
319
  _item = (0, import_utils8.setProductPrice)(_item, {
302
320
  newTotal: values.total,
303
- origin_total: origin_total ?? ((_m2 = _item._extend) == null ? void 0 : _m2.origin_total)
321
+ origin_total: origin_total ?? ((_o2 = _item._extend) == null ? void 0 : _o2.origin_total)
304
322
  });
305
323
  if (groupId) {
306
324
  if (isChangeTotal.current) {
@@ -325,7 +343,7 @@ var Info = (_, ref) => {
325
343
  (0, import_utils6.deleteCacheParams)();
326
344
  console.log("_onFinish", _list);
327
345
  form.resetFields();
328
- if (!!((_n2 = state.service.cacheItem) == null ? void 0 : _n2.new)) {
346
+ if (!!((_p2 = state.service.cacheItem) == null ? void 0 : _p2.new)) {
329
347
  window.dispatchEvent(
330
348
  new CustomEvent("onAddNewService", {
331
349
  detail: {
@@ -334,7 +352,7 @@ var Info = (_, ref) => {
334
352
  })
335
353
  );
336
354
  }
337
- (_o2 = window.closeBookingEditModal) == null ? void 0 : _o2.call(window);
355
+ (_q2 = window.closeBookingEditModal) == null ? void 0 : _q2.call(window);
338
356
  _list.sort((a, b) => {
339
357
  var _a3, _b3;
340
358
  const aHasHolderId = ((_a3 = a._extend) == null ? void 0 : _a3.holder_id) && (Array.isArray(a._extend.holder_id) ? a._extend.holder_id.length > 0 : true);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -109,4 +110,11 @@ export declare const walkInData: {
109
110
  id: number;
110
111
  nickname: string;
111
112
  };
112
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -175,10 +175,10 @@ export declare const getProductOriginTotalPrice: (item: any) => number;
175
175
  export declare const getDuration: (duration: number | {
176
176
  type: string;
177
177
  value: number;
178
- }) => number | {
178
+ }) => number | "flexible" | {
179
179
  type: string;
180
180
  value: number;
181
- } | "flexible";
181
+ };
182
182
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
183
183
  export declare const getIsEdit: (state: any) => boolean;
184
184
  export {};
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };