@pisell/private-materials 6.4.77 → 6.4.78

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 (249) 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 +9 -9
  6. package/build/lowcode/view.js +7 -7
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/Sales/Summary/utils.d.ts +1 -1
  9. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  10. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  12. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  16. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  17. package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
  18. package/es/components/booking/addons/index.js +8 -3
  19. package/es/components/booking/components/footer/amount.d.ts +1 -0
  20. package/es/components/booking/components/footer/amount.js +521 -79
  21. package/es/components/booking/components/footer/utils.d.ts +13 -0
  22. package/es/components/booking/components/footer/utils.js +88 -40
  23. package/es/components/booking/forms/footer.d.ts +1 -0
  24. package/es/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
  25. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  26. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  27. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  28. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  29. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  30. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  31. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  32. package/es/components/booking/info/service2/utils.d.ts +1 -1
  33. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  34. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  35. package/es/components/booking/utils.d.ts +2 -2
  36. package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
  37. package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
  38. package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
  39. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  40. package/es/components/eftposPay/amount.d.ts +1 -1
  41. package/es/components/eftposPay/device.d.ts +1 -1
  42. package/es/components/eftposPay/hooks.d.ts +1 -1
  43. package/es/components/eftposPay/store/index.d.ts +3 -3
  44. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  45. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  46. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  47. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  48. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  49. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  50. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  51. package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  52. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  53. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  54. package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  55. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  56. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  57. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  58. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  59. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  60. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  61. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  62. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  63. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  64. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  65. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  66. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  67. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  68. package/es/components/eventBooking/index.d.ts +1 -0
  69. package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
  70. package/es/components/pay/toB/components/Card/index.d.ts +1 -0
  71. package/es/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
  72. package/es/components/pay/toB/components/Content/Footer.d.ts +1 -0
  73. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  74. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  75. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  76. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  77. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  78. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  79. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  80. package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
  81. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  82. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  83. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  84. package/es/components/productExtension/index.d.ts +1 -0
  85. package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
  86. package/es/components/ruleSetting/index.d.ts +1 -0
  87. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  88. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  89. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  90. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  91. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  92. package/es/components/shoppingCart/index.d.ts +1 -0
  93. package/es/components/subTotal/index.js +1 -1
  94. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  95. package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  96. package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  97. package/es/components/ticketBooking/index.d.ts +1 -0
  98. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  99. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  100. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  101. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  102. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +1 -0
  103. package/es/plus/noteModal/AddTempModal.d.ts +1 -0
  104. package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +1 -0
  105. package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  106. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  107. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +1 -0
  108. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
  109. package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  110. package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  111. package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +1 -0
  112. package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  113. package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +1 -0
  114. package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  115. package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  116. package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +1 -0
  117. package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  118. package/es/plus/saasLogin/utils.d.ts +5 -5
  119. package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  120. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  121. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  122. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  123. package/es/plus/walletPassGallery/index.d.ts +1 -0
  124. package/es/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  125. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +1 -0
  126. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
  127. package/es/pro/priceKeyboard/hooks/rightItems.d.ts +1 -0
  128. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  129. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  130. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  131. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  132. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  133. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  134. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  135. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  136. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  137. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  138. package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
  139. package/lib/components/booking/addons/index.js +6 -1
  140. package/lib/components/booking/components/footer/amount.d.ts +1 -0
  141. package/lib/components/booking/components/footer/amount.js +271 -38
  142. package/lib/components/booking/components/footer/utils.d.ts +13 -0
  143. package/lib/components/booking/components/footer/utils.js +45 -7
  144. package/lib/components/booking/forms/footer.d.ts +1 -0
  145. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
  146. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  147. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  148. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  149. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  150. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  151. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  152. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  153. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  154. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  155. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  156. package/lib/components/booking/utils.d.ts +2 -2
  157. package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
  158. package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
  159. package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
  160. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  161. package/lib/components/eftposPay/amount.d.ts +1 -1
  162. package/lib/components/eftposPay/device.d.ts +1 -1
  163. package/lib/components/eftposPay/hooks.d.ts +1 -1
  164. package/lib/components/eftposPay/store/index.d.ts +3 -3
  165. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  166. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  167. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  168. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  169. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  170. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  171. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  172. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  173. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  174. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  175. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  176. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  177. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  178. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  179. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  180. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  181. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  184. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  187. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  188. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  189. package/lib/components/eventBooking/index.d.ts +1 -0
  190. package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
  191. package/lib/components/pay/toB/components/Card/index.d.ts +1 -0
  192. package/lib/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
  193. package/lib/components/pay/toB/components/Content/Footer.d.ts +1 -0
  194. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  195. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  196. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  197. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  198. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  199. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  200. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  201. package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
  202. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  203. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  204. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  205. package/lib/components/productExtension/index.d.ts +1 -0
  206. package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
  207. package/lib/components/ruleSetting/index.d.ts +1 -0
  208. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  209. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  210. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  211. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  212. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  213. package/lib/components/shoppingCart/index.d.ts +1 -0
  214. package/lib/components/subTotal/index.js +1 -1
  215. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  216. package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  217. package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  218. package/lib/components/ticketBooking/index.d.ts +1 -0
  219. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  220. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  221. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  222. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  223. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +1 -0
  224. package/lib/plus/noteModal/AddTempModal.d.ts +1 -0
  225. package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +1 -0
  226. package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  227. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  228. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +1 -0
  229. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
  230. package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  231. package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  232. package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +1 -0
  233. package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  234. package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +1 -0
  235. package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  236. package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  237. package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +1 -0
  238. package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  239. package/lib/plus/saasLogin/utils.d.ts +5 -5
  240. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  241. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  242. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  243. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  244. package/lib/plus/walletPassGallery/index.d.ts +1 -0
  245. package/lib/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  246. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +1 -0
  247. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
  248. package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +1 -0
  249. package/package.json +2 -2
