@pisell/pisellos 0.0.401 → 0.0.402

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.
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -20,14 +20,6 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
20
20
  var subtotal = new Decimal(calculateSubtotal(items));
21
21
  var subOriginTotal = new Decimal(calculateOriginSubtotal(items));
22
22
  var totalTaxFee = new Decimal(calculateTaxFee(shopInfo, items));
23
- // 税费
24
- // const { tax, originTax } = getTax({ service: items, bookingDetail: null, bookingId: undefined }, {
25
- // computed: {
26
- // productExpectAmount: subtotal.toNumber(),
27
- // shopDiscount: 0,
28
- // },
29
- // isEdit: false,
30
- // });
31
23
  // 订单附加费列表
32
24
  var surcharge = getSurcharge({
33
25
  service: items,
@@ -47,9 +39,23 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
47
39
  }, surcharge, {
48
40
  isEdit: false
49
41
  }));
50
-
51
- // 计算总价
52
- var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal : subtotal.plus(totalTaxFee).plus(surchargeAmount);
42
+ // 税费
43
+ var _getTax = getTax({
44
+ service: items,
45
+ bookingDetail: null,
46
+ bookingId: undefined
47
+ }, {
48
+ computed: {
49
+ productExpectAmount: subtotal.toNumber(),
50
+ shopDiscount: 0
51
+ },
52
+ isEdit: false,
53
+ tax_rate: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_rate,
54
+ is_price_include_tax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
55
+ }),
56
+ tax = _getTax.tax,
57
+ originTax = _getTax.originTax;
58
+ var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal.plus(surchargeAmount) : subtotal.plus(totalTaxFee).plus(surchargeAmount);
53
59
 
54
60
  // 计算总价 不包含折扣卡商品券折扣信息价格
55
61
  var originTotal = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
@@ -62,7 +68,7 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
62
68
  originTotal: originTotal.toFixed(2),
63
69
  taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
64
70
  taxRate: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_rate,
65
- totalTaxFee: totalTaxFee.toFixed(2),
71
+ totalTaxFee: tax,
66
72
  isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax,
67
73
  surcharge: surcharge,
68
74
  surchargeAmount: surchargeAmount.toFixed(2),
