@pisell/private-materials 6.4.81 → 6.4.82
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.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/booking/addons/index.js +1 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +48 -34
- package/es/components/booking/components/footer/utils.js +38 -38
- package/es/components/booking/components/voucher/index.js +3 -1
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.js +4 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/es/components/booking/info2/service/editNormalService/index.js +6 -0
- package/es/components/booking/info2/service/editService/index.js +16 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/es/components/booking/info2/service/editService/utils.js +66 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/checkout/components/AmountSummary/index.less +4 -5
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +29 -15
- package/lib/components/booking/components/footer/utils.js +8 -8
- package/lib/components/booking/components/voucher/index.js +4 -2
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.js +2 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
- package/lib/components/booking/info2/service/editService/index.js +12 -3
- package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/lib/components/booking/info2/service/editService/utils.js +40 -3
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/checkout/components/AmountSummary/index.less +4 -5
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
- package/package.json +1 -1
|
@@ -22,7 +22,6 @@ import { useControllableValue } from 'ahooks';
|
|
|
22
22
|
import { merge, omit } from 'lodash';
|
|
23
23
|
//@ts-ignore
|
|
24
24
|
import { locales } from '@pisell/utils';
|
|
25
|
-
import { VirtualInput } from '@pisell/materials';
|
|
26
25
|
import Shortcuts from "../shortcuts";
|
|
27
26
|
import CashKeyboardSimple from "./CashKeyboardSimple";
|
|
28
27
|
import { setKeyboardTheme } from "../../utils";
|
|
@@ -30,6 +29,7 @@ import "./index.less";
|
|
|
30
29
|
import Decimal from 'decimal.js';
|
|
31
30
|
import { AutoResizeText } from '@pisell/materials';
|
|
32
31
|
import { formatAmountWithOptions } from '@pisell/utils';
|
|
32
|
+
import { Iconfont } from '@pisell/materials';
|
|
33
33
|
var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
34
34
|
var _mergedDisplayField$b, _mergedDisplayField$c, _mergedDisplayField$c2;
|
|
35
35
|
var amountSymbol = props.amountSymbol,
|
|
@@ -251,47 +251,52 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
251
251
|
showCurrencySymbol: true
|
|
252
252
|
}))))), ((_mergedDisplayField$c = mergedDisplayField.cashReceived) === null || _mergedDisplayField$c === void 0 ? void 0 : _mergedDisplayField$c.visible) && /*#__PURE__*/React.createElement("div", {
|
|
253
253
|
style: _objectSpread(_objectSpread({}, getGridStyle(1)), {}, {
|
|
254
|
-
padding: '
|
|
254
|
+
padding: '0px 16px',
|
|
255
255
|
borderRadius: '8px',
|
|
256
256
|
backgroundColor: 'white',
|
|
257
257
|
boxShadow: 'inset 0 2px 4px rgba(16, 24, 40, 0.08), inset 0 -2px 4px rgba(16, 24, 40, 0.08), inset 2px 0 4px rgba(16, 24, 40, 0.08), inset -2px 0 4px rgba(16, 24, 40, 0.08)',
|
|
258
258
|
overflow: 'hidden',
|
|
259
259
|
maxWidth: 188,
|
|
260
260
|
cursor: 'pointer',
|
|
261
|
-
border: '1px solid #7f56da'
|
|
261
|
+
border: '1px solid #7f56da',
|
|
262
|
+
borderBottom: '1px solid #7f56da'
|
|
262
263
|
}),
|
|
263
264
|
onClick: function onClick() {
|
|
264
265
|
setIsShowModal(true);
|
|
265
266
|
}
|
|
266
|
-
}, /*#__PURE__*/React.createElement(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
267
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
268
|
+
className: "pisell-cash-keyboard-intact-container-top",
|
|
269
|
+
style: _objectSpread(_objectSpread({}, getGridStyle(0)), {}, {
|
|
270
|
+
overflow: 'hidden',
|
|
271
|
+
padding: '5px 0'
|
|
272
|
+
})
|
|
273
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
className: "pisell-cash-keyboard-intact-container-top-label"
|
|
275
|
+
}, mergedDisplayField.cashReceived.label), /*#__PURE__*/React.createElement("div", {
|
|
276
|
+
className: "pisell-cash-keyboard-intact-container-top-value"
|
|
277
|
+
}, /*#__PURE__*/React.createElement(AutoResizeText, {
|
|
278
|
+
minFontSizePx: 10,
|
|
279
|
+
maxFontSizePx: 18,
|
|
280
|
+
fontSizePrecisionPx: 0.5,
|
|
281
|
+
style: {
|
|
282
|
+
color: '#7f56da',
|
|
283
|
+
textDecoration: 'underline',
|
|
284
|
+
textUnderlineOffset: '3px'
|
|
285
|
+
}
|
|
286
|
+
}, internalValue ? formatAmountWithOptions(internalValue || '', amountSymbol, {
|
|
287
|
+
value: internalValue,
|
|
288
|
+
hideDecimalForWholeNumbers: false,
|
|
289
|
+
precision: 2,
|
|
290
|
+
showCurrencySymbol: true
|
|
291
|
+
}) : ''), /*#__PURE__*/React.createElement(Iconfont, {
|
|
292
|
+
type: "pisell2-edit-05",
|
|
287
293
|
style: {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
width: '100%'
|
|
294
|
+
color: '#7f56da',
|
|
295
|
+
fontSize: '18px',
|
|
296
|
+
marginLeft: '4px',
|
|
297
|
+
marginTop: '4px'
|
|
293
298
|
}
|
|
294
|
-
})), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
})))), ((_mergedDisplayField$c2 = mergedDisplayField.changeDue) === null || _mergedDisplayField$c2 === void 0 ? void 0 : _mergedDisplayField$c2.visible) && /*#__PURE__*/React.createElement("div", {
|
|
295
300
|
className: "pisell-cash-keyboard-intact-container-top",
|
|
296
301
|
style: _objectSpread(_objectSpread({}, getGridStyle(2)), {}, {
|
|
297
302
|
overflow: 'hidden'
|
|
@@ -374,18 +374,14 @@ var getDiscountAmount = (discounts) => {
|
|
|
374
374
|
}, new import_decimal.default(0)).toNumber();
|
|
375
375
|
};
|
|
376
376
|
var getMainProductTotal = (item) => {
|
|
377
|
-
var _a, _b, _c, _d;
|
|
378
|
-
let total = new import_decimal.default(item._extend.main_product_selling_price
|
|
379
|
-
if (
|
|
380
|
-
|
|
381
|
-
total = total.minus(discountAmount);
|
|
382
|
-
}
|
|
383
|
-
if (((_a = item._extend.other) == null ? void 0 : _a.option) && Array.isArray((_b = item._extend.other) == null ? void 0 : _b.option)) {
|
|
384
|
-
total = total.add((_c = item._extend.other) == null ? void 0 : _c.option.reduce((t, option) => {
|
|
377
|
+
var _a, _b, _c, _d, _e, _f;
|
|
378
|
+
let total = new import_decimal.default(((_a = item._extend) == null ? void 0 : _a.main_product_selling_price) ?? ((_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.main_product_selling_price) ?? item._extend.price ?? 0);
|
|
379
|
+
if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
|
|
380
|
+
total = total.add((_e = item._extend.other) == null ? void 0 : _e.option.reduce((t, option) => {
|
|
385
381
|
return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
|
|
386
382
|
}, new import_decimal.default(0)));
|
|
387
383
|
}
|
|
388
|
-
for (let bundleItem of ((
|
|
384
|
+
for (let bundleItem of ((_f = item._extend.other) == null ? void 0 : _f.bundle) || []) {
|
|
389
385
|
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
|
390
386
|
const discountAmount = getDiscountAmount(bundleItem.discount_list);
|
|
391
387
|
const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
|
|
@@ -572,8 +568,12 @@ var getSurcharge = (state, options) => {
|
|
|
572
568
|
}
|
|
573
569
|
}, 0);
|
|
574
570
|
let fixedTotal = new import_decimal.default(0);
|
|
571
|
+
let productTotalSurcharge = new import_decimal.default(0);
|
|
575
572
|
if (matchedItems.length > 0) {
|
|
576
573
|
let configTotal = new import_decimal.default(0);
|
|
574
|
+
if (fixed && new import_decimal.default(fixed).gt(0)) {
|
|
575
|
+
configTotal = configTotal.plus(fixed);
|
|
576
|
+
}
|
|
577
577
|
if (percentage && new import_decimal.default(percentage).gt(0) || fixed) {
|
|
578
578
|
const percentageRate = new import_decimal.default(percentage);
|
|
579
579
|
for (let [index, item] of matchedItems.entries()) {
|
|
@@ -582,6 +582,7 @@ var getSurcharge = (state, options) => {
|
|
|
582
582
|
const itemQuantity = new import_decimal.default(item.isMain ? item.quantity || 1 : item.quantity * item.mainQuantity || 1);
|
|
583
583
|
const addTimeTotal = new import_decimal.default(item.addTimeTotal || 0);
|
|
584
584
|
const itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
|
|
585
|
+
configTotal = configTotal.plus(itemTotalSurcharge);
|
|
585
586
|
const itemSurcharge = itemPrice.times(percentageRate);
|
|
586
587
|
const fixedSurcharge = new import_decimal.default(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
|
|
587
588
|
const quantity = item.isMain ? item.quantity : item.quantity * item.mainQuantity;
|
|
@@ -589,6 +590,7 @@ var getSurcharge = (state, options) => {
|
|
|
589
590
|
if (isLast && fixedTotal.gt(0)) {
|
|
590
591
|
const remaining = new import_decimal.default(fixed).minus(fixedTotal).toNumber();
|
|
591
592
|
if (remaining > 0) {
|
|
593
|
+
productTotalSurcharge = productTotalSurcharge.plus(remaining);
|
|
592
594
|
if (item.isMain) {
|
|
593
595
|
item.item._extend.surcharge_rounding_remainder = remaining;
|
|
594
596
|
} else {
|
|
@@ -599,20 +601,32 @@ var getSurcharge = (state, options) => {
|
|
|
599
601
|
if (open_product !== 0) {
|
|
600
602
|
if (item.isMain) {
|
|
601
603
|
const originSurchargeFee = new import_decimal.default(item.item._extend.surcharge_fee || 0);
|
|
602
|
-
|
|
604
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
605
|
+
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
606
|
+
item.item._extend.surcharge_fee = surchargeFee;
|
|
603
607
|
item.item._extend.relation_surcharge_ids = [...((_d = item.item._extend) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
|
|
604
608
|
} else {
|
|
605
609
|
const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
|
|
606
|
-
|
|
610
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
611
|
+
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
612
|
+
item.item.surcharge_fee = surchargeFee;
|
|
607
613
|
item.item.relation_surcharge_ids = [...((_e = item.item) == null ? void 0 : _e.relation_surcharge_ids) || [], id];
|
|
608
614
|
}
|
|
609
615
|
}
|
|
610
|
-
|
|
616
|
+
if (isLast && configTotal.minus(productTotalSurcharge).gt(0)) {
|
|
617
|
+
const configTotalRounded = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
|
|
618
|
+
if (item.isMain) {
|
|
619
|
+
let newRoundingRemainder = new import_decimal.default(item.item._extend.surcharge_rounding_remainder || 0);
|
|
620
|
+
newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
|
|
621
|
+
item.item._extend.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
|
|
622
|
+
} else {
|
|
623
|
+
let newRoundingRemainder = new import_decimal.default(item.item.surcharge_rounding_remainder || 0);
|
|
624
|
+
newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
|
|
625
|
+
item.item.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
|
|
626
|
+
}
|
|
627
|
+
}
|
|
611
628
|
}
|
|
612
629
|
}
|
|
613
|
-
if (fixed && new import_decimal.default(fixed).gt(0)) {
|
|
614
|
-
configTotal = configTotal.plus(fixed);
|
|
615
|
-
}
|
|
616
630
|
finalAmount = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
|
|
617
631
|
}
|
|
618
632
|
const name = surchargeConfig.name || {};
|
|
@@ -129,8 +129,8 @@ var formatProductBundle = (bundle) => {
|
|
|
129
129
|
"custom_price": (d == null ? void 0 : d.custom_price) || Math.abs(new import_decimal.default((d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.product_price)).sub(option_price).toNumber()).toFixed(2),
|
|
130
130
|
"custom_price_type": d == null ? void 0 : d.price_type,
|
|
131
131
|
"option": option,
|
|
132
|
-
"bundle_selling_price": d == null ? void 0 : d.price,
|
|
133
|
-
"bundle_sum_price":
|
|
132
|
+
"bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
|
|
133
|
+
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
134
134
|
"metadata": {
|
|
135
135
|
custom_product_bundle_map_id: d._id,
|
|
136
136
|
// 子商品单数量附加费
|
|
@@ -241,7 +241,7 @@ var formatHolders = (state, item, values) => {
|
|
|
241
241
|
var formatProductPrice = (item) => {
|
|
242
242
|
var _a, _b, _c, _d;
|
|
243
243
|
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
244
|
-
let price = Number((_b = item._extend) == null ? void 0 : _b.price);
|
|
244
|
+
let price = Number((item == null ? void 0 : item.price) ?? ((_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.price));
|
|
245
245
|
if ((other == null ? void 0 : other.product_variant_id) > 0 && ((_c = item == null ? void 0 : item.variant) == null ? void 0 : _c.length) > 0) {
|
|
246
246
|
const variant = item.variant.find(
|
|
247
247
|
(d) => d.id === (other == null ? void 0 : other.product_variant_id)
|
|
@@ -317,19 +317,19 @@ var getSourceProductPrice = (item) => {
|
|
|
317
317
|
return price;
|
|
318
318
|
};
|
|
319
319
|
var getMainProductSellingPrice = (item) => {
|
|
320
|
-
var _a, _b, _c, _d, _e;
|
|
321
|
-
if (!(0, import_utils5.isNumber)((_a = item._extend) == null ? void 0 : _a.main_product_selling_price)) {
|
|
320
|
+
var _a, _b, _c, _d, _e, _f;
|
|
321
|
+
if (!(0, import_utils5.isNumber)((_a = item._extend) == null ? void 0 : _a.main_product_selling_price) && !(0, import_utils5.isString)((_b = item._extend) == null ? void 0 : _b.main_product_selling_price)) {
|
|
322
322
|
return void 0;
|
|
323
323
|
}
|
|
324
324
|
let optionPrice = new import_decimal.default(0);
|
|
325
|
-
if (((
|
|
326
|
-
optionPrice = (
|
|
325
|
+
if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
|
|
326
|
+
optionPrice = (_e = item._extend.other) == null ? void 0 : _e.option.reduce((accumulator, currentValue) => {
|
|
327
327
|
const currentPrice = new import_decimal.default(currentValue.price || 0);
|
|
328
328
|
const currentNum = new import_decimal.default(currentValue.num || 0);
|
|
329
329
|
return accumulator.add(currentPrice.mul(currentNum));
|
|
330
330
|
}, optionPrice);
|
|
331
331
|
}
|
|
332
|
-
return new import_decimal.default((
|
|
332
|
+
return new import_decimal.default((_f = item._extend) == null ? void 0 : _f.main_product_selling_price).add(optionPrice).toNumber();
|
|
333
333
|
};
|
|
334
334
|
var formatProducts = (item, quantity) => {
|
|
335
335
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -60,6 +60,8 @@ var VoucherCard = (props) => {
|
|
|
60
60
|
const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
|
|
61
61
|
const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
|
|
62
62
|
const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
|
|
63
|
+
const stateRef = (0, import_react.useRef)(state);
|
|
64
|
+
stateRef.current = state;
|
|
63
65
|
services = state.service;
|
|
64
66
|
const changeCustomerToGlobalState = (0, import_ahooks.useMemoizedFn)((value) => {
|
|
65
67
|
dispatch({
|
|
@@ -161,8 +163,8 @@ var VoucherCard = (props) => {
|
|
|
161
163
|
}
|
|
162
164
|
if (isBooking4Shop) {
|
|
163
165
|
const val = shopDiscount.calcDiscount([
|
|
164
|
-
...
|
|
165
|
-
...
|
|
166
|
+
...stateRef.current.service.value,
|
|
167
|
+
...stateRef.current.addons.value
|
|
166
168
|
]);
|
|
167
169
|
console.log("input: ", state.service.value);
|
|
168
170
|
console.log("output: ", val);
|
|
@@ -95,10 +95,11 @@ var setNewCartValue = (cartValue, newProducts) => {
|
|
|
95
95
|
}
|
|
96
96
|
const selectBundleInfo = item._extend.other.bundle.find((item2) => item2.id === bundle.id);
|
|
97
97
|
const optionPrice = calculateTotalPrice((selectBundleInfo == null ? void 0 : selectBundleInfo.option) || []);
|
|
98
|
+
const isEditDiscount = item.booking_id && (bundle.discount_list || []).length;
|
|
98
99
|
return {
|
|
99
100
|
...bundle,
|
|
100
101
|
base_price: bundleItemMap[bundle.id].base_price,
|
|
101
|
-
price: new import_decimal.default(bundleItemMap[bundle.id].price || 0).add(optionPrice).toNumber()
|
|
102
|
+
price: isEditDiscount ? bundle.price : new import_decimal.default(bundleItemMap[bundle.id].price || 0).add(optionPrice).toNumber()
|
|
102
103
|
// product_price: bundleItemMap[item.id].product_price,
|
|
103
104
|
};
|
|
104
105
|
});
|
|
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_ahooks = require("ahooks");
|
|
37
37
|
var import_skuDetailModal = __toESM(require("../../../../../pro/skuDetailModal"));
|
|
38
38
|
var import_model = require("../../../info/model");
|
|
39
|
+
var import_utils = require("../editService/utils");
|
|
39
40
|
var EditNormalService = (0, import_react.forwardRef)((props, ref) => {
|
|
40
41
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
41
42
|
const modalRef = (0, import_react.useRef)(null);
|
|
@@ -62,7 +63,12 @@ var EditNormalService = (0, import_react.forwardRef)((props, ref) => {
|
|
|
62
63
|
const handleConfirm = (0, import_ahooks.useMemoizedFn)((data) => {
|
|
63
64
|
var _a, _b;
|
|
64
65
|
const newProducts = (_b = ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || []) == null ? void 0 : _b.map((item) => {
|
|
66
|
+
var _a2, _b2;
|
|
65
67
|
if (item._id == data._id) {
|
|
68
|
+
data = (0, import_utils.setProductPrice)(data, {
|
|
69
|
+
newTotal: (_a2 = data._extend) == null ? void 0 : _a2.total,
|
|
70
|
+
origin_total: (_b2 = data._extend) == null ? void 0 : _b2.origin_total
|
|
71
|
+
});
|
|
66
72
|
return data;
|
|
67
73
|
}
|
|
68
74
|
return item;
|
|
@@ -53,6 +53,7 @@ var import_utils5 = require("../../../info/utils");
|
|
|
53
53
|
var import_utils6 = require("../../../utils");
|
|
54
54
|
var import_utilsByBooking = require("../../utilsByBooking");
|
|
55
55
|
var import_utils7 = require("../addService/utils");
|
|
56
|
+
var import_utils8 = require("./utils");
|
|
56
57
|
var import_noteModal = __toESM(require("../../../../../plus/noteModal"));
|
|
57
58
|
var import_priceKeyboard = require("../../../../../pro/priceKeyboard");
|
|
58
59
|
var submitLock = false;
|
|
@@ -187,7 +188,7 @@ var Info = (_, ref) => {
|
|
|
187
188
|
form.setFieldsValue({ discount });
|
|
188
189
|
};
|
|
189
190
|
const onFinish = (values) => {
|
|
190
|
-
var _a2, _b2, _c2, _d2;
|
|
191
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
191
192
|
let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
|
|
192
193
|
if (isShowTimeAndResource && !isSuccess) {
|
|
193
194
|
return;
|
|
@@ -222,19 +223,27 @@ var Info = (_, ref) => {
|
|
|
222
223
|
_item._time = (/* @__PURE__ */ new Date()).getTime();
|
|
223
224
|
_item._serviceKey = (0, import_utils3.genServiceKey)(_item);
|
|
224
225
|
let _id = _item == null ? void 0 : _item._id;
|
|
226
|
+
_item = (0, import_utils8.setProductPrice)(_item, {
|
|
227
|
+
newTotal: values.total,
|
|
228
|
+
origin_total: (_c2 = _item._extend) == null ? void 0 : _c2.origin_total
|
|
229
|
+
});
|
|
225
230
|
if (!_list.some((d) => d._id === _id)) {
|
|
226
231
|
const detail = (0, import_utils3.addService)(_list, _item, state);
|
|
227
232
|
_list = detail.list;
|
|
228
233
|
} else {
|
|
229
234
|
if (isChangeTotal.current) {
|
|
230
235
|
delete _item.discount_list;
|
|
236
|
+
_item = (0, import_utils8.setProductPrice)(_item, {
|
|
237
|
+
newTotal: values.total,
|
|
238
|
+
origin_total: (_d2 = _item._extend) == null ? void 0 : _d2.origin_total
|
|
239
|
+
});
|
|
231
240
|
}
|
|
232
241
|
_list = _list.map((d) => d._id === _id ? { ..._item, new: 0 } : d);
|
|
233
242
|
}
|
|
234
243
|
(0, import_utils6.deleteCacheParams)();
|
|
235
244
|
console.log("_onFinish", _list);
|
|
236
245
|
form.resetFields();
|
|
237
|
-
if (!!((
|
|
246
|
+
if (!!((_e2 = state.service.cacheItem) == null ? void 0 : _e2.new)) {
|
|
238
247
|
window.dispatchEvent(
|
|
239
248
|
new CustomEvent("onAddNewService", {
|
|
240
249
|
detail: {
|
|
@@ -243,7 +252,7 @@ var Info = (_, ref) => {
|
|
|
243
252
|
})
|
|
244
253
|
);
|
|
245
254
|
}
|
|
246
|
-
(
|
|
255
|
+
(_f2 = window.closeBookingEditModal) == null ? void 0 : _f2.call(window);
|
|
247
256
|
dispatch({
|
|
248
257
|
type: "setService",
|
|
249
258
|
payload: {
|
|
@@ -11,3 +11,18 @@ export declare const getAutoAllocationStorage: (id: string | number) => any;
|
|
|
11
11
|
export declare const setAutoAllocationStorage: (data: {
|
|
12
12
|
[key: string]: boolean;
|
|
13
13
|
}) => void;
|
|
14
|
+
/**
|
|
15
|
+
* 手动折扣后给商品价格和子商品价格重新计算
|
|
16
|
+
*
|
|
17
|
+
* 计算逻辑:
|
|
18
|
+
* 1. 子商品(bundle + option)按折扣比例计算,直接截取两位小数(不四舍五入)
|
|
19
|
+
* 2. 主商品价格 = newTotal - 所有子商品价格总和(确保总价精确等于 newTotal)
|
|
20
|
+
*
|
|
21
|
+
* @param cacheItem - 缓存的商品项
|
|
22
|
+
* @param newTotal - 折扣后的新总价
|
|
23
|
+
* @param origin_total - 原始总价
|
|
24
|
+
*/
|
|
25
|
+
export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total }: {
|
|
26
|
+
newTotal: number;
|
|
27
|
+
origin_total: number;
|
|
28
|
+
}) => any;
|
|
@@ -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,21 +16,32 @@ 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/info2/service/editService/utils.tsx
|
|
20
30
|
var utils_exports = {};
|
|
21
31
|
__export(utils_exports, {
|
|
22
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
23
|
-
setAutoAllocationStorage: () => setAutoAllocationStorage
|
|
33
|
+
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
34
|
+
setProductPrice: () => setProductPrice
|
|
24
35
|
});
|
|
25
36
|
module.exports = __toCommonJS(utils_exports);
|
|
26
37
|
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_utils2 = require("@pisell/utils");
|
|
39
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
27
40
|
var getAutoAllocationStorage = (id) => {
|
|
28
41
|
const value = localStorage.getItem("resource-auto-allocation");
|
|
29
42
|
if (value) {
|
|
30
43
|
const valueObj = JSON.parse(value);
|
|
31
|
-
return (0,
|
|
44
|
+
return (0, import_utils2.isBoolean)(valueObj[id]) ? valueObj[id] : true;
|
|
32
45
|
}
|
|
33
46
|
return true;
|
|
34
47
|
};
|
|
@@ -41,8 +54,32 @@ var setAutoAllocationStorage = (data) => {
|
|
|
41
54
|
localStorage.setItem("resource-auto-allocation", JSON.stringify({ ...data }));
|
|
42
55
|
}
|
|
43
56
|
};
|
|
57
|
+
var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
59
|
+
const discountRatio = new import_decimal.default(newTotal).div(new import_decimal.default(origin_total));
|
|
60
|
+
let subTotal = new import_decimal.default(0);
|
|
61
|
+
if (((_a = cacheItem._extend.other) == null ? void 0 : _a.bundle) && (0, import_utils.isArr)((_b = cacheItem._extend.other) == null ? void 0 : _b.bundle)) {
|
|
62
|
+
(_d = (_c = cacheItem._extend.other) == null ? void 0 : _c.bundle) == null ? void 0 : _d.forEach((bundle) => {
|
|
63
|
+
const newPrice = new import_decimal.default(bundle.original_price || bundle.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
64
|
+
const quantity = bundle.num ?? bundle.quantity ?? 1;
|
|
65
|
+
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
66
|
+
bundle.price = newPrice;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (((_e = cacheItem._extend.other) == null ? void 0 : _e.option) && (0, import_utils.isArr)((_f = cacheItem._extend.other) == null ? void 0 : _f.option)) {
|
|
70
|
+
(_h = (_g = cacheItem._extend.other) == null ? void 0 : _g.option) == null ? void 0 : _h.forEach((option) => {
|
|
71
|
+
const newPrice = new import_decimal.default(option.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
72
|
+
const quantity = option.num ?? option.quantity ?? 1;
|
|
73
|
+
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
74
|
+
option.price = newPrice;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
cacheItem._extend.price = new import_decimal.default(newTotal).sub(subTotal).toNumber();
|
|
78
|
+
return cacheItem;
|
|
79
|
+
};
|
|
44
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
81
|
0 && (module.exports = {
|
|
46
82
|
getAutoAllocationStorage,
|
|
47
|
-
setAutoAllocationStorage
|
|
83
|
+
setAutoAllocationStorage,
|
|
84
|
+
setProductPrice
|
|
48
85
|
});
|