@@ -47,7 +47,7 @@ var getRelationDetailsTotal = (relation_details) => {
47
47
  }
48
48
  return total.toNumber();
49
49
  };
50
- var getProductExpectAmount = (state, isEdit) => {
50
+ var getProductExpectAmount = (state, isEdit, isOriginTotal) => {
51
51
  var _a, _b, _c, _d;
52
52
  let price = new import_decimal.default(0);
53
53
  let duration = new import_decimal.default(0);
@@ -59,13 +59,15 @@ var getProductExpectAmount = (state, isEdit) => {
59
59
  if (isDay || (0, import_utils3.isNormalProductByDurationSchedule)(item)) {
60
60
  const quantity = new import_decimal.default(item._extend.quantity || 1);
61
61
  const itemTotal = new import_decimal.default(item._extend.total || 0);
62
- price = price.add(itemTotal.mul(quantity));
62
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
63
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
63
64
  const _duration = (0, import_utils3.isDayBookingProduct)(item, state) ? new import_decimal.default(item._extend.duration || 0) : new import_decimal.default(0);
64
65
  duration = duration.add(_duration);
65
66
  } else {
66
67
  const quantity = new import_decimal.default(item._extend.quantity || 1);
67
68
  const itemTotal = new import_decimal.default(item._extend.total || 0);
68
- price = price.add(itemTotal.mul(quantity));
69
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
70
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
69
71
  const relationTotal = new import_decimal.default(getRelationDetailsTotal(
70
72
  item._extend.relation_details || []
71
73
  ));
@@ -79,7 +81,8 @@ var getProductExpectAmount = (state, isEdit) => {
79
81
  for (let item of state.addons.value) {
80
82
  const quantity = new import_decimal.default(item._extend.quantity || 1);
81
83
  const itemTotal = new import_decimal.default(item._extend.total || 0);
82
- price = price.add(itemTotal.mul(quantity));
84
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
85
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
83
86
  }
84
87
  }
85
88
  }
@@ -130,9 +133,10 @@ var getProductItemTax = (item, state, options) => {
130
133
  }
131
134
  }
132
135
  }
133
- return singleItemTax.times(quantity);
136
+ return singleItemTax.times(quantity).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
134
137
  };
