@pisell/pisellos 0.0.297 → 0.0.299

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.
@@ -484,9 +484,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
484
484
  };
485
485
  bookings === null || bookings === void 0 || bookings.forEach(function (item) {
486
486
  var total = item.product.calculated_selling_price;
487
- item.product.discount_list.forEach(function (discount) {
488
- summaryDeposit.total = new Decimal(summaryDeposit.total).minus(discount.amount || 0).toNumber();
489
- });
490
487
  var deposit = getProductDeposit({
491
488
  cartItem: {
492
489
  total: total
@@ -499,6 +496,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
499
496
  item.deposit = deposit;
500
497
  if (deposit !== null && deposit !== void 0 && deposit.total && Number(deposit.total) > 0) {
501
498
  summaryDeposit.protocols = summaryDeposit.protocols.concat(deposit.protocols);
499
+ summaryDeposit.total = new Decimal(summaryDeposit.total).plus(deposit.total).toNumber();
502
500
  summaryDeposit.hasDeposit = true;
503
501
  }
504
502
  });
@@ -281,9 +281,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
281
281
  };
282
282
  bookings == null ? void 0 : bookings.forEach((item) => {
283
283
  const total = item.product.calculated_selling_price;
284
- item.product.discount_list.forEach((discount) => {
285
- summaryDeposit.total = new import_decimal.default(summaryDeposit.total).minus(discount.amount || 0).toNumber();
286
- });
287
284
  const deposit = (0, import_utils2.getProductDeposit)({
288
285
  cartItem: {
289
286
  total
@@ -298,6 +295,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
298
295
  summaryDeposit.protocols = summaryDeposit.protocols.concat(
299
296
  deposit.protocols
300
297
  );
298
+ summaryDeposit.total = new import_decimal.default(summaryDeposit.total).plus(deposit.total).toNumber();
301
299
  summaryDeposit.hasDeposit = true;
302
300
  }
303
301
  });
@@ -1786,7 +1784,9 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
1786
1784
  return "0.00";
1787
1785
  }
1788
1786
  let totalAmount = new import_decimal.default(this.store.currentOrder.total_amount || "0");
1789
- const currentOrder = await this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
1787
+ const currentOrder = await this.payment.getPaymentOrderByUuidAsync(
1788
+ this.store.currentOrder.uuid
1789
+ );
1790
1790
  if ((currentOrder == null ? void 0 : currentOrder.is_deposit) && (currentOrder == null ? void 0 : currentOrder.deposit_amount) && Number(currentOrder == null ? void 0 : currentOrder.deposit_amount) > 0) {
1791
1791
  totalAmount = new import_decimal.default(currentOrder == null ? void 0 : currentOrder.deposit_amount);
1792
1792
  }
@@ -1832,8 +1832,12 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
1832
1832
  var _a, _b, _c, _d;
1833
1833
  try {
1834
1834
  if (((_a = this.store.currentOrder) == null ? void 0 : _a.is_deposit) === 1) {
1835
- const paymentItems = await this.payment.getPaymentItemsAsync((_b = this.store.currentOrder) == null ? void 0 : _b.uuid);
1836
- const depositPaidAmount = paymentItems.filter((item) => item.order_payment_type === "deposit" && item.status !== "voided").reduce((sum, item) => {
1835
+ const paymentItems = await this.payment.getPaymentItemsAsync(
1836
+ (_b = this.store.currentOrder) == null ? void 0 : _b.uuid
1837
+ );
1838
+ const depositPaidAmount = paymentItems.filter(
1839
+ (item) => item.order_payment_type === "deposit" && item.status !== "voided"
1840
+ ).reduce((sum, item) => {
1837
1841
  if (item.voucher_id && !item.isSynced) {
1838
1842
  return sum;
1839
1843
  }
@@ -2051,13 +2055,15 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
2051
2055
  deposit: void 0
2052
2056
  };
2053
2057
  }),
2054
- relation_products: (_f = this.store.localOrderData.relation_products) == null ? void 0 : _f.map((item) => {
2055
- return {
2056
- ...item,
2057
- custom_deposit_data: void 0,
2058
- deposit: void 0
2059
- };
2060
- })
2058
+ relation_products: (_f = this.store.localOrderData.relation_products) == null ? void 0 : _f.map(
2059
+ (item) => {
2060
+ return {
2061
+ ...item,
2062
+ custom_deposit_data: void 0,
2063
+ deposit: void 0
2064
+ };
2065
+ }
2066
+ )
2061
2067
  };
2062
2068
  if (isUpdateOperation) {
2063
2069
  if ((0, import_utils.isVirtualOrderId)(currentOrderId)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.297",
4
+ "version": "0.0.299",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",