@pisell/pisellos 2.2.292 → 2.2.294

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 (174) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +108 -65
  3. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  4. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  5. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  6. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  7. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  8. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  9. package/dist/modules/BookingContext/index.d.ts +3 -0
  10. package/dist/modules/BookingContext/index.js +42 -13
  11. package/dist/modules/BookingContext/types.d.ts +4 -4
  12. package/dist/modules/BookingContext/types.js +3 -3
  13. package/dist/modules/OpenData/types.d.ts +1 -0
  14. package/dist/modules/Order/index.d.ts +19 -4
  15. package/dist/modules/Order/index.js +885 -485
  16. package/dist/modules/Order/salesNotes.d.ts +31 -0
  17. package/dist/modules/Order/salesNotes.js +492 -0
  18. package/dist/modules/Order/types.d.ts +93 -5
  19. package/dist/modules/Order/types.js +5 -0
  20. package/dist/modules/Order/utils.d.ts +12 -0
  21. package/dist/modules/Order/utils.js +96 -31
  22. package/dist/modules/Product/types.d.ts +2 -0
  23. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  24. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  25. package/dist/modules/ProductList/index.d.ts +18 -3
  26. package/dist/modules/ProductList/index.js +220 -38
  27. package/dist/modules/ProductList/types.d.ts +10 -0
  28. package/dist/modules/Quotation/index.d.ts +22 -0
  29. package/dist/modules/Quotation/index.js +293 -28
  30. package/dist/modules/ResourcePlanner/index.d.ts +0 -22
  31. package/dist/modules/ResourcePlanner/index.js +1 -180
  32. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  33. package/dist/modules/ResourcePlanner/localClock.js +183 -0
  34. package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
  35. package/dist/modules/ResourcePlanner/planner.js +2111 -958
  36. package/dist/modules/ResourcePlanner/types.d.ts +359 -187
  37. package/dist/modules/ResourcePlanner/types.js +33 -1
  38. package/dist/plugins/request.d.ts +1 -0
  39. package/dist/server/index.d.ts +17 -2
  40. package/dist/server/index.js +1134 -932
  41. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  42. package/dist/server/modules/floor-plan/index.js +240 -98
  43. package/dist/server/modules/menu/index.js +48 -23
  44. package/dist/server/modules/order/index.d.ts +17 -7
  45. package/dist/server/modules/order/index.js +419 -207
  46. package/dist/server/modules/products/index.d.ts +10 -4
  47. package/dist/server/modules/products/index.js +177 -84
  48. package/dist/server/modules/resource/index.js +21 -13
  49. package/dist/server/utils/product.d.ts +1 -1
  50. package/dist/server/utils/product.js +186 -22
  51. package/dist/server/utils/small-ticket.d.ts +9 -1
  52. package/dist/server/utils/small-ticket.js +136 -41
  53. package/dist/solution/BaseSales/index.d.ts +26 -3
  54. package/dist/solution/BaseSales/index.js +1384 -905
  55. package/dist/solution/BaseSales/types.d.ts +2 -0
  56. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  57. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
  58. package/dist/solution/BaseSales/utils.js +6 -3
  59. package/dist/solution/BookingByStep/index.d.ts +4 -4
  60. package/dist/solution/BookingTicket/index.d.ts +1 -1
  61. package/dist/solution/BookingTicket/index.js +4 -2
  62. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  63. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
  64. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  65. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  66. package/dist/solution/RegisterAndLogin/config.js +95 -40
  67. package/dist/solution/RegisterAndLogin/index.js +4 -1
  68. package/dist/solution/ScanOrder/index.d.ts +1 -0
  69. package/dist/solution/ScanOrder/index.js +31 -27
  70. package/dist/solution/ScanOrder/types.d.ts +2 -0
  71. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  72. package/dist/solution/ScanOrder/utils.js +8 -3
  73. package/dist/solution/UnifiedBookingSales/index.d.ts +130 -76
  74. package/dist/solution/UnifiedBookingSales/index.js +3882 -966
  75. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  76. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
  77. package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
  78. package/dist/solution/UnifiedBookingSales/types.js +4 -9
  79. package/dist/solution/VenueBooking/index.d.ts +3 -0
  80. package/dist/solution/VenueBooking/index.js +549 -497
  81. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  82. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  83. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  84. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  85. package/dist/utils/platform.d.ts +8 -0
  86. package/dist/utils/platform.js +15 -0
  87. package/lib/core/index.d.ts +7 -0
  88. package/lib/core/index.js +20 -2
  89. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  90. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  91. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  92. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  93. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  94. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  95. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  96. package/lib/modules/BookingContext/index.d.ts +3 -0
  97. package/lib/modules/BookingContext/index.js +35 -8
  98. package/lib/modules/BookingContext/types.d.ts +4 -4
  99. package/lib/modules/BookingContext/types.js +3 -3
  100. package/lib/modules/OpenData/types.d.ts +1 -0
  101. package/lib/modules/Order/index.d.ts +19 -4
  102. package/lib/modules/Order/index.js +325 -28
  103. package/lib/modules/Order/salesNotes.d.ts +31 -0
  104. package/lib/modules/Order/salesNotes.js +382 -0
  105. package/lib/modules/Order/types.d.ts +93 -5
  106. package/lib/modules/Order/types.js +4 -0
  107. package/lib/modules/Order/utils.d.ts +12 -0
  108. package/lib/modules/Order/utils.js +85 -16
  109. package/lib/modules/Product/types.d.ts +2 -0
  110. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  111. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  112. package/lib/modules/ProductList/index.d.ts +18 -3
  113. package/lib/modules/ProductList/index.js +137 -8
  114. package/lib/modules/ProductList/types.d.ts +10 -0
  115. package/lib/modules/Quotation/index.d.ts +22 -0
  116. package/lib/modules/Quotation/index.js +158 -11
  117. package/lib/modules/ResourcePlanner/index.d.ts +0 -22
  118. package/lib/modules/ResourcePlanner/index.js +9 -129
  119. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  120. package/lib/modules/ResourcePlanner/localClock.js +205 -0
  121. package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
  122. package/lib/modules/ResourcePlanner/planner.js +1807 -783
  123. package/lib/modules/ResourcePlanner/types.d.ts +359 -187
  124. package/lib/modules/ResourcePlanner/types.js +13 -1
  125. package/lib/plugins/request.d.ts +1 -0
  126. package/lib/server/index.d.ts +17 -2
  127. package/lib/server/index.js +149 -21
  128. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  129. package/lib/server/modules/floor-plan/index.js +60 -7
  130. package/lib/server/modules/menu/index.js +26 -4
  131. package/lib/server/modules/order/index.d.ts +17 -7
  132. package/lib/server/modules/order/index.js +194 -57
  133. package/lib/server/modules/products/index.d.ts +10 -4
  134. package/lib/server/modules/products/index.js +93 -23
  135. package/lib/server/modules/resource/index.js +12 -2
  136. package/lib/server/utils/product.d.ts +1 -1
  137. package/lib/server/utils/product.js +163 -3
  138. package/lib/server/utils/small-ticket.d.ts +9 -1
  139. package/lib/server/utils/small-ticket.js +126 -33
  140. package/lib/solution/BaseSales/index.d.ts +26 -3
  141. package/lib/solution/BaseSales/index.js +396 -70
  142. package/lib/solution/BaseSales/types.d.ts +2 -0
  143. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  144. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
  145. package/lib/solution/BaseSales/utils.js +3 -0
  146. package/lib/solution/BookingByStep/index.d.ts +4 -4
  147. package/lib/solution/BookingTicket/index.d.ts +1 -1
  148. package/lib/solution/BookingTicket/index.js +2 -1
  149. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  150. package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
  151. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  152. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  153. package/lib/solution/RegisterAndLogin/config.js +49 -8
  154. package/lib/solution/RegisterAndLogin/index.js +4 -1
  155. package/lib/solution/ScanOrder/index.d.ts +1 -0
  156. package/lib/solution/ScanOrder/index.js +5 -1
  157. package/lib/solution/ScanOrder/types.d.ts +2 -0
  158. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  159. package/lib/solution/ScanOrder/utils.js +4 -0
  160. package/lib/solution/UnifiedBookingSales/index.d.ts +130 -76
  161. package/lib/solution/UnifiedBookingSales/index.js +2597 -427
  162. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  163. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
  164. package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
  165. package/lib/solution/UnifiedBookingSales/types.js +4 -6
  166. package/lib/solution/VenueBooking/index.d.ts +3 -0
  167. package/lib/solution/VenueBooking/index.js +33 -9
  168. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  169. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  170. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  171. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  172. package/lib/utils/platform.d.ts +8 -0
  173. package/lib/utils/platform.js +22 -0
  174. package/package.json +1 -1