135
138
  var processItemsTax = (items, state, options) => {
139
+ var _a, _b, _c;
136
140
  const { tax_rate, is_price_include_tax, computed } = options;
137
141
  const { shopDiscount, productExpectAmount } = computed;
138
142
  let originTax = new import_decimal.default(0);
@@ -140,10 +144,11 @@ var processItemsTax = (items, state, options) => {
140
144
  for (let item of items) {
141
145
  const quantity = new import_decimal.default(item._extend.quantity || 1);
142
146
  const unitPrice = new import_decimal.default(item._extend.total || 0);
143
- const originalTaxPerItem = getProductItemTax(
147
+ const mainProductPrice = new import_decimal.default(getMainProductTotal(item) || 0);
148
+ let originalTaxPerItem = getProductItemTax(
144
149
  {
145
150
  ...item,
146
- total: unitPrice.toNumber(),
151
+ total: mainProductPrice.add(((_a = item._extend) == null ? void 0 : _a.surcharge_fee) || 0).toNumber(),
147
152
  quantity: 1
148
153
  },
149
154
  state,
@@ -153,19 +158,22 @@ var processItemsTax = (items, state, options) => {
153
158
  if (productExpectAmount > 0) {
154
159
  itemDiscount = unitPrice.dividedBy(productExpectAmount).times(shopDiscount);
155
160
  }
156
- const itemDiscountedUnitPrice = unitPrice.minus(itemDiscount);
157
- const discountedTaxPerItem = getProductItemTax(
161
+ let mainItemDiscount = new import_decimal.default(0);
162
+ if (unitPrice.greaterThan(0)) {
163
+ mainItemDiscount = mainProductPrice.dividedBy(productExpectAmount).times(shopDiscount);
164
+ }
165
+ const mainItemDiscountedUnitPrice = mainProductPrice.minus(mainItemDiscount).add(((_b = item._extend) == null ? void 0 : _b.surcharge_fee) || 0);
166
+ const maxDiscountedTaxPerItem = getProductItemTax(
158
167
  {
159
168
  ...item,
160
- total: itemDiscountedUnitPrice.toNumber(),
169
+ total: mainItemDiscountedUnitPrice.toNumber(),
161
170
  price: item._extend.total,
162
171
  quantity: 1
163
172
  },
164
173
  state,
165
174
  { tax_rate, is_price_include_tax }
166
175
  );
167
- item._extend.original_tax_fee = originalTaxPerItem.toNumber();
168
- item._extend.tax_fee = discountedTaxPerItem.toNumber();
176
+ item._extend.main_product_attached_bundle_tax_fee = maxDiscountedTaxPerItem.toNumber();
169
177
  let addTimeTotalTax = new import_decimal.default(0);
170
178
  if (Array.isArray(item._extend.relation_details)) {
171
179
  for (let atItem of item._extend.relation_details) {
@@ -181,8 +189,7 @@ var processItemsTax = (items, state, options) => {
181
189
  const addTimeTaxPerItem = getProductItemTax(
182
190
  {
183
191
  ...atItem,
184
- total: _discountedTotal,
185
- // 可能包含原有数据,或前端临时数据
192
+ total: _discountedTotal.add((atItem == null ? void 0 : atItem.surcharge_fee) || 0).toNumber(),
186
193
  quantity: atItem.product_quantity || atItem.num || 1
187
194
  },
188
195
  state,
@@ -191,8 +198,51 @@ var processItemsTax = (items, state, options) => {
191
198
  addTimeTotalTax = addTimeTotalTax.plus(addTimeTaxPerItem);
192
199
  }
193
200
  }
194
- originTax = originTax.plus(originalTaxPerItem.times(quantity)).plus(addTimeTotalTax);
195
- tax = tax.plus(discountedTaxPerItem.times(quantity)).plus(addTimeTotalTax);
201
+ let bundleTotalOriginTax = new import_decimal.default(0);
202
+ let bundleTotalTax = new import_decimal.default(0);
203
+ if (Array.isArray((_c = item._extend.other) == null ? void 0 : _c.bundle)) {
204
+ for (let bundleItem of item._extend.other.bundle) {
205
+ if (getBundleItemIsOriginalPrice(bundleItem)) {
206
+ const bundleQuantity = new import_decimal.default(bundleItem.quantity || 1);
207
+ const bundleUnitPrice = new import_decimal.default(
208
+ bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
209
+ );
210
+ const bundleOriginalTaxPerItem = getProductItemTax(
211
+ {
212
+ ...bundleItem,
213
+ total: bundleUnitPrice.add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0).toNumber(),
214
+ quantity: 1
215
+ },
216
+ state,
217
+ { tax_rate, is_price_include_tax }
218
+ );
219
+ let bundleItemDiscount = new import_decimal.default(0);
220
+ if (productExpectAmount > 0) {
221
+ bundleItemDiscount = bundleUnitPrice.dividedBy(productExpectAmount).times(shopDiscount);
222
+ }
223
+ const bundleDiscountedUnitPrice = bundleUnitPrice.minus(bundleItemDiscount).add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0);
224
+ const bundleDiscountedTaxPerItem = getProductItemTax(
225
+ {
226
+ ...bundleItem,
227
+ total: bundleDiscountedUnitPrice.toNumber(),
228
+ quantity: 1
229
+ },
230
+ state,
231
+ { tax_rate, is_price_include_tax }
232
+ );
233
+ bundleItem.original_tax_fee = new import_decimal.default(bundleOriginalTaxPerItem).toNumber();
234
+ bundleItem.tax_fee = new import_decimal.default(bundleDiscountedTaxPerItem).toNumber();
235
+ bundleTotalOriginTax = bundleTotalOriginTax.plus(bundleOriginalTaxPerItem.times(bundleQuantity));
236
+ bundleTotalTax = bundleTotalTax.plus(bundleDiscountedTaxPerItem.times(bundleQuantity));
237
+ }
238
+ }
239
+ }
240
+ const original_tax_fee = originalTaxPerItem.add(bundleTotalOriginTax);
241
+ const tax_fee = maxDiscountedTaxPerItem.add(bundleTotalTax);
242
+ item._extend.original_tax_fee = original_tax_fee.toNumber();
243
+ item._extend.tax_fee = tax_fee.toNumber();
244
+ originTax = originTax.plus(original_tax_fee.times(quantity)).plus(addTimeTotalTax);
245
+ tax = tax.plus(tax_fee.times(quantity)).plus(addTimeTotalTax);
196
246
  }
197
247
  return { originTax, tax };
198
248
  };
@@ -253,7 +303,7 @@ var isProductMatchSurchargeCondition = (item, options) => {
253
303
  }
254
304
  const isInScheduleByDate = (_a = options.ScheduleModule) == null ? void 0 : _a.isInScheduleByDate;
255
305
  const { surchargeConfig, scheduleById = {} } = options;
256
- const { startDate, other, isCustomItem } = item._extend;
306
+ const { startDate, product_id, isCustomItem } = item;
257
307
  const {
258
308
  open_product = 0,
259
309
  // 1 | 0
@@ -277,7 +327,6 @@ var isProductMatchSurchargeCondition = (item, options) => {
277
327
  if (isCustomItem) {
278
328
  isProductMatch = false;
279
329
  } else {
280
- const product_id = other == null ? void 0 : other.product_id;
281
330
  isProductMatch = available_product_ids.includes(product_id);
282
331
  }
283
332
  }
@@ -307,8 +356,70 @@ var isProductMatchSurchargeCondition = (item, options) => {
307
356
  }
308
357
  return isProductMatch && isScheduleMatch;
309
358
  };
310
- var getSurcharge = (state, options) => {
359
+ var getBundleItemIsOriginalPrice = (item) => {
360
+ return (item == null ? void 0 : item.price_type) === "markup" && (item == null ? void 0 : item.price_type_ext) === "product_price";
361
+ };
362
+ var getBundleItemIsMarkupPrice = (item) => {
363
+ return (item == null ? void 0 : item.price_type) === "markup" && ((item == null ? void 0 : item.price_type_ext) === "" || !(item == null ? void 0 : item.price_type_ext));
364
+ };
365
+ var getBundleItemIsDiscountPrice = (item) => {
366
+ return (item == null ? void 0 : item.price_type) === "markdown" && ((item == null ? void 0 : item.price_type_ext) === "" || !(item == null ? void 0 : item.price_type_ext));
367
+ };
368
+ var getBundleItemIsMarkupOrDiscountPrice = (item) => {
369
+ return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
370
+ };
371
+ var getDiscountAmount = (discounts) => {
372
+ return (discounts || []).reduce((total, discount) => {
373
+ return total.add(new import_decimal.default(discount.amount || 0));
374
+ }, new import_decimal.default(0)).toNumber();
375
+ };
376
+ var getMainProductTotal = (item) => {
311
377
  var _a;
378
+ let total = new import_decimal.default(item._extend.main_product_selling_price || item._extend.price || 0);
379
+ if (!item._extend.main_product_selling_price) {
380
+ const discountAmount = getDiscountAmount(item.discount_list);
381
+ total = total.minus(discountAmount);
382
+ }
383
+ for (let bundleItem of ((_a = item._extend.other) == null ? void 0 : _a.bundle) || []) {
384
+ if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
385
+ const discountAmount = getDiscountAmount(bundleItem.discount_list);
386
+ const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
387
+ const bundleItemTotal = bundleItemPrice.minus(discountAmount);
388
+ total = total.add(bundleItemTotal);
389
+ }
390
+ }
391
+ return total.toNumber();
392
+ };
393
+ var clearSurchargeFee = (state) => {
394
+ var _a, _b;
395
+ const { service, addons } = state;
396
+ if (Array.isArray(service == null ? void 0 : service.value)) {
397
+ for (let item of service.value) {
398
+ item._extend.surcharge_fee = 0;
399
+ item._extend.relation_surcharge_ids = [];
400
+ for (let bundleItem of ((_a = item._extend.other) == null ? void 0 : _a.bundle) || []) {
401
+ bundleItem.surcharge_fee = 0;
402
+ bundleItem.relation_surcharge_ids = [];
403
+ }
404
+ for (let relationDetail of item._extend.relation_details || []) {
405
+ relationDetail.surcharge_fee = 0;
406
+ relationDetail.relation_surcharge_ids = [];
407
+ }
408
+ }
409
+ }
410
+ if (Array.isArray(addons == null ? void 0 : addons.value)) {
411
+ for (let item of addons.value) {
412
+ item._extend.surcharge_fee = 0;
413
+ item._extend.relation_surcharge_ids = [];
414
+ for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
415
+ bundleItem.surcharge_fee = 0;
416
+ bundleItem.relation_surcharge_ids = [];
417
+ }
418
+ }
419
+ }
420
+ };
421
+ var getSurcharge = (state, options) => {
422
+ var _a, _b, _c, _d, _e;
312
423
  const { isEdit, ScheduleModule, surcharge_list, scheduleById } = options;
313
424
  const { bookingDetail, bookingId } = state;
314
425
  if (!isEdit && bookingId) {
@@ -333,6 +444,7 @@ var getSurcharge = (state, options) => {
333
444
  }
334
445
  return [];
335
446
  }
447
+ clearSurchargeFee(state);
336
448
  const { service, addons } = state;
337
449
  if (!Array.isArray(surcharge_list) || !(surcharge_list == null ? void 0 : surcharge_list.length)) return [];
338
450
  const surchargeWithAmount = [];
@@ -343,24 +455,89 @@ var getSurcharge = (state, options) => {
343
455
  fixed = "0",
344
456
  id,
345
457
  type,
346
- description
458
+ description,
459
+ open_product
347
460
  } = surchargeConfig;
348
461
  const matchedItems = [];
349
462
  if (Array.isArray(service == null ? void 0 : service.value)) {
350
463
  for (let item of service.value) {
351
- if (isProductMatchSurchargeCondition(item, {
352
- surchargeConfig,
353
- scheduleById: scheduleById || {},
354
- ScheduleModule
355
- })) {
464
+ if (isProductMatchSurchargeCondition(
465
+ {
466
+ isCustomItem: item.isCustomItem,
467
+ startDate: item._extend.startDate,
468
+ product_id: item.product_id
469
+ },
470
+ {
471
+ surchargeConfig,
472
+ scheduleById: scheduleById || {},
473
+ ScheduleModule
474
+ }
475
+ )) {
476
+ const total = getMainProductTotal(item);
477
+ const mainQuantity = item._extend.quantity || 1;
356
478
  matchedItems.push({
357
- total: Number(item._extend.total),
358
- addTimeTotal: getRelationDetailsTotal(
359
- item._extend.relation_details || []
360
- ),
361
- quantity: item._extend.quantity || 1
479
+ total,
480
+ // addTimeTotal: getRelationDetailsTotal(
481
+ // item._extend.relation_details || []
482
+ // ),
483
+ isMain: true,
484
+ quantity: mainQuantity,
485
+ item,
486
+ mainQuantity
487
+ // 主商品的mainQuantity等于自己的quantity
362
488
  });
363
489
  }
490
+ for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
491
+ if (getBundleItemIsOriginalPrice(bundleItem) && isProductMatchSurchargeCondition(
492
+ {
493
+ isCustomItem: false,
494
+ startDate: item._extend.startDate,
495
+ product_id: bundleItem._bundle_product_id
496
+ },
497
+ {
498
+ surchargeConfig,
499
+ scheduleById: scheduleById || {},
500
+ ScheduleModule
501
+ }
502
+ )) {
503
+ const mainQuantity = item._extend.quantity || 1;
504
+ matchedItems.push({
505
+ isMain: false,
506
+ total: Number(
507
+ bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
508
+ ),
509
+ quantity: bundleItem.num || bundleItem.quantity || 1,
510
+ item: bundleItem,
511
+ mainQuantity
512
+ // 子商品的mainQuantity是所属主商品的quantity
513
+ });
514
+ }
515
+ }
516
+ for (let relationDetail of item._extend.relation_details || []) {
517
+ if (isProductMatchSurchargeCondition(
518
+ {
519
+ isCustomItem: false,
520
+ startDate: item._extend.startDate,
521
+ product_id: relationDetail.product_id
522
+ },
523
+ {
524
+ surchargeConfig,
525
+ scheduleById: scheduleById || {},
526
+ ScheduleModule
527
+ }
528
+ )) {
529
+ matchedItems.push({
530
+ isMain: false,
531
+ total: Number(
532
+ (relationDetail == null ? void 0 : relationDetail.price) || ((_c = relationDetail == null ? void 0 : relationDetail.metadata) == null ? void 0 : _c.main_product_attached_bundle_selling_price)
533
+ ),
534
+ quantity: relationDetail.num || relationDetail.quantity || 1,
535
+ item: relationDetail,
536
+ mainQuantity: 1
537
+ // 加时商品不受主商品数量影响
538
+ });
539
+ }
540
+ }
364
541
  }
365
542
  }
366
543
  if (Array.isArray(addons == null ? void 0 : addons.value)) {
@@ -371,23 +548,61 @@ var getSurcharge = (state, options) => {
371
548
  ScheduleModule
372
549
  })) {
373
550
  matchedItems.push({
551
+ isMain: true,
374
552
  total: Number(item._extend.total),
375
- quantity: item._extend.quantity || 1
553
+ quantity: item._extend.quantity || 1,
554
+ item,
555
+ mainQuantity: 1
556
+ // addons独立商品,mainQuantity为1
376
557
  });
377
558
  }
378
559
  }
379
560
  }
380
561
  let finalAmount = 0;
562
+ const productCount = matchedItems.reduce((total, item) => {
563
+ if (item.isMain) {
564
+ return total + (item.quantity || 1);
565
+ } else {
566
+ return total + (item.quantity || 1) * (item.mainQuantity || 1);
567
+ }
568
+ }, 0);
569
+ let fixedTotal = new import_decimal.default(0);
381
570
  if (matchedItems.length > 0) {
382
571
  let configTotal = new import_decimal.default(0);
383
- if (percentage && new import_decimal.default(percentage).gt(0)) {
572
+ if (percentage && new import_decimal.default(percentage).gt(0) || fixed) {
384
573
  const percentageRate = new import_decimal.default(percentage);
385
- for (let item of matchedItems) {
574
+ for (let [index, item] of matchedItems.entries()) {
575
+ const isLast = index === matchedItems.length - 1;
386
576
  const itemPrice = new import_decimal.default(Math.max(0, item.total || 0));
387
- const itemQuantity = new import_decimal.default(item.quantity || 1);
577
+ const itemQuantity = new import_decimal.default(item.isMain ? item.quantity || 1 : item.quantity * item.mainQuantity || 1);
388
578
  const addTimeTotal = new import_decimal.default(item.addTimeTotal || 0);
389
- const itemSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
390
- configTotal = configTotal.plus(itemSurcharge);
579
+ const itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
580
+ const itemSurcharge = itemPrice.times(percentageRate);
581
+ const fixedSurcharge = new import_decimal.default(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
582
+ const quantity = item.isMain ? item.quantity : item.quantity * item.mainQuantity;
583
+ fixedTotal = fixedTotal.plus(new import_decimal.default(fixedSurcharge).times(quantity).toNumber());
584
+ if (isLast && fixedTotal.gt(0)) {
585
+ const remaining = new import_decimal.default(fixed).minus(fixedTotal).toNumber();
586
+ if (remaining > 0) {
587
+ if (item.isMain) {
588
+ item.item._extend.surcharge_rounding_remainder = remaining;
589
+ } else {
590
+ item.item.surcharge_rounding_remainder = remaining;
591
+ }
592
+ }
593
+ }
594
+ if (open_product !== 0) {
595
+ if (item.isMain) {
596
+ const originSurchargeFee = new import_decimal.default(item.item._extend.surcharge_fee || 0);
597
+ item.item._extend.surcharge_fee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
598
+ item.item._extend.relation_surcharge_ids = [...((_d = item.item._extend) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
599
+ } else {
600
+ const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
601
+ item.item.surcharge_fee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
602
+ item.item.relation_surcharge_ids = [...((_e = item.item) == null ? void 0 : _e.relation_surcharge_ids) || [], id];
603
+ }
604
+ }
605
+ configTotal = configTotal.plus(itemTotalSurcharge);
391
606
  }
392
607
  }
393
608
  if (fixed && new import_decimal.default(fixed).gt(0)) {
@@ -410,7 +625,10 @@ var getSurcharge = (state, options) => {
410
625
  type: "default",
411
626
  fixed,
412
627
  amount: finalAmount,
413
- percentage
628
+ percentage,
629
+ metadata: {
630
+ open_product
631
+ }
414
632
  });
415
633
  }
416
634
  return surchargeWithAmount;
@@ -520,6 +738,19 @@ var getSumTotal = (state, options) => {
520
738
  state,
521
739
  options
522
740
  });
741
+ const { productExpectAmount: productExpectAmountWithoutDiscount } = getProductExpectAmount(
742
+ state,
743
+ options.isEdit,
744
+ true
745
+ );
746
+ const originExpectAmountWithoutDiscount = getExpectAmount({
747
+ price: productExpectAmountWithoutDiscount,
748
+ tax: originTax,
749
+ surchargeAmount,
750
+ shopDiscount: 0,
751
+ state,
752
+ options
753
+ });
523
754
  const sumTotalAmount = getSumTotalAmount({ expectAmount, roundingAmount });
524
755
  const sumTotalAmountDecimal = new import_decimal.default((0, import_utils2.formatAmount)(sumTotalAmount, 2, "") || 0);
525
756
  const orderPaidAmountDecimal = new import_decimal.default(orderPaidAmount || 0);
@@ -546,7 +777,9 @@ var getSumTotal = (state, options) => {
546
777
  totalRefundAmount,
547
778
  dueAmount,
548
779
  roundingAmount,
549
- originExpectAmount
780
+ originExpectAmount,
781
+ // 订单原价 不包含整单折扣 不包含商品券折扣卡抵扣
782
+ originExpectAmountWithoutDiscount
550
783
  };
551
784
  };
552
785
  // Annotate the CommonJS export names for ESM import in node:
@@ -42,5 +42,18 @@ export declare const checkResourcesFormat: (resources: any[], service: any, isCh
42
42
  * @Date: 2024-12-23 12:05
43
43
  */
44
44
  export declare const formatProductPrice: (item: any) => number;
45
+ /**
46
+ * checkout2.0: 单个数量商品总价(原价),包含所有套餐子商品金额、报价单等等
47
+ * @param item
48
+ * @returns
49
+ */
50
+ export declare const formatOriginalPrice: (item: any) => number;
51
+ /**
52
+ * checkout2.0: 商品维度折扣后价格, original_price - 商品折扣金额(商品手动折扣等等)
53
+ * @param item
54
+ * @returns
55
+ */
56
+ export declare const formatSellingPrice: (item: any) => number;
57
+ export declare const getSourceProductPrice: (item: any) => number;
45
58
  export declare const formatValues: (state: any) => any;
46
59
  export declare const checkHolderIsError: (state: any) => any;
@@ -32,11 +32,14 @@ __export(utils_exports, {
32
32
  checkHolderIsError: () => checkHolderIsError,
33
33
  checkResourcesFormat: () => checkResourcesFormat,
34
34
  checkSubResourcesCapacity: () => checkSubResourcesCapacity,
35
+ formatOriginalPrice: () => formatOriginalPrice,
35
36
  formatProductBundle: () => formatProductBundle,
36
37
  formatProductOption: () => formatProductOption,
37
38
  formatProductPrice: () => formatProductPrice,
39
+ formatSellingPrice: () => formatSellingPrice,
38
40
  formatValues: () => formatValues,
39
- getBundleDiscountList: () => getBundleDiscountList
41
+ getBundleDiscountList: () => getBundleDiscountList,
42
+ getSourceProductPrice: () => getSourceProductPrice
40
43
  });
41
44
  module.exports = __toCommonJS(utils_exports);
42
45
  var import_dayjs = __toESM(require("dayjs"));
@@ -110,6 +113,8 @@ var formatProductBundle = (bundle) => {
110
113
  return temp + Number(item.num) * item.custom_add_price;
111
114
  }, 0);
112
115
  return {
116
+ "is_charge_tax": d.is_charge_tax,
117
+ "tax_fee": d.tax_fee,
113
118
  "bundle_group_id": d.group_id,
114
119
  "bundle_id": d.id,
115
120
  "bundle_product_id": (d == null ? void 0 : d._bundle_product_id) || (d == null ? void 0 : d.product_id),
@@ -125,8 +130,13 @@ var formatProductBundle = (bundle) => {
125
130
  "option": option,
126
131
  "bundle_selling_price": d == null ? void 0 : d.price,
127
132
  "bundle_sum_price": (d == null ? void 0 : d.original_price) || (d == null ? void 0 : d.original_total),
128
- metadata: {
129
- custom_product_bundle_map_id: d._id
133
+ "metadata": {
134
+ custom_product_bundle_map_id: d._id,
135
+ // 子商品单数量附加费
136
+ "surcharge_fee": d.surcharge_fee,
137
+ // 可选,附加费均摊舍入金额
138
+ "surcharge_rounding_remainder": d.surcharge_rounding_remainder,
139
+ relation_surcharge_ids: d.relation_surcharge_ids || []
130
140
  }
131
141
  };
132
142
  });
@@ -274,6 +284,23 @@ var formatMetaData = (item, isMultiDayPrices) => {
274
284
  }
275
285
  return metadata;
276
286
  };
287
+ var formatProductMetadata = (item) => {
288
+ var _a, _b, _c, _d, _e, _f, _g, _h;
289
+ let metadata = {};
290
+ if ((_a = item._extend) == null ? void 0 : _a.surcharge_fee) {
291
+ metadata.main_product_attached_bundle_surcharge_fee = (_b = item._extend) == null ? void 0 : _b.surcharge_fee;
292
+ }
293
+ if ((_c = item._extend) == null ? void 0 : _c.main_product_attached_bundle_tax_fee) {
294
+ metadata.main_product_attached_bundle_tax_fee = (_d = item._extend) == null ? void 0 : _d.main_product_attached_bundle_tax_fee;
295
+ }
296
+ if ((_e = item._extend) == null ? void 0 : _e.surcharge_rounding_remainder) {
297
+ metadata.surcharge_rounding_remainder = (_f = item._extend) == null ? void 0 : _f.surcharge_rounding_remainder;
298
+ }
299
+ if ((_g = item._extend) == null ? void 0 : _g.relation_surcharge_ids) {
300
+ metadata.relation_surcharge_ids = (_h = item._extend) == null ? void 0 : _h.relation_surcharge_ids;
301
+ }
302
+ return metadata;
303
+ };
277
304
  var getSourceProductPrice = (item) => {
278
305
  var _a, _b, _c;
279
306
  const other = (_a = item._extend) == null ? void 0 : _a.other;
@@ -329,7 +356,7 @@ var formatProducts = (item, quantity) => {
329
356
  "product_option_item": formatProductOption((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
330
357
  "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
331
358
  "discount_list": notManualDiscount,
332
- metadata: formatMetaData(item),
359
+ metadata: formatProductMetadata(item),
333
360
  // checkout 需求新增字段
334
361
  "calculated_original_price": formatOriginalPrice(item),
335
362
  "calculated_selling_price": formatSellingPrice(item),
@@ -392,7 +419,7 @@ var formatBookings = (data, values) => {
392
419
  let bookings = [];
393
420
  let obj = {};
394
421
  list.forEach((item) => {
395
- var _a, _b, _c, _d, _e, _f;
422
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
396
423
  if (item.isCustomItem) {
397
424
  bookings.push({
398
425
  ...item._extend,
@@ -465,12 +492,20 @@ var formatBookings = (data, values) => {
465
492
  for (let i = 0; i < (item._extend.quantity || 1); i++) {
466
493
  const newItem = (0, import_lodash.cloneDeep)(item);
467
494
  newItem._extend.unique_identification_number = `${item._extend.unique_identification_number}_${i}`;
495
+ if (i > 0) {
496
+ newItem._extend.surcharge_rounding_remainder = void 0;
497
+ if (((_i = (_h = (_g = newItem._extend) == null ? void 0 : _g.other) == null ? void 0 : _h.bundle) == null ? void 0 : _i.length) > 0) {
498
+ newItem._extend.other.bundle.forEach((bundleItem) => {
499
+ bundleItem.surcharge_rounding_remainder = void 0;
500
+ });
501
+ }
502
+ }
468
503
  bookings.push({
469
504
  ...booking,
470
505
  product: formatProducts(newItem, 1),
471
506
  number: item._extend.capacity ? (0, import_utilsByBooking.getSumCapacity)({ cacheItem: newItem }, false) : newItem._extend.number || 1,
472
507
  holder: getHolderByIndex(booking.holder, i),
473
- metadata: formatMetaData(newItem)
508
+ metadata: formatMetaData(newItem, false)
474
509
  });
475
510
  }
476
511
  });
@@ -629,9 +664,12 @@ var checkHolderIsError = (state) => {
629
664
  checkHolderIsError,
630
665
  checkResourcesFormat,
631
666
  checkSubResourcesCapacity,
667
+ formatOriginalPrice,
632
668
  formatProductBundle,
633
669
  formatProductOption,
634
670
  formatProductPrice,
671
+ formatSellingPrice,
635
672
  formatValues,
636
- getBundleDiscountList
673
+ getBundleDiscountList,
674
+ getSourceProductPrice
637
675
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface FooterProps {
2
3
  state: any;
3
4
  reload: () => void;
@@ -1,9 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import { SendModalValues } from './index';
2
3
  declare const useSendModal: (bookingId?: number) => {
3
4
  open: boolean;
4
5
  setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
5
6
  handleOpen: () => void;
6
7
  handleValuesChange: (val: any) => void;
7
- handleOk: (values: SendModalValues) => Promise<any>;
8
+ handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
8
9
  };
9
10
  export default useSendModal;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useClearCart: (state: any, dispatch: any) => false | JSX.Element;
2
3
  export default useClearCart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
3
4
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellDrawerProps } from '../../../components/drawer';
2
3
  import './index.less';
3
4
  interface AddServiceProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AddTimeModal: () => JSX.Element;
4
3
  export default AddTimeModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => JSX.Element;
3
4
  export default ServiceItem;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -248,4 +248,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
248
248
  * @Author: WangHan
249
249
  * @Date: 2024-12-24 11:32
250
250
  */
251
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
251
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PisellDrawerProps } from '../../../components/drawer';
3
2
  import '../../../info/service/addService/index.less';
4
3
  interface AddServiceProps {