@@ -113,13 +119,13 @@ var getTax = function getTax(_ref, options) {
113
119
  computed = options.computed,
114
120
  tax_rate = options.tax_rate,
115
121
  is_price_include_tax = options.is_price_include_tax;
122
+ debugger;
116
123
 
117
124
  // 详情时未编辑的状态下, 取后端的值
118
- if (!isEdit) {
119
- return {
120
- tax: Number(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.tax_fee) || 0
121
- };
122
- }
125
+ // if (!isEdit) {
126
+ // return { tax: Number(bookingDetail?.tax_fee) || 0 };
127
+ // }
128
+
123
129
  var totalOriginTax = new Decimal(0);
124
130
  var totalTax = new Decimal(0);
125
131
  if (service || addons) {
@@ -191,7 +197,6 @@ var processItemsTax = function processItemsTax(items, _ref2, options) {
191
197
  _step;
192
198
  try {
193
199
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
194
- var _item$_extend$other;
195
200
  var item = _step.value;
196
201
  var quantity = new Decimal(item.num || 1);
197
202
  var unitPrice = new Decimal(item.total || 0);
@@ -301,8 +306,8 @@ var processItemsTax = function processItemsTax(items, _ref2, options) {
301
306
  var bundlePreciseTax = new Decimal(0);
302
307
  var bundleRoundedOriginTax = new Decimal(0);
303
308
  var bundleRoundedTax = new Decimal(0);
304
- if (Array.isArray((_item$_extend$other = item._extend.other) === null || _item$_extend$other === void 0 ? void 0 : _item$_extend$other.bundle)) {
305
- var _iterator3 = _createForOfIteratorHelper(item._extend.other.bundle),
309
+ if (Array.isArray(item === null || item === void 0 ? void 0 : item.bundle)) {
310
+ var _iterator3 = _createForOfIteratorHelper(item === null || item === void 0 ? void 0 : item.bundle),
306
311
  _step3;
307
312
  try {
308
313
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -375,7 +380,6 @@ var processItemsTax = function processItemsTax(items, _ref2, options) {
375
380
  _iterator3.f();
376
381
  }
377
382
  }
378
-
379
383
  // 主商品的原始税费和折后税费(精确值)
380
384
  var originalTaxFeePrecise = originalTaxPerItemPrecise.plus(bundlePreciseOriginTax);
381
385
  var taxFeePrecise = maxDiscountedTaxPerItemPrecise.plus(bundlePreciseTax);
@@ -419,7 +423,7 @@ var processItemsTax = function processItemsTax(items, _ref2, options) {
419
423
  }
420
424
  if (taxRemainder !== 0) {
421
425
  if (lastTaxableItem.type === 'main') {
422
- lastTaxableItem.item._extend.tax_fee_rounding_remainder = taxRemainder;
426
+ lastTaxableItem.item.tax_fee_rounding_remainder = taxRemainder;
423
427
  } else {
424
428
  lastTaxableItem.item.tax_fee_rounding_remainder = taxRemainder;
425
429
  }
@@ -988,7 +992,6 @@ export var getSurcharge = function getSurcharge(_ref10, options) {
988
992
  var fixedSurcharge = new Decimal(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
989
993
  var quantity = _item2.isMain ? _item2.quantity : _item2.quantity * _item2.mainQuantity;
990
994
  fixedTotal = fixedTotal.plus(new Decimal(fixedSurcharge).times(quantity).toNumber());
991
-
992
995
  // 如果是最后一个商品 判断fixed - fixedTotal 是否有剩余小数 如果有的话,追加抹平字段
993
996
  if (isLast && fixedTotal.gt(0)) {
994
997
  var remaining = new Decimal(fixed).minus(fixedTotal).toNumber();
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
314
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -357,7 +357,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
357
357
  };
358
358
  setOtherData(key: string, value: any): void;
359
359
  getOtherData(key: string): any;
360
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
360
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
361
361
  /**
362
362
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
363
363
  *
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -46,7 +46,16 @@ var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList)
46
46
  const totalTaxFee = new import_decimal.default(calculateTaxFee(shopInfo, items));
47
47
  const surcharge = getSurcharge({ service: items, addons: [], bookingDetail: null, bookingId: void 0 }, { isEdit: false, isInScheduleByDate, surcharge_list: surchargeList, scheduleById: {} });
48
48
  const surchargeAmount = new import_decimal.default(getSurchargeAmount({ bookingDetail: null, bookingId: void 0 }, surcharge, { isEdit: false }));
49
- const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal : subtotal.plus(totalTaxFee).plus(surchargeAmount);
49
+ const { tax, originTax } = getTax({ service: items, bookingDetail: null, bookingId: void 0 }, {
50
+ computed: {
51
+ productExpectAmount: subtotal.toNumber(),
52
+ shopDiscount: 0
53
+ },
54
+ isEdit: false,
55
+ tax_rate: shopInfo == null ? void 0 : shopInfo.tax_rate,
56
+ is_price_include_tax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax
57
+ });
58
+ const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal.plus(surchargeAmount) : subtotal.plus(totalTaxFee).plus(surchargeAmount);
50
59
  const originTotal = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
51
60
  const deposit = calculateDeposit(items);
52
61
  return {
@@ -55,7 +64,7 @@ var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList)
55
64
  originTotal: originTotal.toFixed(2),
56
65
  taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
57
66
  taxRate: shopInfo == null ? void 0 : shopInfo.tax_rate,
58
- totalTaxFee: totalTaxFee.toFixed(2),
67
+ totalTaxFee: tax,
59
68
  isPriceIncludeTax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax,
60
69
  surcharge,
61
70
  surchargeAmount: surchargeAmount.toFixed(2),
@@ -83,6 +92,222 @@ var getProductDiscountProductDiscountDifference = (item) => {
83
92
  return pre + (cur.metadata.product_discount_difference || 0);
84
93
  }, 0);
85
94
  };
95
+ var getTax = ({ service, addons, bookingDetail, bookingId }, options) => {
96
+ const { isEdit, computed, tax_rate, is_price_include_tax } = options;
97
+ debugger;
98
+ let totalOriginTax = new import_decimal.default(0);
99
+ let totalTax = new import_decimal.default(0);
100
+ if (service || addons) {
101
+ if (service == null ? void 0 : service.length) {
102
+ const serviceResult = processItemsTax(service, { bookingDetail, bookingId }, {
103
+ tax_rate,
104
+ is_price_include_tax,
105
+ computed
106
+ });
107
+ totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
108
+ totalTax = totalTax.plus(serviceResult.tax);
109
+ }
110
+ if (addons == null ? void 0 : addons.length) {
111
+ const addonsResult = processItemsTax(addons, { bookingDetail, bookingId }, {
112
+ tax_rate,
113
+ is_price_include_tax,
114
+ computed
115
+ });
116
+ totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
117
+ totalTax = totalTax.plus(addonsResult.tax);
118
+ }
119
+ }
120
+ return {
121
+ originTax: totalOriginTax.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber(),
122
+ tax: totalTax.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber()
123
+ };
124
+ };
125
+ var processItemsTax = (items, { bookingDetail, bookingId }, options) => {
126
+ const { tax_rate, is_price_include_tax, computed } = options;
127
+ const { shopDiscount, productExpectAmount } = computed;
128
+ let preciseOriginTax = new import_decimal.default(0);
129
+ let preciseTax = new import_decimal.default(0);
130
+ let roundedOriginTax = new import_decimal.default(0);
131
+ let roundedTax = new import_decimal.default(0);
132
+ let lastTaxableItem = null;
133
+ for (let item of items) {
134
+ const quantity = new import_decimal.default(item.num || 1);
135
+ const unitPrice = new import_decimal.default(item.total || 0);
136
+ const mainProductPrice = new import_decimal.default(getMainProductTotal(item) || 0);
137
+ let originalTaxPerItemPrecise = getProductItemTax(
138
+ {
139
+ ...item,
140
+ total: mainProductPrice.add((item == null ? void 0 : item.surcharge_fee) || 0).toNumber(),
141
+ quantity: 1
142
+ },
143
+ { bookingDetail, bookingId },
144
+ { tax_rate, is_price_include_tax }
145
+ );
146
+ let itemDiscount = new import_decimal.default(0);
147
+ if (productExpectAmount > 0) {
148
+ itemDiscount = unitPrice.dividedBy(productExpectAmount).times(shopDiscount);
149
+ }
150
+ let mainItemDiscount = new import_decimal.default(0);
151
+ if (unitPrice.greaterThan(0)) {
152
+ mainItemDiscount = mainProductPrice.dividedBy(productExpectAmount).times(shopDiscount);
153
+ }
154
+ const mainItemDiscountedUnitPrice = mainProductPrice.minus(mainItemDiscount).add((item == null ? void 0 : item.surcharge_fee) || 0);
155
+ const maxDiscountedTaxPerItemPrecise = getProductItemTax(
156
+ {
157
+ ...item,
158
+ total: mainItemDiscountedUnitPrice.toNumber(),
159
+ price: item.total,
160
+ quantity: 1
161
+ },
162
+ { bookingDetail, bookingId },
163
+ { tax_rate, is_price_include_tax }
164
+ );
165
+ const maxDiscountedTaxPerItemRounded = maxDiscountedTaxPerItemPrecise.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
166
+ item.main_product_attached_bundle_tax_fee = maxDiscountedTaxPerItemRounded.toNumber();
167
+ if (maxDiscountedTaxPerItemPrecise.gt(0)) {
168
+ lastTaxableItem = { type: "main", item };
169
+ }
170
+ let addTimePreciseTax = new import_decimal.default(0);
171
+ let addTimeRoundedTax = new import_decimal.default(0);
172
+ if (Array.isArray(item.relation_details)) {
173
+ for (let atItem of item.relation_details) {
174
+ const _originTotal = new import_decimal.default(
175
+ atItem.selling_price || atItem.price || 0
176
+ );
177
+ let _discountedTotal = _originTotal;
178
+ if (productExpectAmount > 0) {
179
+ _discountedTotal = _originTotal.minus(
180
+ _originTotal.dividedBy(productExpectAmount).times(shopDiscount)
181
+ );
182
+ }
183
+ const addTimeTaxPerItemPrecise = getProductItemTax(
184
+ {
185
+ ...atItem,
186
+ total: _discountedTotal.add((atItem == null ? void 0 : atItem.surcharge_fee) || 0).toNumber(),
187
+ quantity: atItem.product_quantity || atItem.num || 1
188
+ },
189
+ { bookingDetail, bookingId },
190
+ { tax_rate, is_price_include_tax }
191
+ );
192
+ const addTimeTaxPerItemRounded = addTimeTaxPerItemPrecise.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
193
+ atItem.tax_fee = addTimeTaxPerItemRounded.toNumber();
194
+ addTimePreciseTax = addTimePreciseTax.plus(addTimeTaxPerItemPrecise);
195
+ addTimeRoundedTax = addTimeRoundedTax.plus(addTimeTaxPerItemRounded);
196
+ if (addTimeTaxPerItemPrecise.gt(0)) {
197
+ lastTaxableItem = { type: "addTime", item: atItem };
198
+ }
199
+ }
200
+ }
201
+ let bundlePreciseOriginTax = new import_decimal.default(0);
202
+ let bundlePreciseTax = new import_decimal.default(0);
203
+ let bundleRoundedOriginTax = new import_decimal.default(0);
204
+ let bundleRoundedTax = new import_decimal.default(0);
205
+ if (Array.isArray(item == null ? void 0 : item.bundle)) {
206
+ for (let bundleItem of item == null ? void 0 : item.bundle) {
207
+ if (getBundleItemIsOriginalPrice(bundleItem)) {
208
+ const bundleQuantity = new import_decimal.default(bundleItem.quantity || 1);
209
+ const bundleUnitPrice = new import_decimal.default(
210
+ bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
211
+ );
212
+ const bundleOriginalTaxPerItemPrecise = getProductItemTax(
213
+ {
214
+ ...bundleItem,
215
+ total: bundleUnitPrice.add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0).toNumber(),
216
+ quantity: 1
217
+ },
218
+ { bookingDetail, bookingId },
219
+ { tax_rate, is_price_include_tax }
220
+ );
221
+ let bundleItemDiscount = new import_decimal.default(0);
222
+ if (productExpectAmount > 0) {
223
+ bundleItemDiscount = bundleUnitPrice.dividedBy(productExpectAmount).times(shopDiscount);
224
+ }
225
+ const bundleDiscountedUnitPrice = bundleUnitPrice.minus(bundleItemDiscount).add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0);
226
+ const bundleDiscountedTaxPerItemPrecise = getProductItemTax(
227
+ {
228
+ ...bundleItem,
229
+ total: bundleDiscountedUnitPrice.toNumber(),
230
+ quantity: 1
231
+ },
232
+ { bookingDetail, bookingId },
233
+ { tax_rate, is_price_include_tax }
234
+ );
235
+ const bundleOriginalTaxPerItemRounded = bundleOriginalTaxPerItemPrecise.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
236
+ const bundleDiscountedTaxPerItemRounded = bundleDiscountedTaxPerItemPrecise.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
237
+ bundleItem.original_tax_fee = bundleOriginalTaxPerItemRounded.toNumber();
238
+ bundleItem.tax_fee = bundleDiscountedTaxPerItemRounded.toNumber();
239
+ bundlePreciseOriginTax = bundlePreciseOriginTax.plus(bundleOriginalTaxPerItemPrecise.times(bundleQuantity));
240
+ bundlePreciseTax = bundlePreciseTax.plus(bundleDiscountedTaxPerItemPrecise.times(bundleQuantity));
241
+ bundleRoundedOriginTax = bundleRoundedOriginTax.plus(bundleOriginalTaxPerItemRounded.times(bundleQuantity));
242
+ bundleRoundedTax = bundleRoundedTax.plus(bundleDiscountedTaxPerItemRounded.times(bundleQuantity));
243
+ if (bundleDiscountedTaxPerItemPrecise.gt(0)) {
244
+ lastTaxableItem = { type: "bundle", item: bundleItem };
245
+ }
246
+ }
247
+ }
248
+ }
249
+ const originalTaxFeePrecise = originalTaxPerItemPrecise.plus(bundlePreciseOriginTax);
250
+ const taxFeePrecise = maxDiscountedTaxPerItemPrecise.plus(bundlePreciseTax);
251
+ const originalTaxFeeRounded = originalTaxPerItemPrecise.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).plus(bundleRoundedOriginTax);
252
+ const taxFeeRounded = maxDiscountedTaxPerItemRounded.plus(bundleRoundedTax);
253
+ item.original_tax_fee = originalTaxFeeRounded.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
254
+ item.tax_fee = taxFeeRounded.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
255
+ preciseOriginTax = preciseOriginTax.plus(originalTaxFeePrecise.times(quantity)).plus(addTimePreciseTax);
256
+ preciseTax = preciseTax.plus(taxFeePrecise.times(quantity)).plus(addTimePreciseTax);
257
+ roundedOriginTax = roundedOriginTax.plus(originalTaxFeeRounded.times(quantity)).plus(addTimeRoundedTax);
258
+ roundedTax = roundedTax.plus(taxFeeRounded.times(quantity)).plus(addTimeRoundedTax);
259
+ }
260
+ const expectedOriginTax = preciseOriginTax.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
261
+ const expectedTax = preciseTax.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
262
+ const originTaxRemainder = expectedOriginTax.minus(roundedOriginTax).toNumber();
263
+ const taxRemainder = expectedTax.minus(roundedTax).toNumber();
264
+ if (lastTaxableItem) {
265
+ if (originTaxRemainder !== 0) {
266
+ if (lastTaxableItem.type === "main") {
267
+ lastTaxableItem.item.original_tax_fee_rounding_remainder = originTaxRemainder;
268
+ } else {
269
+ lastTaxableItem.item.original_tax_fee_rounding_remainder = originTaxRemainder;
270
+ }
271
+ }
272
+ if (taxRemainder !== 0) {
273
+ if (lastTaxableItem.type === "main") {
274
+ lastTaxableItem.item.tax_fee_rounding_remainder = taxRemainder;
275
+ } else {
276
+ lastTaxableItem.item.tax_fee_rounding_remainder = taxRemainder;
277
+ }
278
+ }
279
+ }
280
+ return { originTax: expectedOriginTax, tax: expectedTax };
281
+ };
282
+ var getProductItemTax = (item, state, options) => {
283
+ const { bookingDetail } = state;
284
+ const { tax_rate, is_price_include_tax } = options;
285
+ const productDiscountPrice = new import_decimal.default(item.total || 0);
286
+ const quantity = new import_decimal.default(item.num || 1);
287
+ if (productDiscountPrice.lte(0)) {
288
+ return new import_decimal.default(0);
289
+ }
290
+ const currentTaxRate = new import_decimal.default(
291
+ (bookingDetail == null ? void 0 : bookingDetail.tax_rate) ?? (tax_rate ? tax_rate / 100 : 0)
292
+ );
293
+ const currentIsPriceIncludeTax = (bookingDetail == null ? void 0 : bookingDetail.is_price_include_tax) ?? is_price_include_tax ?? 0;
294
+ let singleItemTax = new import_decimal.default(0);
295
+ if (item.is_charge_tax === 0 || !item.is_charge_tax) {
296
+ singleItemTax = new import_decimal.default(0);
297
+ } else {
298
+ if (currentIsPriceIncludeTax === 0) {
299
+ singleItemTax = productDiscountPrice.times(currentTaxRate);
300
+ } else {
301
+ const divisor = new import_decimal.default(1).plus(currentTaxRate);
302
+ if (divisor.lte(0)) {
303
+ singleItemTax = new import_decimal.default(0);
304
+ } else {
305
+ singleItemTax = productDiscountPrice.dividedBy(divisor).times(currentTaxRate);
306
+ }
307
+ }
308
+ }
309
+ return singleItemTax.times(quantity);
310
+ };
86
311
  var calculateSubtotal = (items) => {
87
312
  if (!(items == null ? void 0 : items.length)) {
88
313
  return "0.00";
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
314
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -357,7 +357,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
357
357
  };
358
358
  setOtherData(key: string, value: any): void;
359
359
  getOtherData(key: string): any;
360
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
360
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
361
361
  /**
362
362
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
363
363
  *
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.401",
4
+ "version": "0.0.402",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",