@@ -32,6 +32,7 @@ const LABELS = {
32
32
  orderDiscount: 'Order discount',
33
33
  manualDiscount: 'Manual discount',
34
34
  payProcessingFee: 'Pay processing fee',
35
+ surchargeIncluded: 'Surcharge(Included)',
35
36
  rounding: 'Rounding',
36
37
  gross: 'Gross',
37
38
  tare: 'Tare'
@@ -58,6 +59,7 @@ const LABELS = {
58
59
  orderDiscount: '整单折扣',
59
60
  manualDiscount: '手动折扣',
60
61
  payProcessingFee: '支付手续费',
62
+ surchargeIncluded: '手续费(已含)',
61
63
  rounding: '抹零',
62
64
  gross: '重量',
63
65
  tare: '去皮'
@@ -84,6 +86,7 @@ const LABELS = {
84
86
  orderDiscount: '整單折扣',
85
87
  manualDiscount: '手動折扣',
86
88
  payProcessingFee: '支付手續費',
89
+ surchargeIncluded: '手續費(已含)',
87
90
  rounding: '抹零',
88
91
  gross: '重量',
89
92
  tare: '去皮'
@@ -141,6 +144,11 @@ function buildLocaleData(params) {
141
144
  locale,
142
145
  currencySymbol
143
146
  }),
147
+ wallets: buildWallets({
148
+ order,
149
+ locale,
150
+ currencySymbol
151
+ }),
144
152
  tickets: Array.isArray(order.tickets) ? order.tickets : [],
145
153
  source_shop: [],
146
154
  refund_data: [],
@@ -166,7 +174,10 @@ function buildBaseData(params) {
166
174
  is_repeat: 0,
167
175
  buzzer: stringify(order.buzzer || order.pickup_number || order.metadata?.buzzer),
168
176
  order_no: orderNumber,
169
- order_time: formatDateTime(order.created_at || order.sales_time || new Date(), locale)
177
+ order_time: formatDateTime(order.created_at || order.sales_time || new Date(), locale),
178
+ ...(isPresentId(order.updated_at) ? {
179
+ updated_at: formatDateTime(order.updated_at, locale)
180
+ } : {})
170
181
  };
171
182
  }
172
183
  function buildProducts(order, locale, productMap) {
@@ -200,6 +211,8 @@ function buildProducts(order, locale, productMap) {
200
211
  parentProduct,
201
212
  locale
202
213
  });
214
+ const productUid = firstPresentValue(product.metadata?.unique_identification_number, product.unique_identification_number);
215
+ const bookingUid = firstPresentValue(product.booking_uid, product.metadata?.booking_uid);
203
216
  const extensionList = buildProductExtensionList({
204
217
  product,
205
218
  locale,
@@ -214,6 +227,12 @@ function buildProducts(order, locale, productMap) {
214
227
  original_price: formatMoney(originalPrice, currencySymbol),
215
228
  total_original_price: formatMoney(new _decimal.default(toMoneyNumber(originalPrice)).mul(quantity), currencySymbol),
216
229
  extension_list: extensionList,
230
+ ...(isPresentId(productUid) ? {
231
+ product_uid: productUid
232
+ } : {}),
233
+ ...(isPresentId(bookingUid) ? {
234
+ booking_uid: bookingUid
235
+ } : {}),
217
236
  ...(options.length ? {
218
237
  options
219
238
  } : {}),
@@ -579,6 +598,9 @@ function isNonZeroId(value) {
579
598
  function isPresentId(value) {
580
599
  return value !== undefined && value !== null && value !== '';
581
600
  }
601
+ function firstPresentValue(...values) {
602
+ return values.find(value => isPresentId(value));
603
+ }
582
604
  function isSameId(left, right) {
583
605
  if (!isPresentId(left) || !isPresentId(right)) return false;
584
606
  return String(left) === String(right);
@@ -647,12 +669,13 @@ function buildFees(params) {
647
669
  });
648
670
  }
649
671
  const productExpectAmount = summary.product_expect_amount || summary.product_amount || order.product_expect_amount;
650
- const productOriginalAmount = summary.product_original_amount ?? order.product_original_amount ?? productExpectAmount;
672
+ const productOriginalAmount = firstPresentValue(summary.product_original_amount, order.product_original_amount) ?? calculateProductOriginalAmount(order);
651
673
  const totalSavingsAmount = new _decimal.default(toMoneyNumber(productOriginalAmount)).minus(toMoneyNumber(productExpectAmount)).plus(toMoneyNumber(discountAmount));
652
674
  return {
653
675
  fees,
654
676
  countFee: {
655
677
  total_amount: formatMoney(summary.total_amount || order.total_amount, currencySymbol),
678
+ original_item_amount: formatMoney(productOriginalAmount, currencySymbol),
656
679
  product_expect_amount: formatMoney(productExpectAmount, currencySymbol),
657
680
  expect_amount: formatMoney(summary.expect_amount || order.expect_amount || summary.total_amount || order.total_amount, currencySymbol),
658
681
  product_quantity: toNumber(summary.product_quantity || products.reduce((sum, product) => sum + product.product_quantity, 0), 0),
@@ -675,6 +698,13 @@ function buildFees(params) {
675
698
  }
676
699
  };
677
700
  }
701
+ function calculateProductOriginalAmount(order) {
702
+ return normalizeArray(order.products).reduce((total, product) => {
703
+ const quantity = toNumber(product.product_quantity ?? product.quantity ?? product.num ?? 1, 1);
704
+ const originalPrice = product.original_price ?? product.selling_price ?? product.payment_price ?? product.price ?? 0;
705
+ return total.plus(new _decimal.default(toMoneyNumber(originalPrice)).mul(quantity));
706
+ }, new _decimal.default(0));
707
+ }
678
708
  function buildCustomer(order, locale) {
679
709
  return [{
680
710
  item: label(locale, 'contactName'),
@@ -712,6 +742,27 @@ function buildDelivery(order, locale) {
712
742
  return items;
713
743
  }
714
744
  function buildAppointment(order, locale) {
745
+ const bookings = normalizeArray(order.bookings);
746
+ if (bookings.length) {
747
+ return bookings.map(booking => {
748
+ const snapshot = {
749
+ ...booking
750
+ };
751
+ delete snapshot.product_uid;
752
+ delete snapshot.booking_uid;
753
+ const productUid = firstPresentValue(booking.product_uid, booking.metadata?.product_uid);
754
+ const bookingUid = firstPresentValue(booking.metadata?.unique_identification_number, booking.booking_uid);
755
+ return {
756
+ ...snapshot,
757
+ ...(isPresentId(productUid) ? {
758
+ product_uid: productUid
759
+ } : {}),
760
+ ...(isPresentId(bookingUid) ? {
761
+ booking_uid: bookingUid
762
+ } : {})
763
+ };
764
+ });
765
+ }
715
766
  const tableName = order.table_name || order.metadata?.table_name || order.metadata?.table?.name || order.form_data?.table_name;
716
767
  if (!tableName) return [];
717
768
  return [{
@@ -729,41 +780,81 @@ function buildResources(order, locale) {
729
780
  }
730
781
  function buildPaymentData(params) {
731
782
  const payments = normalizeArray(params.order.payments);
732
- return payments.filter(payment => isPrintablePayment(payment)).map(payment => {
733
- const items = [{
734
- item: paymentMethodName(payment, params.locale),
735
- value: formatMoney(payment.amount ?? payment.origin_amount, params.currencySymbol)
736
- }];
737
- const fundRecord = getFundRecord(payment);
738
- if (fundRecord) {
739
- items.push(...buildFundRecordPaymentItems({
740
- payment,
741
- fundRecord,
742
- locale: params.locale,
743
- currencySymbol: params.currencySymbol
744
- }));
745
- } else {
746
- const remainingAmount = payment.remaining_amount ?? payment.balance ?? payment.metadata?.remaining_amount;
747
- if (remainingAmount !== undefined && remainingAmount !== null) {
748
- items.push({
749
- item: label(params.locale, 'remainingAmount'),
750
- value: formatMoney(remainingAmount, params.currencySymbol)
751
- });
752
- }
753
- }
783
+ return payments.filter(payment => isPrintablePayment(payment)).map(payment => buildPaymentItems({
784
+ payment,
785
+ locale: params.locale,
786
+ currencySymbol: params.currencySymbol,
787
+ includeFundRecordBalance: false
788
+ }));
789
+ }
790
+ function buildWallets(params) {
791
+ return normalizeArray(params.order.payments).filter(payment => isPrintablePayment(payment) && !!getFundRecord(payment)).map(payment => buildPaymentItems({
792
+ payment,
793
+ locale: params.locale,
794
+ currencySymbol: params.currencySymbol,
795
+ includeFundRecordBalance: true
796
+ }));
797
+ }
798
+ function buildPaymentItems(params) {
799
+ const {
800
+ payment,
801
+ locale,
802
+ currencySymbol,
803
+ includeFundRecordBalance
804
+ } = params;
805
+ const serviceFee = getPaymentServiceFee(payment);
806
+ const items = [{
807
+ item: paymentMethodName(payment, locale),
808
+ value: formatMoney(resolveReceiptPaymentAmount(payment, serviceFee), currencySymbol)
809
+ }];
810
+ if (serviceFee.gt(0)) {
754
811
  items.push({
755
- item: formatDateTime(payment.paid_at || payment.created_at || payment.updated_at || new Date(), params.locale),
756
- value: ''
812
+ item: label(locale, 'surchargeIncluded'),
813
+ value: formatMoney(serviceFee, currencySymbol)
757
814
  });
758
- return items;
815
+ }
816
+ const fundRecord = getFundRecord(payment);
817
+ if (fundRecord) {
818
+ items.push(...buildFundRecordPaymentItems({
819
+ payment,
820
+ fundRecord,
821
+ locale,
822
+ currencySymbol,
823
+ includeBalance: includeFundRecordBalance
824
+ }));
825
+ } else {
826
+ const remainingAmount = payment.remaining_amount ?? payment.balance ?? payment.metadata?.remaining_amount;
827
+ if (remainingAmount !== undefined && remainingAmount !== null) {
828
+ items.push({
829
+ item: label(locale, 'remainingAmount'),
830
+ value: formatMoney(remainingAmount, currencySymbol)
831
+ });
832
+ }
833
+ }
834
+ items.push({
835
+ item: formatDateTime(payment.paid_at || payment.created_at || payment.updated_at || new Date(), locale),
836
+ value: ''
759
837
  });
838
+ return items;
839
+ }
840
+ function getPaymentServiceFee(payment) {
841
+ return new _decimal.default(toMoneyNumber(payment.service_fee));
842
+ }
843
+ function resolveReceiptPaymentAmount(payment, serviceFee) {
844
+ const amount = new _decimal.default(toMoneyNumber(payment.amount ?? payment.origin_amount));
845
+ const hasAmount = payment.amount !== undefined && payment.amount !== null && payment.amount !== '';
846
+ const hasOriginAmount = payment.origin_amount !== undefined && payment.origin_amount !== null && payment.origin_amount !== '';
847
+ if (!hasAmount || !hasOriginAmount || serviceFee.lte(0)) return amount;
848
+ const originAmount = new _decimal.default(toMoneyNumber(payment.origin_amount));
849
+ return amount.eq(originAmount) ? amount.plus(serviceFee) : amount;
760
850
  }
761
851
  function buildFundRecordPaymentItems(params) {
762
852
  const {
763
853
  payment,
764
854
  fundRecord,
765
855
  locale,
766
- currencySymbol
856
+ currencySymbol,
857
+ includeBalance
767
858
  } = params;
768
859
  const items = [];
769
860
  const usingBeforeValue = fundRecord.using_before_value;
@@ -774,13 +865,15 @@ function buildFundRecordPaymentItems(params) {
774
865
  item: label(locale, 'redeemPoints'),
775
866
  value: trimDecimal(usedPoints)
776
867
  });
777
- items.push({
778
- item: label(locale, 'remainingPoints'),
779
- value: trimDecimal(new _decimal.default(toMoneyNumber(usingAfterValue)))
780
- });
868
+ if (includeBalance) {
869
+ items.push({
870
+ item: label(locale, 'remainingPoints'),
871
+ value: trimDecimal(new _decimal.default(toMoneyNumber(usingAfterValue)))
872
+ });
873
+ }
781
874
  return items;
782
875
  }
783
- if (usingAfterValue !== undefined && usingAfterValue !== null) {
876
+ if (includeBalance && usingAfterValue !== undefined && usingAfterValue !== null) {
784
877
  items.push({
785
878
  item: label(locale, 'remainingAmount'),
786
879
  value: formatMoney(usingAfterValue, currencySymbol)
@@ -2,7 +2,7 @@ import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
3
  import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
4
4
  import { OrderModule } from '../../modules/Order';
5
- import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions } from '../../modules/Order/types';
5
+ import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, ShopServiceData, ShopServiceType } from '../../modules/Order/types';
6
6
  import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
7
7
  import type { Discount } from '../../modules/Discount/types';
8
8
  import { RequestPlugin, WindowPlugin } from '../../plugins';
@@ -129,8 +129,23 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
129
129
  */
130
130
  protected preferAuthoritativeProductQueryPrice(): boolean;
131
131
  private getPriceQuerySchedule;
132
+ private isCustomerUserPriceQuery;
133
+ private getPriceQueryScheduleList;
134
+ private buildPriceQueryPayload;
135
+ private getRawProductPriceSources;
136
+ private rememberRawProductPriceSources;
137
+ private getSelectedProductVariantId;
138
+ /**
139
+ * 将目录原始商品还原为本次选择的 SKU 基线。
140
+ *
141
+ * 这里绝不能复用已评估后的目录商品,否则从命中智能价切回不命中的
142
+ * 日期时会残留旧价格。套餐仅验证所选关系存在,最终仍由 merge 方法把
143
+ * 评估后的套餐价格映射回用户的选择数据。
144
+ */
145
+ private prepareRawProductForPriceQuery;
146
+ private resolveLocalProductForPriceQuery;
132
147
  private loadProductsForPriceQuery;
133
- private loadProductForPriceQuery;
148
+ private resolveProductsForPriceQuery;
134
149
  private getAuthoritativeBundleItems;
135
150
  private findAuthoritativeBundleItem;
136
151
  private getAuthoritativeBundleUnitPrice;
@@ -210,12 +225,20 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
210
225
  getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
211
226
  getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
212
227
  getTempOrderNote(): string;
228
+ getSalesNotes(): SalesNote[];
229
+ createSalesNotesMutationSnapshot(): SalesNotesMutationSnapshot;
230
+ restoreSalesNotesMutationSnapshot(snapshot: SalesNotesMutationSnapshot): void;
231
+ setSalesNote(input: SetSalesNoteInput): Promise<SalesNote>;
232
+ removeSalesNote(uuid: string): Promise<void>;
233
+ clearSalesNotes(): Promise<void>;
213
234
  updateTempOrderNote(note: string): string;
214
235
  updateTempOrderNote(note: string, sync: true): Promise<string>;
215
236
  updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
216
237
  updateRemoteOrderNote(orderId: number | string, note: string): void;
217
238
  updateTempOrderShopDiscount(amount: string | number): string;
218
239
  updateTempOrderDepositAmount(amount: string | number): OrderSummary;
240
+ setPickupReferenceMode(mode: PickupReferenceMode): ShopServiceData;
241
+ setServiceType(serviceType: ShopServiceType): ShopServiceData;
219
242
  updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
220
243
  /** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
221
244
  setEnableTempOrderPersist(enabled: boolean): void;
@@ -498,7 +521,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
498
521
  getUnfulfilledPromotions(): OrderUnfulfilledPromotion[];
499
522
  /** 最近一次促销计算输出的赠品操作 diff。 */
500
523
  getLastGiftActions(): OrderLastGiftActions | null;
501
- getProductList(): Promise<any>;
524
+ getProductList(): Promise<import("../..").ProductData[] | undefined>;
502
525
  getOtherParams(): Record<string, any>;
503
526
  setOtherParams(params: Record<string, any>, { cover }?: {
504
527
  cover?: boolean;