@pisell/private-materials 6.6.5 → 6.6.6

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 (411) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  12. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Services/index.js +25 -22
  14. package/es/components/appointmentBooking/components/Voucher/index.js +15 -1
  15. package/es/components/booking/addons/index.js +25 -17
  16. package/es/components/booking/components/actionButtons/index.js +3 -1
  17. package/es/components/booking/components/footer/amount.d.ts +1 -0
  18. package/es/components/booking/components/footer/amount.js +548 -84
  19. package/es/components/booking/components/footer/index.js +36 -33
  20. package/es/components/booking/components/footer/utils.d.ts +19 -0
  21. package/es/components/booking/components/footer/utils.js +166 -67
  22. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  23. package/es/components/booking/components/voucher/index.js +53 -15
  24. package/es/components/booking/forms/table/index.d.ts +0 -1
  25. package/es/components/booking/hooks/useQuotation.js +4 -1
  26. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  27. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  28. package/es/components/booking/info/service/like/index.d.ts +0 -1
  29. package/es/components/booking/info/service2/utils.js +1 -0
  30. package/es/components/booking/info2/cartClientCard/index.js +5 -3
  31. package/es/components/booking/info2/service/addService/index.js +9 -9
  32. package/es/components/booking/info2/service/editNormalService/index.js +6 -0
  33. package/es/components/booking/info2/service/editService/index.js +27 -17
  34. package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
  35. package/es/components/booking/info2/service/editService/utils.js +66 -0
  36. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  37. package/es/components/booking/utils.d.ts +1 -0
  38. package/es/components/booking/utils.js +15 -2
  39. package/es/components/checkout/components/AmountSummary/index.less +4 -5
  40. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  41. package/es/components/eftpos/form/index.d.ts +0 -1
  42. package/es/components/eftpos/group/index.d.ts +0 -1
  43. package/es/components/eftpos/hooks.d.ts +0 -1
  44. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  45. package/es/components/eftpos/icon/device.d.ts +0 -1
  46. package/es/components/eftpos/receipt/index.d.ts +0 -1
  47. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  48. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  49. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  50. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  51. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
  52. package/es/components/eftposPay/payo/config.d.ts +1 -0
  53. package/es/components/eftposPay/payo/config.js +70 -32
  54. package/es/components/eftposPay/payo/payment.d.ts +66 -0
  55. package/es/components/eftposPay/payo/payment.js +579 -0
  56. package/es/components/eftposPay/store/index.d.ts +1 -1
  57. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  58. package/es/components/eftposPay/utils/log/index.d.ts +110 -0
  59. package/es/components/eftposPay/utils/log/index.js +371 -0
  60. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  61. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  63. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  68. package/es/components/index.d.ts +2 -2
  69. package/es/components/index.js +2 -2
  70. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
  71. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  72. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  73. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
  74. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
  75. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  76. package/es/components/pay/toC/index.js +7 -4
  77. package/es/components/pay/toC/locales.d.ts +3 -0
  78. package/es/components/pay/toC/locales.js +6 -3
  79. package/es/components/pay/toC/status.d.ts +1 -0
  80. package/es/components/pay/toC/status.js +3 -0
  81. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  82. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  83. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  84. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  85. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  86. package/es/components/schedules/products/index.d.ts +0 -1
  87. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  88. package/es/components/subTotal/index.js +1 -1
  89. package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
  90. package/es/components/{wallet/serve.js → systemSettings/registry/components/GroupModal.js} +145 -190
  91. package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
  92. package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
  93. package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
  94. package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
  95. package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
  96. package/es/components/systemSettings/registry/components/SectionList.js +174 -0
  97. package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
  98. package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
  99. package/es/components/systemSettings/registry/components/index.d.ts +4 -0
  100. package/es/components/systemSettings/registry/components/index.js +4 -0
  101. package/es/components/systemSettings/registry/index.d.ts +5 -0
  102. package/es/components/systemSettings/registry/index.js +1059 -0
  103. package/es/components/systemSettings/registry/index.less +410 -0
  104. package/es/components/systemSettings/registry/locales.d.ts +272 -0
  105. package/es/components/systemSettings/registry/locales.js +300 -0
  106. package/es/components/systemSettings/registry/services.d.ts +77 -0
  107. package/es/components/systemSettings/registry/services.js +472 -0
  108. package/es/components/systemSettings/registry/types.d.ts +126 -0
  109. package/es/components/systemSettings/registry/types.js +1 -0
  110. package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  111. package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
  112. package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
  113. package/es/components/systemSettings/registry/utils/validators.js +44 -0
  114. package/es/components/ticketBooking/components/addServiceVariant/addService.js +7 -5
  115. package/es/components/ticketBooking/utils/index.d.ts +5 -1
  116. package/es/components/ticketBooking/utils/index.js +37 -17
  117. package/es/components/walletList/index.d.ts +0 -25
  118. package/es/components/walletList/index.js +173 -41
  119. package/es/components/walletList/locales.d.ts +9 -0
  120. package/es/components/walletList/locales.js +12 -3
  121. package/es/components/walletList/serve.d.ts +19 -0
  122. package/es/components/walletList/serve.js +94 -5
  123. package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
  124. package/es/components/walletList/tempHolderSelector/index.js +196 -0
  125. package/es/components/walletList/tempHolderSelector/index.less +63 -0
  126. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  127. package/es/index.d.ts +3 -2
  128. package/es/index.js +4 -3
  129. package/es/plus/clientName/index.d.ts +0 -1
  130. package/es/plus/walletEditor/WalletEditor.js +60 -2
  131. package/es/plus/walletEditor/locales.d.ts +9 -0
  132. package/es/plus/walletEditor/locales.js +12 -3
  133. package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
  134. package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
  135. package/es/plus/walletPassGallery/components/passDetail/index.js +5 -1
  136. package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
  137. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  138. package/es/plus/walletPassGallery/components/passList/index.js +17 -5
  139. package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
  140. package/es/plus/walletPassGallery/index.js +226 -42
  141. package/es/plus/walletPassGallery/locales.d.ts +15 -0
  142. package/es/plus/walletPassGallery/locales.js +29 -5
  143. package/es/plus/walletPassGallery/serve.d.ts +15 -1
  144. package/es/plus/walletPassGallery/serve.js +59 -2
  145. package/es/plus/walletPassGallery/utils.d.ts +48 -0
  146. package/es/plus/walletPassGallery/utils.js +342 -0
  147. package/es/pro/Login2.0/index.less +15 -8
  148. package/es/pro/pisellPaymentList/example.d.ts +0 -1
  149. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
  150. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  151. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  152. package/lib/components/appointmentBooking/components/Services/index.js +5 -2
  153. package/lib/components/appointmentBooking/components/Voucher/index.js +13 -1
  154. package/lib/components/booking/addons/index.js +15 -7
  155. package/lib/components/booking/components/actionButtons/index.js +4 -2
  156. package/lib/components/booking/components/footer/amount.d.ts +1 -0
  157. package/lib/components/booking/components/footer/amount.js +293 -41
  158. package/lib/components/booking/components/footer/index.js +5 -2
  159. package/lib/components/booking/components/footer/utils.d.ts +19 -0
  160. package/lib/components/booking/components/footer/utils.js +111 -35
  161. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  162. package/lib/components/booking/components/voucher/index.js +56 -16
  163. package/lib/components/booking/forms/table/index.d.ts +0 -1
  164. package/lib/components/booking/hooks/useQuotation.js +2 -1
  165. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  166. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  167. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  168. package/lib/components/booking/info/service2/utils.js +1 -0
  169. package/lib/components/booking/info2/cartClientCard/index.js +4 -2
  170. package/lib/components/booking/info2/service/addService/index.js +1 -1
  171. package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
  172. package/lib/components/booking/info2/service/editService/index.js +30 -8
  173. package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
  174. package/lib/components/booking/info2/service/editService/utils.js +40 -3
  175. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  176. package/lib/components/booking/utils.d.ts +1 -0
  177. package/lib/components/booking/utils.js +11 -0
  178. package/lib/components/checkout/components/AmountSummary/index.less +4 -5
  179. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  180. package/lib/components/eftpos/form/index.d.ts +0 -1
  181. package/lib/components/eftpos/group/index.d.ts +0 -1
  182. package/lib/components/eftpos/hooks.d.ts +0 -1
  183. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  184. package/lib/components/eftpos/icon/device.d.ts +0 -1
  185. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  186. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  187. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  188. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  189. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  190. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
  191. package/lib/components/eftposPay/payo/config.d.ts +1 -0
  192. package/lib/components/eftposPay/payo/config.js +98 -73
  193. package/lib/components/eftposPay/payo/payment.d.ts +66 -0
  194. package/lib/components/eftposPay/payo/payment.js +357 -0
  195. package/lib/components/eftposPay/store/index.d.ts +1 -1
  196. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  197. package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
  198. package/lib/components/eftposPay/utils/log/index.js +294 -0
  199. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  200. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  201. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  202. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  203. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  204. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  205. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  206. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  207. package/lib/components/index.d.ts +2 -2
  208. package/lib/components/index.js +3 -3
  209. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
  210. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  211. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  212. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
  213. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
  214. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  215. package/lib/components/pay/toC/index.js +4 -1
  216. package/lib/components/pay/toC/locales.d.ts +3 -0
  217. package/lib/components/pay/toC/locales.js +6 -3
  218. package/lib/components/pay/toC/status.d.ts +1 -0
  219. package/lib/components/pay/toC/status.js +5 -0
  220. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  221. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  222. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  223. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  224. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  225. package/lib/components/schedules/products/index.d.ts +0 -1
  226. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  227. package/lib/components/subTotal/index.js +1 -1
  228. package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
  229. package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
  230. package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
  231. package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
  232. package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
  233. package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
  234. package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
  235. package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
  236. package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
  237. package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
  238. package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
  239. package/lib/components/{wallet → systemSettings/registry}/components/index.js +13 -10
  240. package/lib/components/systemSettings/registry/index.d.ts +5 -0
  241. package/lib/components/systemSettings/registry/index.js +529 -0
  242. package/lib/components/systemSettings/registry/index.less +410 -0
  243. package/lib/components/systemSettings/registry/locales.d.ts +272 -0
  244. package/lib/components/systemSettings/registry/locales.js +324 -0
  245. package/lib/components/systemSettings/registry/services.d.ts +77 -0
  246. package/lib/components/systemSettings/registry/services.js +290 -0
  247. package/lib/components/systemSettings/registry/types.d.ts +126 -0
  248. package/lib/components/{wallet/RechargeableCard/serve.js → systemSettings/registry/types.js} +3 -19
  249. package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  250. package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
  251. package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
  252. package/lib/components/systemSettings/registry/utils/validators.js +54 -0
  253. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -7
  254. package/lib/components/ticketBooking/utils/index.d.ts +5 -1
  255. package/lib/components/ticketBooking/utils/index.js +21 -6
  256. package/lib/components/walletList/index.d.ts +0 -25
  257. package/lib/components/walletList/index.js +100 -4
  258. package/lib/components/walletList/locales.d.ts +9 -0
  259. package/lib/components/walletList/locales.js +12 -3
  260. package/lib/components/walletList/serve.d.ts +19 -0
  261. package/lib/components/walletList/serve.js +26 -3
  262. package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
  263. package/lib/components/walletList/tempHolderSelector/index.js +166 -0
  264. package/lib/components/walletList/tempHolderSelector/index.less +63 -0
  265. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  266. package/lib/index.d.ts +3 -2
  267. package/lib/index.js +5 -2
  268. package/lib/plus/clientName/index.d.ts +0 -1
  269. package/lib/plus/walletEditor/WalletEditor.js +53 -0
  270. package/lib/plus/walletEditor/locales.d.ts +9 -0
  271. package/lib/plus/walletEditor/locales.js +12 -3
  272. package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
  273. package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
  274. package/lib/plus/walletPassGallery/components/passDetail/index.js +4 -1
  275. package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
  276. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  277. package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
  278. package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
  279. package/lib/plus/walletPassGallery/index.js +157 -28
  280. package/lib/plus/walletPassGallery/locales.d.ts +15 -0
  281. package/lib/plus/walletPassGallery/locales.js +32 -5
  282. package/lib/plus/walletPassGallery/serve.d.ts +15 -1
  283. package/lib/plus/walletPassGallery/serve.js +17 -5
  284. package/lib/plus/walletPassGallery/utils.d.ts +48 -0
  285. package/lib/plus/walletPassGallery/utils.js +287 -0
  286. package/lib/pro/Login2.0/index.less +15 -8
  287. package/lib/pro/pisellPaymentList/example.d.ts +0 -1
  288. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
  289. package/lowcode/settings-registry/meta.ts +29 -0
  290. package/package.json +3 -3
  291. package/es/components/wallet/Detail/index.d.ts +0 -42
  292. package/es/components/wallet/Detail/index.js +0 -1182
  293. package/es/components/wallet/Detail/index.less +0 -386
  294. package/es/components/wallet/Detail/locales.d.ts +0 -153
  295. package/es/components/wallet/Detail/locales.js +0 -170
  296. package/es/components/wallet/Detail/model.d.ts +0 -13
  297. package/es/components/wallet/Detail/model.js +0 -22
  298. package/es/components/wallet/Detail/serve.d.ts +0 -39
  299. package/es/components/wallet/Detail/serve.js +0 -64
  300. package/es/components/wallet/DetailContext.d.ts +0 -25
  301. package/es/components/wallet/DetailContext.js +0 -162
  302. package/es/components/wallet/DiscountCard/index.d.ts +0 -3
  303. package/es/components/wallet/DiscountCard/index.js +0 -218
  304. package/es/components/wallet/DiscountCard/index.less +0 -9
  305. package/es/components/wallet/DiscountCard/model.d.ts +0 -14
  306. package/es/components/wallet/DiscountCard/model.js +0 -22
  307. package/es/components/wallet/PointCard/index.d.ts +0 -3
  308. package/es/components/wallet/PointCard/index.js +0 -169
  309. package/es/components/wallet/PointCard/index.less +0 -9
  310. package/es/components/wallet/PointCard/model.d.ts +0 -13
  311. package/es/components/wallet/PointCard/model.js +0 -22
  312. package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
  313. package/es/components/wallet/RechargeableCard/index.js +0 -463
  314. package/es/components/wallet/RechargeableCard/index.less +0 -108
  315. package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
  316. package/es/components/wallet/RechargeableCard/model.js +0 -28
  317. package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
  318. package/es/components/wallet/RechargeableCard/serve.js +0 -32
  319. package/es/components/wallet/Voucher/index.d.ts +0 -12
  320. package/es/components/wallet/Voucher/index.js +0 -131
  321. package/es/components/wallet/Voucher/index.less +0 -9
  322. package/es/components/wallet/Voucher/locales.d.ts +0 -21
  323. package/es/components/wallet/Voucher/locales.js +0 -20
  324. package/es/components/wallet/Voucher/model.d.ts +0 -13
  325. package/es/components/wallet/Voucher/model.js +0 -22
  326. package/es/components/wallet/carouselArrow.png +0 -0
  327. package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
  328. package/es/components/wallet/components/FooterButtons/index.js +0 -81
  329. package/es/components/wallet/components/FooterButtons/index.less +0 -91
  330. package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
  331. package/es/components/wallet/components/UsageRules/index.js +0 -147
  332. package/es/components/wallet/components/UsageRules/index.less +0 -157
  333. package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
  334. package/es/components/wallet/components/WalletBar/index.js +0 -19
  335. package/es/components/wallet/components/WalletBar/index.less +0 -36
  336. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  337. package/es/components/wallet/components/WalletCard.js +0 -91
  338. package/es/components/wallet/components/index.d.ts +0 -3
  339. package/es/components/wallet/components/index.js +0 -4
  340. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
  341. package/es/components/wallet/hooks/useWalletCard.js +0 -147
  342. package/es/components/wallet/index.d.ts +0 -10
  343. package/es/components/wallet/index.js +0 -807
  344. package/es/components/wallet/index.less +0 -151
  345. package/es/components/wallet/locales.d.ts +0 -132
  346. package/es/components/wallet/locales.js +0 -139
  347. package/es/components/wallet/model.d.ts +0 -37
  348. package/es/components/wallet/model.js +0 -86
  349. package/es/components/wallet/serve.d.ts +0 -150
  350. package/es/components/wallet/utils/formatUtils.d.ts +0 -36
  351. package/es/components/wallet/utils/formatUtils.js +0 -73
  352. package/lib/components/wallet/Detail/index.d.ts +0 -42
  353. package/lib/components/wallet/Detail/index.js +0 -874
  354. package/lib/components/wallet/Detail/index.less +0 -386
  355. package/lib/components/wallet/Detail/locales.d.ts +0 -153
  356. package/lib/components/wallet/Detail/locales.js +0 -194
  357. package/lib/components/wallet/Detail/model.d.ts +0 -13
  358. package/lib/components/wallet/Detail/model.js +0 -43
  359. package/lib/components/wallet/Detail/serve.d.ts +0 -39
  360. package/lib/components/wallet/Detail/serve.js +0 -44
  361. package/lib/components/wallet/DetailContext.d.ts +0 -25
  362. package/lib/components/wallet/DetailContext.js +0 -118
  363. package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
  364. package/lib/components/wallet/DiscountCard/index.js +0 -209
  365. package/lib/components/wallet/DiscountCard/index.less +0 -9
  366. package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
  367. package/lib/components/wallet/DiscountCard/model.js +0 -43
  368. package/lib/components/wallet/PointCard/index.d.ts +0 -3
  369. package/lib/components/wallet/PointCard/index.js +0 -190
  370. package/lib/components/wallet/PointCard/index.less +0 -9
  371. package/lib/components/wallet/PointCard/model.d.ts +0 -13
  372. package/lib/components/wallet/PointCard/model.js +0 -43
  373. package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
  374. package/lib/components/wallet/RechargeableCard/index.js +0 -380
  375. package/lib/components/wallet/RechargeableCard/index.less +0 -108
  376. package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
  377. package/lib/components/wallet/RechargeableCard/model.js +0 -49
  378. package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
  379. package/lib/components/wallet/Voucher/index.d.ts +0 -12
  380. package/lib/components/wallet/Voucher/index.js +0 -146
  381. package/lib/components/wallet/Voucher/index.less +0 -9
  382. package/lib/components/wallet/Voucher/locales.d.ts +0 -21
  383. package/lib/components/wallet/Voucher/locales.js +0 -44
  384. package/lib/components/wallet/Voucher/model.d.ts +0 -13
  385. package/lib/components/wallet/Voucher/model.js +0 -43
  386. package/lib/components/wallet/carouselArrow.png +0 -0
  387. package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
  388. package/lib/components/wallet/components/FooterButtons/index.js +0 -109
  389. package/lib/components/wallet/components/FooterButtons/index.less +0 -91
  390. package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
  391. package/lib/components/wallet/components/UsageRules/index.js +0 -113
  392. package/lib/components/wallet/components/UsageRules/index.less +0 -157
  393. package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
  394. package/lib/components/wallet/components/WalletBar/index.js +0 -49
  395. package/lib/components/wallet/components/WalletBar/index.less +0 -36
  396. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
  397. package/lib/components/wallet/components/WalletCard.js +0 -97
  398. package/lib/components/wallet/components/index.d.ts +0 -3
  399. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
  400. package/lib/components/wallet/hooks/useWalletCard.js +0 -111
  401. package/lib/components/wallet/index.d.ts +0 -10
  402. package/lib/components/wallet/index.js +0 -580
  403. package/lib/components/wallet/index.less +0 -151
  404. package/lib/components/wallet/locales.d.ts +0 -132
  405. package/lib/components/wallet/locales.js +0 -163
  406. package/lib/components/wallet/model.d.ts +0 -37
  407. package/lib/components/wallet/model.js +0 -91
  408. package/lib/components/wallet/serve.d.ts +0 -150
  409. package/lib/components/wallet/serve.js +0 -85
  410. package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
  411. package/lib/components/wallet/utils/formatUtils.js +0 -73
