@pisell/pisellos 0.0.306 → 0.0.307

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.
@@ -1068,13 +1068,13 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1068
1068
  // 🔒 支付锁检查:如果订单待付金额已经为0,不允许继续添加支付项
1069
1069
  expectAmount = new Decimal(order.expect_amount);
1070
1070
  paidDepositAmount = order.payment.reduce(function (sum, payment) {
1071
- if (payment.order_payment_type === 'deposit') {
1071
+ if (payment.order_payment_type === 'deposit' && payment.status !== 'voided') {
1072
1072
  return sum.plus(new Decimal(payment.amount));
1073
1073
  }
1074
1074
  return sum;
1075
1075
  }, new Decimal(0));
1076
- expectedDepositAmount = new Decimal(order.deposit_amount || '0').sub(paidDepositAmount); // 有一种特殊情况,订单金额为 0,但是定金金额>0,且此时是定金状态的,允许添加支付项
1077
- if (!(expectAmount.lte(0) && expectedDepositAmount.lte(0))) {
1076
+ expectedDepositAmount = new Decimal(order.deposit_amount || '0').sub(paidDepositAmount); // 有一种特殊情况,订单金额为 0,但是定金金额不等于0,且此时是定金状态的,允许添加支付项
1077
+ if (!(expectAmount.lte(0) && expectedDepositAmount.eq(0))) {
1078
1078
  _context13.next = 15;
1079
1079
  break;
1080
1080
  }
@@ -529,13 +529,13 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
529
529
  }
530
530
  const expectAmount = new import_decimal.Decimal(order.expect_amount);
531
531
  const paidDepositAmount = order.payment.reduce((sum, payment) => {
532
- if (payment.order_payment_type === "deposit") {
532
+ if (payment.order_payment_type === "deposit" && payment.status !== "voided") {
533
533
  return sum.plus(new import_decimal.Decimal(payment.amount));
534
534
  }
535
535
  return sum;
536
536
  }, new import_decimal.Decimal(0));
537
537
  const expectedDepositAmount = new import_decimal.Decimal(order.deposit_amount || "0").sub(paidDepositAmount);
538
- if (expectAmount.lte(0) && expectedDepositAmount.lte(0)) {
538
+ if (expectAmount.lte(0) && expectedDepositAmount.eq(0)) {
539
539
  const warningMessage = `订单 ${orderUuid} 待付金额已为0,不允许添加新的支付项`;
540
540
  console.warn("[PaymentModule] Payment lock triggered:", {
541
541
  orderUuid,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.306",
4
+ "version": "0.0.307",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",