@pisell/pisellos 2.1.27 → 2.1.29

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.
@@ -1808,7 +1808,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1808
1808
  // 例如:amount=15, rounding_amount=-0.2,有效支付=15.2(抹掉0.2元零头)
1809
1809
  var paymentAmount = new Decimal(payment.amount || 0);
1810
1810
  var roundingAmount = new Decimal(payment.rounding_amount || 0);
1811
- var effectiveAmount = paymentAmount.plus(roundingAmount.abs());
1811
+ var effectiveAmount = paymentAmount.plus(roundingAmount.isNegative() ? roundingAmount.abs() : 0);
1812
1812
  return sum.plus(effectiveAmount);
1813
1813
  } catch (error) {
1814
1814
  console.warn("[PaymentModule] \u65E0\u6548\u7684\u652F\u4ED8\u91D1\u989D: amount=".concat(payment.amount, ", rounding_amount=").concat(payment.rounding_amount, "\uFF0C\u8DF3\u8FC7\u8BA1\u7B97"));
@@ -1836,7 +1836,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1836
1836
  code: p.code,
1837
1837
  amount: p.amount,
1838
1838
  rounding_amount: p.rounding_amount || '0.00',
1839
- effective_amount: new Decimal(p.amount || 0).plus(new Decimal(p.rounding_amount || 0).abs()).toFixed(2)
1839
+ effective_amount: new Decimal(p.amount || 0).plus(new Decimal(Number(p.rounding_amount) > 0 ? 0 : p.rounding_amount || 0).abs()).toFixed(2)
1840
1840
  };
1841
1841
  }),
1842
1842
  说明: '有效支付金额包含抹零计算(amount + |rounding_amount|)'
@@ -310,6 +310,10 @@ export declare class CheckoutImpl extends BaseModule implements Module, Checkout
310
310
  * 计算剩余未支付金额(从 Payment 模块获取最新数据)
311
311
  */
312
312
  private calculateRemainingAmountAsync;
313
+ /**
314
+ * 计算剩余未支付金额(排除定金计算,始终使用订单总金额)
315
+ */
316
+ private calculateRemainingTotalAmountAsync;
313
317
  /**
314
318
  * 更新 balanceDueAmount 为当前剩余未支付金额(系统内部计算)
315
319
  */