@pisell/private-materials 6.6.99 → 6.6.100
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/footer/utils.js +0 -13
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +3 -42
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +11 -31
- package/es/components/booking/info2/service/editService/utils.d.ts +0 -3
- package/es/components/booking/info2/service/editService/utils.js +19 -128
- package/es/components/booking/info2/utilsByBooking.js +81 -9
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/es/components/eftpos/SettlementModal/Action.d.ts +0 -1
- package/es/components/eftpos/SettlementModal/index.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/mx51/Action.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/utils/index.js +4 -4
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/index.js +4 -2
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/pro/Selector/demo.d.ts +0 -1
- package/es/pro/pisellPaymentList/example.d.ts +0 -1
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/footer/utils.js +1 -8
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +3 -43
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +12 -38
- package/lib/components/booking/info2/service/editService/utils.d.ts +0 -3
- package/lib/components/booking/info2/service/editService/utils.js +12 -94
- package/lib/components/booking/info2/utilsByBooking.js +50 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/lib/components/eftpos/SettlementModal/Action.d.ts +0 -1
- package/lib/components/eftpos/SettlementModal/index.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/mx51/Action.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/utils/index.js +2 -2
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/index.js +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/pro/Selector/demo.d.ts +0 -1
- package/lib/pro/pisellPaymentList/example.d.ts +0 -1
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
- package/package.json +2 -2
|
@@ -92,9 +92,6 @@ var Info = (_, ref) => {
|
|
|
92
92
|
const resourcesRef = (0, import_react.useRef)(null);
|
|
93
93
|
const isChangeTotal = (0, import_react.useRef)(false);
|
|
94
94
|
const shouldReallocateBundlePriceRef = (0, import_react.useRef)(false);
|
|
95
|
-
const isEntitlementPrice = (0, import_utils8.hasEntitlementDiscount)(
|
|
96
|
-
state.service.cacheItem
|
|
97
|
-
);
|
|
98
95
|
const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
|
|
99
96
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
100
97
|
const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
|
|
@@ -250,7 +247,7 @@ var Info = (_, ref) => {
|
|
|
250
247
|
}
|
|
251
248
|
};
|
|
252
249
|
const onFinish = (values, cacheItem) => {
|
|
253
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2
|
|
250
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
|
|
254
251
|
let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
|
|
255
252
|
if (isShowTimeAndResource && !isSuccess) {
|
|
256
253
|
return;
|
|
@@ -284,8 +281,7 @@ var Info = (_, ref) => {
|
|
|
284
281
|
_extend.startDate = startDate;
|
|
285
282
|
_extend.endDate = endDate;
|
|
286
283
|
}
|
|
287
|
-
const
|
|
288
|
-
const shouldReallocatePrice = isManualPriceChange || shouldReallocateBundlePriceRef.current;
|
|
284
|
+
const shouldReallocatePrice = isChangeTotal.current || shouldReallocateBundlePriceRef.current;
|
|
289
285
|
if (shouldReallocatePrice) {
|
|
290
286
|
const discountRatio = new import_decimal.default(values.total).div(_item._extend.origin_total);
|
|
291
287
|
const bundles2 = ((_c2 = _extend == null ? void 0 : _extend.other) == null ? void 0 : _c2.bundle) || [];
|
|
@@ -310,9 +306,7 @@ var Info = (_, ref) => {
|
|
|
310
306
|
_item._time = (/* @__PURE__ */ new Date()).getTime();
|
|
311
307
|
_item._serviceKey = (0, import_utils3.genServiceKey)(_item);
|
|
312
308
|
_item._holderKey = (0, import_utils3.genHolderKey)(_item);
|
|
313
|
-
|
|
314
|
-
const isEntitlementQuantityChange = (0, import_utils8.hasEntitlementDiscount)(previousItem) && Number(_item._extend.quantity || 1) !== Number(((_e2 = previousItem == null ? void 0 : previousItem._extend) == null ? void 0 : _e2.quantity) || 1);
|
|
315
|
-
if (!isEntitlementQuantityChange && (((_g2 = (_f2 = _item._extend) == null ? void 0 : _f2.holder_id) == null ? void 0 : _g2.length) > 1 || ((_h2 = _item._extend) == null ? void 0 : _h2.quantity) > 1 && ((_j2 = (_i2 = _item._extend) == null ? void 0 : _i2.holder_id) == null ? void 0 : _j2.length) >= 1)) {
|
|
309
|
+
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) {
|
|
316
310
|
let holder_ids = _item._extend.holder_id;
|
|
317
311
|
_item._extend.holder_id = holder_ids[0];
|
|
318
312
|
holder_ids = holder_ids.slice(1);
|
|
@@ -331,8 +325,8 @@ var Info = (_, ref) => {
|
|
|
331
325
|
}
|
|
332
326
|
}
|
|
333
327
|
let _id = _item == null ? void 0 : _item._id;
|
|
334
|
-
let groupId = (
|
|
335
|
-
const origin_total = (
|
|
328
|
+
let groupId = (_j2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _j2.groupId;
|
|
329
|
+
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;
|
|
336
330
|
if (groupId) {
|
|
337
331
|
if (shouldReallocatePrice) {
|
|
338
332
|
_item = deleteDiscountList(_item, true);
|
|
@@ -345,7 +339,7 @@ var Info = (_, ref) => {
|
|
|
345
339
|
} else {
|
|
346
340
|
_item = (0, import_utils8.setProductPrice)(_item, {
|
|
347
341
|
newTotal: values.total,
|
|
348
|
-
origin_total: origin_total ?? ((
|
|
342
|
+
origin_total: origin_total ?? ((_o2 = _item._extend) == null ? void 0 : _o2.origin_total)
|
|
349
343
|
});
|
|
350
344
|
const matchById = _list.some((d) => d._id === _id);
|
|
351
345
|
const matchByBooking = !matchById && _list.some((d) => isSameBookingServiceItem(d, _item));
|
|
@@ -354,32 +348,13 @@ var Info = (_, ref) => {
|
|
|
354
348
|
_item = deleteDiscountList(_item, true);
|
|
355
349
|
}
|
|
356
350
|
if (matchById) {
|
|
357
|
-
_list = _list.
|
|
358
|
-
if (d._id !== _id) return [d];
|
|
359
|
-
return (0, import_utils8.updateEntitlementQuantity)(
|
|
360
|
-
d,
|
|
361
|
-
{ ..._item, new: 0 }
|
|
362
|
-
).map((item) => ({
|
|
363
|
-
...item,
|
|
364
|
-
_serviceKey: (0, import_utils3.genServiceKey)(item),
|
|
365
|
-
_holderKey: (0, import_utils3.genHolderKey)(item)
|
|
366
|
-
}));
|
|
367
|
-
});
|
|
351
|
+
_list = _list.map((d) => d._id === _id ? { ..._item, new: 0 } : d);
|
|
368
352
|
} else {
|
|
369
353
|
let replaced = false;
|
|
370
354
|
_list = _list.reduce((acc, d) => {
|
|
371
355
|
if (isSameBookingServiceItem(d, _item)) {
|
|
372
356
|
if (!replaced) {
|
|
373
|
-
acc.push(
|
|
374
|
-
...(0, import_utils8.updateEntitlementQuantity)(
|
|
375
|
-
d,
|
|
376
|
-
{ ..._item, new: 0, _id: d._id }
|
|
377
|
-
).map((item) => ({
|
|
378
|
-
...item,
|
|
379
|
-
_serviceKey: (0, import_utils3.genServiceKey)(item),
|
|
380
|
-
_holderKey: (0, import_utils3.genHolderKey)(item)
|
|
381
|
-
}))
|
|
382
|
-
);
|
|
357
|
+
acc.push({ ..._item, new: 0, _id: d._id });
|
|
383
358
|
replaced = true;
|
|
384
359
|
}
|
|
385
360
|
} else {
|
|
@@ -396,7 +371,7 @@ var Info = (_, ref) => {
|
|
|
396
371
|
(0, import_utils6.deleteCacheParams)();
|
|
397
372
|
console.log("_onFinish", _list);
|
|
398
373
|
form.resetFields();
|
|
399
|
-
if (!!((
|
|
374
|
+
if (!!((_p2 = state.service.cacheItem) == null ? void 0 : _p2.new)) {
|
|
400
375
|
window.dispatchEvent(
|
|
401
376
|
new CustomEvent("onAddNewService", {
|
|
402
377
|
detail: {
|
|
@@ -405,7 +380,7 @@ var Info = (_, ref) => {
|
|
|
405
380
|
})
|
|
406
381
|
);
|
|
407
382
|
}
|
|
408
|
-
(
|
|
383
|
+
(_q2 = window.closeBookingEditModal) == null ? void 0 : _q2.call(window);
|
|
409
384
|
_list.sort((a, b) => {
|
|
410
385
|
var _a3, _b3;
|
|
411
386
|
const aHasHolderId = ((_a3 = a._extend) == null ? void 0 : _a3.holder_id) && (Array.isArray(a._extend.holder_id) ? a._extend.holder_id.length > 0 : true);
|
|
@@ -775,7 +750,7 @@ var Info = (_, ref) => {
|
|
|
775
750
|
precision: 2,
|
|
776
751
|
prefix: state.amountSymbol,
|
|
777
752
|
onChange: handleTotalChange,
|
|
778
|
-
disabled: state.channelDisabledEdit
|
|
753
|
+
disabled: state.channelDisabledEdit,
|
|
779
754
|
originalValue: ((_f2 = (_e2 = state.service.cacheItem) == null ? void 0 : _e2._extend) == null ? void 0 : _f2.origin_total) || 0,
|
|
780
755
|
placeholder: ((_h2 = (_g2 = state.service.cacheItem) == null ? void 0 : _g2._extend) == null ? void 0 : _h2.origin_total) || "0",
|
|
781
756
|
size: "large",
|
|
@@ -792,8 +767,7 @@ var Info = (_, ref) => {
|
|
|
792
767
|
useTotal,
|
|
793
768
|
(_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total,
|
|
794
769
|
state.amountSymbol,
|
|
795
|
-
state.channelDisabledEdit
|
|
796
|
-
isEntitlementPrice
|
|
770
|
+
state.channelDisabledEdit
|
|
797
771
|
]);
|
|
798
772
|
const reason = (0, import_react.useMemo)(() => {
|
|
799
773
|
return isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
判断是否需要进入编辑服务页
|
|
9
9
|
*/
|
|
10
|
-
export declare const hasEntitlementDiscount: (item: any) => boolean;
|
|
11
|
-
/** 已提交部分保留原扣次;增加的数量作为新商品交给 OS 重新计算。 */
|
|
12
|
-
export declare const updateEntitlementQuantity: (previous: any, next: any) => any[];
|
|
13
10
|
export declare const getAutoAllocationStorage: (id: string | number) => any;
|
|
14
11
|
export declare const setAutoAllocationStorage: (data: {
|
|
15
12
|
[key: string]: boolean;
|
|
@@ -31,100 +31,20 @@ var utils_exports = {};
|
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
33
33
|
getProductAllDiscountList: () => getProductAllDiscountList,
|
|
34
|
-
hasEntitlementDiscount: () => hasEntitlementDiscount,
|
|
35
34
|
mergeBundleWithOriginalPrice: () => mergeBundleWithOriginalPrice,
|
|
36
35
|
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
37
|
-
setProductPrice: () => setProductPrice
|
|
38
|
-
updateEntitlementQuantity: () => updateEntitlementQuantity
|
|
36
|
+
setProductPrice: () => setProductPrice
|
|
39
37
|
});
|
|
40
38
|
module.exports = __toCommonJS(utils_exports);
|
|
41
39
|
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_utils2 = require("@pisell/utils");
|
|
42
41
|
var import_decimal = __toESM(require("decimal.js"));
|
|
43
|
-
var
|
|
44
|
-
var import_utils2 = require("../../../components/footer/utils");
|
|
45
|
-
var import_utils3 = require("../../../utils");
|
|
46
|
-
var isEntitlementDiscount = (discount) => ((discount == null ? void 0 : discount.tag) || (discount == null ? void 0 : discount.type)) === "entitlement_pass";
|
|
47
|
-
var getServiceDiscounts = (item) => {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
return [
|
|
50
|
-
...(item == null ? void 0 : item.discount_list) || [],
|
|
51
|
-
...(((_b = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []).flatMap((bundle) => bundle.discount_list || [])
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
var hasEntitlementDiscount = (item) => getServiceDiscounts(item).some(isEntitlementDiscount);
|
|
55
|
-
var updateEntitlementQuantity = (previous, next) => {
|
|
56
|
-
var _a, _b, _c, _d;
|
|
57
|
-
const discounts = getServiceDiscounts(previous);
|
|
58
|
-
const persisted = [previous == null ? void 0 : previous.booking_id, previous == null ? void 0 : previous.order_detail_id, (_a = previous == null ? void 0 : previous._extend) == null ? void 0 : _a.order_detail_id].some((value) => Number(value) > 0) || discounts.some((discount) => isEntitlementDiscount(discount) && discount.id);
|
|
59
|
-
const previousQuantity = Number(((_b = previous == null ? void 0 : previous._extend) == null ? void 0 : _b.quantity) || 1);
|
|
60
|
-
const nextQuantity = Number(next._extend.quantity || 1);
|
|
61
|
-
if (!persisted || !hasEntitlementDiscount(previous) || nextQuantity === previousQuantity) {
|
|
62
|
-
return [next];
|
|
63
|
-
}
|
|
64
|
-
if (nextQuantity < previousQuantity) {
|
|
65
|
-
return [{
|
|
66
|
-
...previous,
|
|
67
|
-
_extend: {
|
|
68
|
-
...previous._extend,
|
|
69
|
-
quantity: nextQuantity,
|
|
70
|
-
...Array.isArray(next._extend.holder_id) ? { holder_id: next._extend.holder_id.slice(0, nextQuantity) } : {},
|
|
71
|
-
other: { ...previous._extend.other, quantity: nextQuantity }
|
|
72
|
-
},
|
|
73
|
-
discount_list: (previous.discount_list || []).map((discount) => {
|
|
74
|
-
var _a2, _b2;
|
|
75
|
-
if (!isEntitlementDiscount(discount) || ((_a2 = discount.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id)) return discount;
|
|
76
|
-
const num = Math.min(Number(((_b2 = discount.metadata) == null ? void 0 : _b2.num) ?? previousQuantity), nextQuantity);
|
|
77
|
-
return { ...discount, _num: num, metadata: { ...discount.metadata, num } };
|
|
78
|
-
})
|
|
79
|
-
}];
|
|
80
|
-
}
|
|
81
|
-
const appended = (0, import_lodash.cloneDeep)(next);
|
|
82
|
-
const uid = (0, import_utils.getUniqueId)();
|
|
83
|
-
appended._id = uid;
|
|
84
|
-
appended.booking_id = 0;
|
|
85
|
-
appended.order_detail_id = 0;
|
|
86
|
-
appended.new = 0;
|
|
87
|
-
appended.discount_list = [];
|
|
88
|
-
appended.discount_amount = 0;
|
|
89
|
-
appended.metadata = { ...appended.metadata, unique_identification_number: uid };
|
|
90
|
-
delete appended.metadata.entitlement_source_identity;
|
|
91
|
-
delete appended.metadata.entitlement_source_product_uid;
|
|
92
|
-
if (appended._origin) delete appended._origin.booking_id;
|
|
93
|
-
const extend = appended._extend;
|
|
94
|
-
extend.order_detail_id = 0;
|
|
95
|
-
extend.unique_identification_number = uid;
|
|
96
|
-
extend.quantity = nextQuantity - previousQuantity;
|
|
97
|
-
if (Array.isArray(extend.holder_id)) {
|
|
98
|
-
const holders = extend.holder_id.slice(previousQuantity, nextQuantity);
|
|
99
|
-
extend.holder_id = holders.length ? holders : void 0;
|
|
100
|
-
}
|
|
101
|
-
extend.other = { ...extend.other, quantity: extend.quantity };
|
|
102
|
-
extend.other.bundle = (extend.other.bundle || []).map((bundle) => {
|
|
103
|
-
var _a2, _b2, _c2;
|
|
104
|
-
const price = bundle.original_price ?? ((_c2 = (_b2 = (_a2 = bundle.discount_list) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.discount) == null ? void 0 : _c2.original_amount) ?? bundle.product_price ?? bundle.price;
|
|
105
|
-
const bundleUid = (0, import_utils.getUniqueId)();
|
|
106
|
-
const metadata = { ...bundle.metadata, custom_product_bundle_map_id: bundleUid, unique_identification_number: bundleUid };
|
|
107
|
-
delete metadata.entitlement_source_identity;
|
|
108
|
-
return { ...bundle, _id: bundleUid, price, bundle_selling_price: price, discount_list: [], metadata };
|
|
109
|
-
});
|
|
110
|
-
const mainDiscount = (next.discount_list || []).find((discount) => {
|
|
111
|
-
var _a2, _b2;
|
|
112
|
-
return !((_a2 = discount.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id) && ((_b2 = discount.discount) == null ? void 0 : _b2.original_amount) != null;
|
|
113
|
-
});
|
|
114
|
-
if (mainDiscount && ((_d = (_c = previous == null ? void 0 : previous._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.product_variant_id) === extend.other.product_variant_id) {
|
|
115
|
-
extend.price = Number(mainDiscount.discount.original_amount);
|
|
116
|
-
if (extend.other.product_variant_id) extend.other.price = extend.price;
|
|
117
|
-
}
|
|
118
|
-
extend.main_product_selling_price = (0, import_utils3.getMainPrice)(appended);
|
|
119
|
-
extend.total = (0, import_utils3.getProductTotalPrice)(appended);
|
|
120
|
-
extend.origin_total = extend.total;
|
|
121
|
-
return [previous, appended];
|
|
122
|
-
};
|
|
42
|
+
var import_utils3 = require("../../../components/footer/utils");
|
|
123
43
|
var getAutoAllocationStorage = (id) => {
|
|
124
44
|
const value = localStorage.getItem("resource-auto-allocation");
|
|
125
45
|
if (value) {
|
|
126
46
|
const valueObj = JSON.parse(value);
|
|
127
|
-
return (0,
|
|
47
|
+
return (0, import_utils2.isBoolean)(valueObj[id]) ? valueObj[id] : true;
|
|
128
48
|
}
|
|
129
49
|
return true;
|
|
130
50
|
};
|
|
@@ -138,8 +58,8 @@ var setAutoAllocationStorage = (data) => {
|
|
|
138
58
|
}
|
|
139
59
|
};
|
|
140
60
|
var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
|
|
141
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
142
|
-
if (
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
62
|
+
if (((_a = cacheItem == null ? void 0 : cacheItem.discount_list) == null ? void 0 : _a.length) && ((cacheItem == null ? void 0 : cacheItem.discount_list) || []).some((item) => ["good_pass", "discount_card", "product_discount_card"].includes(
|
|
143
63
|
item.type
|
|
144
64
|
))) {
|
|
145
65
|
return cacheItem;
|
|
@@ -149,16 +69,16 @@ var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
|
|
|
149
69
|
}
|
|
150
70
|
const discountRatio = new import_decimal.default(newTotal).div(new import_decimal.default(origin_total));
|
|
151
71
|
let subTotal = new import_decimal.default(0);
|
|
152
|
-
if (((
|
|
153
|
-
(
|
|
72
|
+
if (((_b = cacheItem._extend.other) == null ? void 0 : _b.bundle) && (0, import_utils.isArr)((_c = cacheItem._extend.other) == null ? void 0 : _c.bundle)) {
|
|
73
|
+
(_e = (_d = cacheItem._extend.other) == null ? void 0 : _d.bundle) == null ? void 0 : _e.forEach((bundle) => {
|
|
154
74
|
const newPrice = new import_decimal.default(bundle.original_price || bundle.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
155
75
|
const quantity = bundle.num ?? bundle.quantity ?? 1;
|
|
156
76
|
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
157
77
|
bundle.price = newPrice;
|
|
158
78
|
});
|
|
159
79
|
}
|
|
160
|
-
if (((
|
|
161
|
-
(
|
|
80
|
+
if (((_f = cacheItem._extend.other) == null ? void 0 : _f.option) && (0, import_utils.isArr)((_g = cacheItem._extend.other) == null ? void 0 : _g.option)) {
|
|
81
|
+
(_i = (_h = cacheItem._extend.other) == null ? void 0 : _h.option) == null ? void 0 : _i.forEach((option) => {
|
|
162
82
|
const newPrice = new import_decimal.default(option.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
163
83
|
const quantity = option.num ?? option.quantity ?? 1;
|
|
164
84
|
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
@@ -171,7 +91,7 @@ var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
|
|
|
171
91
|
var getProductAllDiscountList = (cacheItem) => {
|
|
172
92
|
var _a, _b;
|
|
173
93
|
const discountList = [...cacheItem.discount_list || []];
|
|
174
|
-
const bundleDiscountList = (0,
|
|
94
|
+
const bundleDiscountList = (0, import_utils3.getBundleDiscountList)(((_b = (_a = cacheItem._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []) || [];
|
|
175
95
|
discountList.push(...bundleDiscountList);
|
|
176
96
|
return discountList;
|
|
177
97
|
};
|
|
@@ -193,9 +113,7 @@ var mergeBundleWithOriginalPrice = (other, originalOther) => {
|
|
|
193
113
|
0 && (module.exports = {
|
|
194
114
|
getAutoAllocationStorage,
|
|
195
115
|
getProductAllDiscountList,
|
|
196
|
-
hasEntitlementDiscount,
|
|
197
116
|
mergeBundleWithOriginalPrice,
|
|
198
117
|
setAutoAllocationStorage,
|
|
199
|
-
setProductPrice
|
|
200
|
-
updateEntitlementQuantity
|
|
118
|
+
setProductPrice
|
|
201
119
|
});
|
|
@@ -61,6 +61,36 @@ var isConflict = (event, current) => {
|
|
|
61
61
|
}
|
|
62
62
|
return _isBefore && _isAfter;
|
|
63
63
|
};
|
|
64
|
+
var getMaxConcurrentPax = (eventList, currentStart, currentEnd, aggregatedCurrentEvent, restoredCurrentPax = 0) => {
|
|
65
|
+
const eventRanges = (eventList || []).map((event) => ({
|
|
66
|
+
event,
|
|
67
|
+
start: (0, import_dayjs.default)(event.start_at),
|
|
68
|
+
end: (0, import_dayjs.default)(event.end_at)
|
|
69
|
+
})).filter(({ start, end }) => start.isValid() && end.isValid() && end.isAfter(start));
|
|
70
|
+
const eventCheckpoints = eventRanges.reduce((points, { start, end }) => {
|
|
71
|
+
points.push(
|
|
72
|
+
Math.max(start.valueOf(), currentStart.valueOf()),
|
|
73
|
+
Math.min(end.valueOf(), currentEnd.valueOf())
|
|
74
|
+
);
|
|
75
|
+
return points;
|
|
76
|
+
}, []);
|
|
77
|
+
const checkpoints = Array.from(/* @__PURE__ */ new Set([
|
|
78
|
+
currentStart.valueOf(),
|
|
79
|
+
currentEnd.valueOf(),
|
|
80
|
+
...eventCheckpoints
|
|
81
|
+
])).sort((a, b) => a - b);
|
|
82
|
+
return checkpoints.reduce((maxPax, point) => {
|
|
83
|
+
const currentPax = eventRanges.reduce((sum, { event, start, end }) => {
|
|
84
|
+
if (start.valueOf() <= point && end.valueOf() > point) {
|
|
85
|
+
const pax = Number(event.pax || 0);
|
|
86
|
+
const isAggregatedCurrent = aggregatedCurrentEvent && event === aggregatedCurrentEvent;
|
|
87
|
+
return sum + Math.max(0, pax - (isAggregatedCurrent ? restoredCurrentPax : 0));
|
|
88
|
+
}
|
|
89
|
+
return sum;
|
|
90
|
+
}, 0);
|
|
91
|
+
return Math.max(maxPax, currentPax);
|
|
92
|
+
}, 0);
|
|
93
|
+
};
|
|
64
94
|
var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
65
95
|
const startDate = (0, import_dayjs.default)((0, import_dayjs.default)(cacheItem._extend.start_date).format("YYYY-MM-DD") + " " + (0, import_utils2.getServeStartTime)(cacheItem._extend.start_time));
|
|
66
96
|
const isFlexible = import_utils2.flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
@@ -72,7 +102,8 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
72
102
|
let timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(1, "second");
|
|
73
103
|
let totalCount = getUseableEventCount(time.event_list, resourceItem.capacity);
|
|
74
104
|
const currentCount = getSumCapacity({ cacheItem });
|
|
75
|
-
|
|
105
|
+
const sourceEventList = time.event_list || [];
|
|
106
|
+
let eventList = sourceEventList;
|
|
76
107
|
if (cacheItem == null ? void 0 : cacheItem.booking_id) {
|
|
77
108
|
eventList = eventList.filter((event) => event.id !== (cacheItem == null ? void 0 : cacheItem.booking_id));
|
|
78
109
|
}
|
|
@@ -103,7 +134,24 @@ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
|
|
|
103
134
|
isCountRange = false;
|
|
104
135
|
}
|
|
105
136
|
} else {
|
|
106
|
-
|
|
137
|
+
const currentEventExistsInResponse = sourceEventList.some(
|
|
138
|
+
(event) => event.id === (cacheItem == null ? void 0 : cacheItem.booking_id)
|
|
139
|
+
);
|
|
140
|
+
const exactAggregatedCurrentEvent = !currentEventExistsInResponse && endDate ? conflict.find((event) => {
|
|
141
|
+
const eventStart = (0, import_dayjs.default)(event.start_at);
|
|
142
|
+
const eventEnd = (0, import_dayjs.default)(event.end_at);
|
|
143
|
+
return eventStart.isSame(startDate) && eventEnd.isSame(endDate);
|
|
144
|
+
}) : void 0;
|
|
145
|
+
const aggregatedCurrentEvent = exactAggregatedCurrentEvent;
|
|
146
|
+
const restoredCurrentPax = aggregatedCurrentEvent ? Math.min(currentCount, Number(aggregatedCurrentEvent.pax || 0)) : 0;
|
|
147
|
+
const concurrentPax = endDate ? getMaxConcurrentPax(
|
|
148
|
+
conflict,
|
|
149
|
+
startDate,
|
|
150
|
+
endDate,
|
|
151
|
+
aggregatedCurrentEvent,
|
|
152
|
+
restoredCurrentPax
|
|
153
|
+
) : conflict.reduce((sum, event) => sum + Number(event.pax || 0), 0);
|
|
154
|
+
const conflictCount = Number(resourceItem.capacity || 0) - concurrentPax;
|
|
107
155
|
if (currentCount <= conflictCount) {
|
|
108
156
|
isCountRange = true;
|
|
109
157
|
} else {
|
|
@@ -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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
}
|
|
181
|
+
};
|
|
182
182
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
183
183
|
export declare const getIsEdit: (state: any) => boolean;
|
|
184
184
|
export {};
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "
|
|
11
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PosProps, RouteType } from './const';
|
|
3
2
|
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
|
4
3
|
action: RouteType;
|
|
@@ -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: "
|
|
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<"
|
|
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<"tyro" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat">;
|
|
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: "
|
|
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?: "pay" | "
|
|
302
|
+
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
303
303
|
order_id?: string | number | undefined;
|
|
304
|
-
eftpos?: "tyro" | "
|
|
305
|
-
action?: "
|
|
304
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat" | 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?: "
|
|
315
|
+
status?: "loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
316
316
|
warn?: string | undefined;
|
|
317
317
|
steps?: {
|
|
318
318
|
/** 用于重置当前步骤 */
|