@@ -87,11 +87,14 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
87
87
  setting: { can_input: true, item_max_length: isShowProductDetailStepper, is_detail_open: clickType === "cover" }
88
88
  },
89
89
  callback: async (data) => {
90
- var _a, _b;
90
+ var _a, _b, _c, _d, _e;
91
91
  if (data.isCancel) {
92
92
  appointmentBooking.closeProductDetail();
93
93
  return;
94
94
  }
95
+ if (data == null ? void 0 : data.origin) {
96
+ data.origin.isFormSubject = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.bookingSetting) == null ? void 0 : _b.bookingSubject) == null ? void 0 : _c.type) === "form";
97
+ }
95
98
  const product = {
96
99
  ...data,
97
100
  options: (data == null ? void 0 : data.option) || []
@@ -125,7 +128,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
125
128
  endDate
126
129
  });
127
130
  } else {
128
- const resources = ((_b = (_a = data == null ? void 0 : data.origin) == null ? void 0 : _a.product_resource) == null ? void 0 : _b.resources) || [];
131
+ const resources = ((_e = (_d = data == null ? void 0 : data.origin) == null ? void 0 : _d.product_resource) == null ? void 0 : _e.resources) || [];
129
132
  const activeStatus = resources.find((item2) => item2.status === 1);
130
133
  if (!activeStatus && !appointmentBooking.isTargetNormalProduct(data == null ? void 0 : data.origin)) {
131
134
  return (0, import_utils2.Toast)(
@@ -96,7 +96,7 @@ var VoucherCard = (props) => {
96
96
  return {
97
97
  _id: item._id,
98
98
  quantity: item.num,
99
- bundle: item._bundleOrigin,
99
+ bundle: item.bundle,
100
100
  options: item._optionsOrigin,
101
101
  product: {
102
102
  ...item._productOrigin
@@ -111,6 +111,18 @@ var VoucherCard = (props) => {
111
111
  const val = shopDiscount.calcDiscount(products2);
112
112
  batchUpdateCart(val.productList);
113
113
  };
114
+ const stringifiedHolders = (0, import_react.useMemo)(() => {
115
+ let _ret;
116
+ try {
117
+ _ret = JSON.stringify(products.map((item) => (item == null ? void 0 : item.holder_id) || ""));
118
+ } catch (error) {
119
+ _ret = "";
120
+ }
121
+ return _ret;
122
+ }, [products]);
123
+ (0, import_react.useEffect)(() => {
124
+ onCartChange();
125
+ }, [stringifiedHolders]);
114
126
  (0, import_react.useEffect)(() => {
115
127
  const val = shopDiscount.getDiscountList();
116
128
  setDisCountList(val);
@@ -51,23 +51,31 @@ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext")
51
51
  var formatProducts = (values) => {
52
52
  let arr = [];
53
53
  arr = values.map((item) => {
54
- var _a, _b, _c, _d, _e, _f, _g;
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
55
+ const bundleDiscountList = (0, import_utils.getBundleDiscountList)(((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []);
56
+ const discount_list = [...(item == null ? void 0 : item.discount_list) || []];
57
+ discount_list.push(...bundleDiscountList);
55
58
  return {
56
59
  order_detail_id: item.order_detail_id || 0,
57
60
  num: item._extend.quantity,
58
61
  price: (0, import_utils.formatProductPrice)(item),
59
62
  product_id: item.id,
60
- discount_list: (item == null ? void 0 : item.discount_list) || [],
63
+ discount_list: discount_list || [],
61
64
  discount_amount: 0,
62
65
  product_discount_reason: "",
63
66
  is_charge_tax: item.is_charge_tax,
64
67
  note: "",
65
68
  discountway: "num",
66
69
  discount_type: "discount",
67
- bundle_edit: (_a = item._extend) == null ? void 0 : _a.bundle_edit,
68
- product_bundle: (0, import_utils.formatProductBundle)((_c = (_b = item._extend) == null ? void 0 : _b.other) == null ? void 0 : _c.bundle),
69
- "product_option_item": (0, import_utils.formatProductOption)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.option),
70
- "product_variant_id": ((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.product_variant_id) || 0
70
+ bundle_edit: (_c = item._extend) == null ? void 0 : _c.bundle_edit,
71
+ product_bundle: (0, import_utils.formatProductBundle)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
72
+ "product_option_item": (0, import_utils.formatProductOption)((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
73
+ "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
74
+ "source_product_price": (0, import_utils.getSourceProductPrice)(item),
75
+ "main_product_selling_price": (0, import_utils.getMainProductSellingPrice)(item) ?? (0, import_utils.formatProductPrice)(item),
76
+ "calculated_original_price": (0, import_utils.formatOriginalPrice)(item),
77
+ "calculated_selling_price": (0, import_utils.formatSellingPrice)(item),
78
+ "tax_fee": item._extend.tax_fee
71
79
  };
72
80
  });
73
81
  return arr;
@@ -241,12 +249,12 @@ var Addons = (0, import_model.Provider)((props) => {
241
249
  isAddons: true,
242
250
  _key: e.key,
243
251
  _extend: {
244
- price: _detail.price,
245
252
  other: e,
246
253
  quantity: (e == null ? void 0 : e.quantity) || 1
247
254
  },
248
255
  quantity: (e == null ? void 0 : e.quantity) || 1
249
256
  };
257
+ product._extend.price = (0, import_utils2.getMainPrice)(product, _detail.price);
250
258
  let _total = (0, import_utils2.getProductTotalPrice)(product);
251
259
  product._extend.total = _total;
252
260
  product._extend.origin_total = _total;
@@ -72,7 +72,8 @@ var ActionButtons = ({
72
72
  const { ScheduleModule } = pisellosAllModule;
73
73
  const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
74
74
  const changeCustomerToGlobalState = (0, import_ahooks.useMemoizedFn)((value) => {
75
- var _a2, _b2;
75
+ var _a2, _b2, _c2;
76
+ const beforeValue = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.value;
76
77
  dispatch({
77
78
  type: "setClient",
78
79
  payload: {
@@ -80,7 +81,8 @@ var ActionButtons = ({
80
81
  edit: true
81
82
  }
82
83
  });
83
- if ((_b2 = (_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) {
84
+ if ((beforeValue == null ? void 0 : beforeValue.id) === (value == null ? void 0 : value.id)) return;
85
+ if ((_c2 = (_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.value) == null ? void 0 : _c2.length) {
84
86
  dispatch({
85
87
  type: "setService",
86
88
  payload: {
@@ -33,4 +33,5 @@ export declare const getSumTotal: (state: any, options: {
33
33
  dueAmount: number;
34
34
  roundingAmount: number;
35
35
  originExpectAmount: number;
36
+ originExpectAmountWithoutDiscount: number;
36
37
  };
@@ -48,7 +48,7 @@ var getRelationDetailsTotal = (relation_details) => {
48
48
  }
49
49
  return total.toNumber();
50
50
  };
51
- var getProductExpectAmount = (state, isEdit) => {
51
+ var getProductExpectAmount = (state, isEdit, isOriginTotal) => {
52
52
  var _a, _b, _c, _d;
53
53
  let price = new import_decimal.default(0);
54
54
  let duration = new import_decimal.default(0);
@@ -62,7 +62,8 @@ var getProductExpectAmount = (state, isEdit) => {
62
62
  if (isDay || (0, import_utils3.isNormalProductByDurationSchedule)(item) || (0, import_utils4.isMultiDayProduct)(item)) {
63
63
  const quantity = new import_decimal.default(item._extend.quantity || 1);
64
64
  const itemTotal = new import_decimal.default(item._extend.total || 0);
65
- price = price.add(itemTotal.mul(quantity));
65
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
66
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
66
67
  const _duration = !(0, import_utils3.isNormalProductByDurationSchedule)(item) ? new import_decimal.default(item._extend.duration || 0) : new import_decimal.default(0);
67
68
  if (isDay || (0, import_utils4.isMultiDayProduct)(item)) {
68
69
  dayDuration = dayDuration.add(_duration);
@@ -72,7 +73,8 @@ var getProductExpectAmount = (state, isEdit) => {
72
73
  } else {
73
74
  const quantity = new import_decimal.default(item._extend.quantity || 1);
74
75
  const itemTotal = new import_decimal.default(item._extend.total || 0);
75
- price = price.add(itemTotal.mul(quantity));
76
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
77
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
76
78
  const relationTotal = new import_decimal.default(getRelationDetailsTotal(
77
79
  item._extend.relation_details || []
78
80
  ));
@@ -91,7 +93,8 @@ var getProductExpectAmount = (state, isEdit) => {
91
93
  for (let item of state.addons.value) {
92
94
  const quantity = new import_decimal.default(item._extend.quantity || 1);
93
95
  const itemTotal = new import_decimal.default(item._extend.total || 0);
94
- price = price.add(itemTotal.mul(quantity));
96
+ const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
97
+ price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
95
98
  }
96
99
  }
97
100
  }
@@ -147,9 +150,10 @@ var getProductItemTax = (item, state, options) => {
147
150
  }
148
151
  }
149
152
  }
150
- return singleItemTax.times(quantity);
153
+ return singleItemTax.times(quantity).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
151
154
  };
152
155
  var processItemsTax = (items, state, options) => {
156
+ var _a, _b, _c;
153
157
  const { tax_rate, is_price_include_tax, computed } = options;
154
158
  const { shopDiscount, productExpectAmount } = computed;
155
159
  let originTax = new import_decimal.default(0);
@@ -157,10 +161,11 @@ var processItemsTax = (items, state, options) => {
157
161
  for (let item of items) {
158
162
  const quantity = new import_decimal.default(item._extend.quantity || 1);
159
163
  const unitPrice = new import_decimal.default(item._extend.total || 0);
160
- const originalTaxPerItem = getProductItemTax(
164
+ const mainProductPrice = new import_decimal.default(getMainProductTotal(item) || 0);
165
+ let originalTaxPerItem = getProductItemTax(
161
166
  {
162
167
  ...item,
163
- total: unitPrice.toNumber(),
168
+ total: mainProductPrice.add(((_a = item._extend) == null ? void 0 : _a.surcharge_fee) || 0).toNumber(),
164
169
  quantity: 1
165
170
  },
166
171
  state,
@@ -170,19 +175,22 @@ var processItemsTax = (items, state, options) => {
170
175
  if (productExpectAmount > 0) {
171
176
  itemDiscount = unitPrice.dividedBy(productExpectAmount).times(shopDiscount);
172
177
  }
173
- const itemDiscountedUnitPrice = unitPrice.minus(itemDiscount);
174
- const discountedTaxPerItem = getProductItemTax(
178
+ let mainItemDiscount = new import_decimal.default(0);
179
+ if (unitPrice.greaterThan(0)) {
180
+ mainItemDiscount = mainProductPrice.dividedBy(productExpectAmount).times(shopDiscount);
181
+ }
182
+ const mainItemDiscountedUnitPrice = mainProductPrice.minus(mainItemDiscount).add(((_b = item._extend) == null ? void 0 : _b.surcharge_fee) || 0);
183
+ const maxDiscountedTaxPerItem = getProductItemTax(
175
184
  {
176
185
  ...item,
177
- total: itemDiscountedUnitPrice.toNumber(),
186
+ total: mainItemDiscountedUnitPrice.toNumber(),
178
187
  price: item._extend.total,
179
188
  quantity: 1
180
189
  },
181
190
  state,
182
191
  { tax_rate, is_price_include_tax }
183
192
  );
184
- item._extend.original_tax_fee = originalTaxPerItem.toNumber();
185
- item._extend.tax_fee = discountedTaxPerItem.toNumber();
193
+ item._extend.main_product_attached_bundle_tax_fee = maxDiscountedTaxPerItem.toNumber();
186
194
  let addTimeTotalTax = new import_decimal.default(0);
187
195
  if (Array.isArray(item._extend.relation_details)) {
188
196
  for (let atItem of item._extend.relation_details) {
@@ -198,8 +206,7 @@ var processItemsTax = (items, state, options) => {
198
206
  const addTimeTaxPerItem = getProductItemTax(
199
207
  {
200
208
  ...atItem,
201
- total: _discountedTotal,
202
- // 可能包含原有数据,或前端临时数据
209
+ total: _discountedTotal.add((atItem == null ? void 0 : atItem.surcharge_fee) || 0).toNumber(),
203
210
  quantity: atItem.product_quantity || atItem.num || 1
204
211
  },
205
212
  state,
@@ -208,8 +215,51 @@ var processItemsTax = (items, state, options) => {
208
215
  addTimeTotalTax = addTimeTotalTax.plus(addTimeTaxPerItem);
209
216
  }
210
217
  }
211
- originTax = originTax.plus(originalTaxPerItem.times(quantity)).plus(addTimeTotalTax);
212
- tax = tax.plus(discountedTaxPerItem.times(quantity)).plus(addTimeTotalTax);
218
+ let bundleTotalOriginTax = new import_decimal.default(0);
219
+ let bundleTotalTax = new import_decimal.default(0);
220
+ if (Array.isArray((_c = item._extend.other) == null ? void 0 : _c.bundle)) {
221
+ for (let bundleItem of item._extend.other.bundle) {
222
+ if (getBundleItemIsOriginalPrice(bundleItem)) {
223
+ const bundleQuantity = new import_decimal.default(bundleItem.quantity || 1);
224
+ const bundleUnitPrice = new import_decimal.default(
225
+ bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
226
+ );
227
+ const bundleOriginalTaxPerItem = getProductItemTax(
228
+ {
229
+ ...bundleItem,
230
+ total: bundleUnitPrice.add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0).toNumber(),
231
+ quantity: 1
232
+ },
233
+ state,
234
+ { tax_rate, is_price_include_tax }
235
+ );
236
+ let bundleItemDiscount = new import_decimal.default(0);
237
+ if (productExpectAmount > 0) {
238
+ bundleItemDiscount = bundleUnitPrice.dividedBy(productExpectAmount).times(shopDiscount);
239
+ }
240
+ const bundleDiscountedUnitPrice = bundleUnitPrice.minus(bundleItemDiscount).add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0);
241
+ const bundleDiscountedTaxPerItem = getProductItemTax(
242
+ {
243
+ ...bundleItem,
244
+ total: bundleDiscountedUnitPrice.toNumber(),
245
+ quantity: 1
246
+ },
247
+ state,
248
+ { tax_rate, is_price_include_tax }
249
+ );
250
+ bundleItem.original_tax_fee = new import_decimal.default(bundleOriginalTaxPerItem).toNumber();
251
+ bundleItem.tax_fee = new import_decimal.default(bundleDiscountedTaxPerItem).toNumber();
252
+ bundleTotalOriginTax = bundleTotalOriginTax.plus(bundleOriginalTaxPerItem.times(bundleQuantity));
253
+ bundleTotalTax = bundleTotalTax.plus(bundleDiscountedTaxPerItem.times(bundleQuantity));
254
+ }
255
+ }
256
+ }
257
+ const original_tax_fee = originalTaxPerItem.add(bundleTotalOriginTax);
258
+ const tax_fee = maxDiscountedTaxPerItem.add(bundleTotalTax);
259
+ item._extend.original_tax_fee = original_tax_fee.toNumber();
260
+ item._extend.tax_fee = tax_fee.toNumber();
261
+ originTax = originTax.plus(original_tax_fee.times(quantity)).plus(addTimeTotalTax);
262
+ tax = tax.plus(tax_fee.times(quantity)).plus(addTimeTotalTax);
213
263
  }
214
264
  return { originTax, tax };
215
265
  };
@@ -270,7 +320,7 @@ var isProductMatchSurchargeCondition = (item, options) => {
270
320
  }
271
321
  const isInScheduleByDate = (_a = options.ScheduleModule) == null ? void 0 : _a.isInScheduleByDate;
272
322
  const { surchargeConfig, scheduleById = {} } = options;
273
- const { startDate, other, isCustomItem } = item._extend;
323
+ const { startDate, product_id, isCustomItem } = item;
274
324
  const {
275
325
  open_product = 0,
276
326
  // 1 | 0
@@ -294,7 +344,6 @@ var isProductMatchSurchargeCondition = (item, options) => {
294
344
  if (isCustomItem) {
295
345
  isProductMatch = false;
296
346
  } else {
297
- const product_id = other == null ? void 0 : other.product_id;
298
347
  isProductMatch = available_product_ids.includes(product_id);
299
348
  }
300
349
  }
@@ -324,8 +373,71 @@ var isProductMatchSurchargeCondition = (item, options) => {
324
373
  }
325
374
  return isProductMatch && isScheduleMatch;
326
375
  };
376
+ var getBundleItemIsOriginalPrice = (item) => {
377
+ return (item == null ? void 0 : item.price_type) === "markup" && (item == null ? void 0 : item.price_type_ext) === "product_price";
378
+ };
379
+ var getBundleItemIsMarkupPrice = (item) => {
380
+ 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));
381
+ };
382
+ var getBundleItemIsDiscountPrice = (item) => {
383
+ 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));
384
+ };
385
+ var getBundleItemIsMarkupOrDiscountPrice = (item) => {
386
+ return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
387
+ };
388
+ var getDiscountAmount = (discounts) => {
389
+ return (discounts || []).reduce((total, discount) => {
390
+ return total.add(new import_decimal.default(discount.amount || 0));
391
+ }, new import_decimal.default(0)).toNumber();
392
+ };
393
+ var getMainProductTotal = (item) => {
394
+ var _a, _b, _c, _d, _e, _f;
395
+ 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);
396
+ if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
397
+ total = total.add((_e = item._extend.other) == null ? void 0 : _e.option.reduce((t, option) => {
398
+ return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
399
+ }, new import_decimal.default(0)));
400
+ }
401
+ for (let bundleItem of ((_f = item._extend.other) == null ? void 0 : _f.bundle) || []) {
402
+ if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
403
+ const discountAmount = getDiscountAmount(bundleItem.discount_list);
404
+ const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
405
+ const bundleItemTotal = bundleItemPrice.minus(discountAmount);
406
+ total = total.add(bundleItemTotal);
407
+ }
408
+ }
409
+ return total.toNumber();
410
+ };
411
+ var clearSurchargeFee = (state) => {
412
+ var _a, _b;
413
+ const { service, addons } = state;
414
+ if (Array.isArray(service == null ? void 0 : service.value)) {
415
+ for (let item of service.value) {
416
+ item._extend.surcharge_fee = 0;
417
+ item._extend.relation_surcharge_ids = [];
418
+ for (let bundleItem of ((_a = item._extend.other) == null ? void 0 : _a.bundle) || []) {
419
+ bundleItem.surcharge_fee = 0;
420
+ bundleItem.relation_surcharge_ids = [];
421
+ }
422
+ for (let relationDetail of item._extend.relation_details || []) {
423
+ relationDetail.surcharge_fee = 0;
424
+ relationDetail.relation_surcharge_ids = [];
425
+ }
426
+ }
427
+ }
428
+ if (Array.isArray(addons == null ? void 0 : addons.value)) {
429
+ for (let item of addons.value) {
430
+ item._extend.surcharge_fee = 0;
431
+ item._extend.relation_surcharge_ids = [];
432
+ for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
433
+ bundleItem.surcharge_fee = 0;
434
+ bundleItem.relation_surcharge_ids = [];
435
+ }
436
+ }
437
+ }
438
+ };
327
439
  var getSurcharge = (state, options) => {
328
- var _a;
440
+ var _a, _b, _c, _d, _e;
329
441
  const { isEdit, ScheduleModule, surcharge_list, scheduleById } = options;
330
442
  const { bookingDetail, bookingId } = state;
331
443
  if (!isEdit && bookingId) {
@@ -350,6 +462,7 @@ var getSurcharge = (state, options) => {
350
462
  }
351
463
  return [];
352
464
  }
465
+ clearSurchargeFee(state);
353
466
  const { service, addons } = state;
354
467
  if (!Array.isArray(surcharge_list) || !(surcharge_list == null ? void 0 : surcharge_list.length)) return [];
355
468
  const surchargeWithAmount = [];
@@ -360,24 +473,89 @@ var getSurcharge = (state, options) => {
360
473
  fixed = "0",
361
474
  id,
362
475
  type,
363
- description
476
+ description,
477
+ open_product
364
478
  } = surchargeConfig;
365
479
  const matchedItems = [];
366
480
  if (Array.isArray(service == null ? void 0 : service.value)) {
367
481
  for (let item of service.value) {
368
- if (isProductMatchSurchargeCondition(item, {
369
- surchargeConfig,
370
- scheduleById: scheduleById || {},
371
- ScheduleModule
372
- })) {
482
+ if (isProductMatchSurchargeCondition(
483
+ {
484
+ isCustomItem: item.isCustomItem,
485
+ startDate: item._extend.startDate,
486
+ product_id: item.product_id
487
+ },
488
+ {
489
+ surchargeConfig,
490
+ scheduleById: scheduleById || {},
491
+ ScheduleModule
492
+ }
493
+ )) {
494
+ const total = getMainProductTotal(item);
495
+ const mainQuantity = item._extend.quantity || 1;
373
496
  matchedItems.push({
374
- total: Number(item._extend.total),
375
- addTimeTotal: getRelationDetailsTotal(
376
- item._extend.relation_details || []
377
- ),
378
- quantity: item._extend.quantity || 1
497
+ total,
498
+ // addTimeTotal: getRelationDetailsTotal(
499
+ // item._extend.relation_details || []
500
+ // ),
501
+ isMain: true,
502
+ quantity: mainQuantity,
503
+ item,
504
+ mainQuantity
505
+ // 主商品的mainQuantity等于自己的quantity
379
506
  });
380
507
  }
508
+ for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
509
+ if (getBundleItemIsOriginalPrice(bundleItem) && isProductMatchSurchargeCondition(
510
+ {
511
+ isCustomItem: false,
512
+ startDate: item._extend.startDate,
513
+ product_id: bundleItem._bundle_product_id
514
+ },
515
+ {
516
+ surchargeConfig,
517
+ scheduleById: scheduleById || {},
518
+ ScheduleModule
519
+ }
520
+ )) {
521
+ const mainQuantity = item._extend.quantity || 1;
522
+ matchedItems.push({
523
+ isMain: false,
524
+ total: Number(
525
+ bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
526
+ ),
527
+ quantity: bundleItem.num || bundleItem.quantity || 1,
528
+ item: bundleItem,
529
+ mainQuantity
530
+ // 子商品的mainQuantity是所属主商品的quantity
531
+ });
532
+ }
533
+ }
534
+ for (let relationDetail of item._extend.relation_details || []) {
535
+ if (isProductMatchSurchargeCondition(
536
+ {
537
+ isCustomItem: false,
538
+ startDate: item._extend.startDate,
539
+ product_id: relationDetail.product_id
540
+ },
541
+ {
542
+ surchargeConfig,
543
+ scheduleById: scheduleById || {},
544
+ ScheduleModule
545
+ }
546
+ )) {
547
+ matchedItems.push({
548
+ isMain: false,
549
+ total: Number(
550
+ (relationDetail == null ? void 0 : relationDetail.price) || ((_c = relationDetail == null ? void 0 : relationDetail.metadata) == null ? void 0 : _c.main_product_attached_bundle_selling_price)
551
+ ),
552
+ quantity: relationDetail.num || relationDetail.quantity || 1,
553
+ item: relationDetail,
554
+ mainQuantity: 1
555
+ // 加时商品不受主商品数量影响
556
+ });
557
+ }
558
+ }
381
559
  }
382
560
  }
383
561
  if (Array.isArray(addons == null ? void 0 : addons.value)) {
@@ -388,28 +566,84 @@ var getSurcharge = (state, options) => {
388
566
  ScheduleModule
389
567
  })) {
390
568
  matchedItems.push({
569
+ isMain: true,
391
570
  total: Number(item._extend.total),
392
- quantity: item._extend.quantity || 1
571
+ quantity: item._extend.quantity || 1,
572
+ item,
573
+ mainQuantity: 1
574
+ // addons独立商品,mainQuantity为1
393
575
  });
394
576
  }
395
577
  }
396
578
  }
397
579
  let finalAmount = 0;
580
+ const productCount = matchedItems.reduce((total, item) => {
581
+ if (item.isMain) {
582
+ return total + (item.quantity || 1);
583
+ } else {
584
+ return total + (item.quantity || 1) * (item.mainQuantity || 1);
585
+ }
586
+ }, 0);
587
+ let fixedTotal = new import_decimal.default(0);
588
+ let productTotalSurcharge = new import_decimal.default(0);
398
589
  if (matchedItems.length > 0) {
399
590
  let configTotal = new import_decimal.default(0);
400
- if (percentage && new import_decimal.default(percentage).gt(0)) {
591
+ if (fixed && new import_decimal.default(fixed).gt(0)) {
592
+ configTotal = configTotal.plus(fixed);
593
+ }
594
+ if (percentage && new import_decimal.default(percentage).gt(0) || fixed) {
401
595
  const percentageRate = new import_decimal.default(percentage);
402
- for (let item of matchedItems) {
596
+ for (let [index, item] of matchedItems.entries()) {
597
+ const isLast = index === matchedItems.length - 1;
403
598
  const itemPrice = new import_decimal.default(Math.max(0, item.total || 0));
404
- const itemQuantity = new import_decimal.default(item.quantity || 1);
599
+ const itemQuantity = new import_decimal.default(item.isMain ? item.quantity || 1 : item.quantity * item.mainQuantity || 1);
405
600
  const addTimeTotal = new import_decimal.default(item.addTimeTotal || 0);
406
- const itemSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
407
- configTotal = configTotal.plus(itemSurcharge);
601
+ const itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
602
+ configTotal = configTotal.plus(itemTotalSurcharge);
603
+ const itemSurcharge = itemPrice.times(percentageRate);
604
+ const fixedSurcharge = new import_decimal.default(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
605
+ const quantity = item.isMain ? item.quantity : item.quantity * item.mainQuantity;
606
+ fixedTotal = fixedTotal.plus(new import_decimal.default(fixedSurcharge).times(quantity).toNumber());
607
+ if (isLast && fixedTotal.gt(0)) {
608
+ const remaining = new import_decimal.default(fixed).minus(fixedTotal).toNumber();
609
+ if (remaining > 0) {
610
+ productTotalSurcharge = productTotalSurcharge.plus(remaining);
611
+ if (item.isMain) {
612
+ item.item._extend.surcharge_rounding_remainder = remaining;
613
+ } else {
614
+ item.item.surcharge_rounding_remainder = remaining;
615
+ }
616
+ }
617
+ }
618
+ if (open_product !== 0) {
619
+ if (item.isMain) {
620
+ const originSurchargeFee = new import_decimal.default(item.item._extend.surcharge_fee || 0);
621
+ const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
622
+ productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
623
+ item.item._extend.surcharge_fee = surchargeFee;
624
+ item.item._extend.relation_surcharge_ids = [...((_d = item.item._extend) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
625
+ } else {
626
+ const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
627
+ const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
628
+ productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
629
+ item.item.surcharge_fee = surchargeFee;
630
+ item.item.relation_surcharge_ids = [...((_e = item.item) == null ? void 0 : _e.relation_surcharge_ids) || [], id];
631
+ }
632
+ }
633
+ if (isLast && configTotal.minus(productTotalSurcharge).gt(0)) {
634
+ const configTotalRounded = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
635
+ if (item.isMain) {
636
+ let newRoundingRemainder = new import_decimal.default(item.item._extend.surcharge_rounding_remainder || 0);
637
+ newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
638
+ item.item._extend.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
639
+ } else {
640
+ let newRoundingRemainder = new import_decimal.default(item.item.surcharge_rounding_remainder || 0);
641
+ newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
642
+ item.item.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
643
+ }
644
+ }
408
645
  }
409
646
  }
410
- if (fixed && new import_decimal.default(fixed).gt(0)) {
411
- configTotal = configTotal.plus(fixed);
412
- }
413
647
  finalAmount = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
414
648
  }
415
649
  const name = surchargeConfig.name || {};
@@ -427,7 +661,10 @@ var getSurcharge = (state, options) => {
427
661
  type: "default",
428
662
  fixed,
429
663
  amount: finalAmount,
430
- percentage
664
+ percentage,
665
+ metadata: {
666
+ open_product
667
+ }
431
668
  });
432
669
  }
433
670
  return surchargeWithAmount;
@@ -537,6 +774,19 @@ var getSumTotal = (state, options) => {
537
774
  state,
538
775
  options
539
776
  });
777
+ const { productExpectAmount: productExpectAmountWithoutDiscount } = getProductExpectAmount(
778
+ state,
779
+ options.isEdit,
780
+ true
781
+ );
782
+ const originExpectAmountWithoutDiscount = getExpectAmount({
783
+ price: productExpectAmountWithoutDiscount,
784
+ tax: originTax,
785
+ surchargeAmount,
786
+ shopDiscount: 0,
787
+ state,
788
+ options
789
+ });
540
790
  const sumTotalAmount = getSumTotalAmount({ expectAmount, roundingAmount });
541
791
  const sumTotalAmountDecimal = new import_decimal.default((0, import_utils2.formatAmount)(sumTotalAmount, 2, "") || 0);
542
792
  const orderPaidAmountDecimal = new import_decimal.default(orderPaidAmount || 0);
@@ -563,7 +813,9 @@ var getSumTotal = (state, options) => {
563
813
  totalRefundAmount,
564
814
  dueAmount,
565
815
  roundingAmount,
566
- originExpectAmount
816
+ originExpectAmount,
817
+ // 订单原价 不包含整单折扣 不包含商品券折扣卡抵扣
818
+ originExpectAmountWithoutDiscount
567
819
  };
568
820
  };
569
821
  // Annotate the CommonJS export names for ESM import in node:
@@ -611,6 +611,7 @@ var Footer = (props) => {
611
611
  const isHasDayProducts = handleDaySubmit();
612
612
  if (isHasDayProducts) return;
613
613
  }
614
+ debugger;
614
615
  const hasUnspecifiedHolderProduct = (_d2 = state.service.value) == null ? void 0 : _d2.some((item) => {
615
616
  var _a3, _b3, _c3;
616
617
  return (!((_a3 = item._extend) == null ? void 0 : _a3.holder_id) || ((_c3 = (_b3 = item._extend) == null ? void 0 : _b3.holder_id) == null ? void 0 : _c3.length) === 0) && !(0, import_utils2.isNormalProductByDurationSchedule)(item);
@@ -1260,7 +1261,8 @@ var Footer = (props) => {
1260
1261
  }
1261
1262
  };
1262
1263
  const changeCustomerToGlobalState = (0, import_ahooks.useMemoizedFn)((value) => {
1263
- var _a2, _b2;
1264
+ var _a2, _b2, _c2;
1265
+ const beforeValue = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.value;
1264
1266
  dispatch({
1265
1267
  type: "setClient",
1266
1268
  payload: {
@@ -1268,7 +1270,8 @@ var Footer = (props) => {
1268
1270
  edit: true
1269
1271
  }
1270
1272
  });
1271
- if ((_b2 = (_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) {
1273
+ if ((beforeValue == null ? void 0 : beforeValue.id) === (value == null ? void 0 : value.id)) return;
1274
+ if ((_c2 = (_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.value) == null ? void 0 : _c2.length) {
1272
1275
  dispatch({
1273
1276
  type: "setService",
1274
1277
  payload: {