@pisell/pisellos 0.0.315 → 0.0.316
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.
|
@@ -3287,7 +3287,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3287
3287
|
return item.status !== 'voided' && item.order_payment_type === 'deposit';
|
|
3288
3288
|
}).reduce(function (sum, item) {
|
|
3289
3289
|
var amt = new Decimal(item.amount || '0');
|
|
3290
|
-
|
|
3290
|
+
var rounding = new Decimal(Number(item.rounding_amount) || '0');
|
|
3291
|
+
return sum.plus(amt).sub(rounding);
|
|
3291
3292
|
}, new Decimal(0)).toFixed(2);
|
|
3292
3293
|
}
|
|
3293
3294
|
// 如果当前是定金支付,并且定金额度已经大于等于了订单总计,则 finalDepositAmount 为实际付出去的定金金额
|
|
@@ -3296,7 +3297,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3296
3297
|
return item.status !== 'voided' && item.order_payment_type === 'deposit';
|
|
3297
3298
|
}).reduce(function (sum, item) {
|
|
3298
3299
|
var amt = new Decimal(item.amount || '0');
|
|
3299
|
-
|
|
3300
|
+
var rounding = new Decimal(Number(item.rounding_amount) || '0');
|
|
3301
|
+
return sum.plus(amt).sub(rounding);
|
|
3300
3302
|
}, new Decimal(0)).toFixed(2);
|
|
3301
3303
|
}
|
|
3302
3304
|
this.logInfo('定金金额确定结果', {
|
|
@@ -2035,13 +2035,15 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
2035
2035
|
if (this.store.currentOrder.is_deposit === 0 && processedPaymentItems.some((item) => item.order_payment_type === "deposit")) {
|
|
2036
2036
|
finalDepositAmount = processedPaymentItems.filter((item) => item.status !== "voided" && item.order_payment_type === "deposit").reduce((sum, item) => {
|
|
2037
2037
|
const amt = new import_decimal.default(item.amount || "0");
|
|
2038
|
-
|
|
2038
|
+
const rounding = new import_decimal.default(Number(item.rounding_amount) || "0");
|
|
2039
|
+
return sum.plus(amt).sub(rounding);
|
|
2039
2040
|
}, new import_decimal.default(0)).toFixed(2);
|
|
2040
2041
|
}
|
|
2041
2042
|
if (this.store.currentOrder.is_deposit === 1 && new import_decimal.default(finalDepositAmount).gte(new import_decimal.default(this.store.currentOrder.total_amount))) {
|
|
2042
2043
|
finalDepositAmount = processedPaymentItems.filter((item) => item.status !== "voided" && item.order_payment_type === "deposit").reduce((sum, item) => {
|
|
2043
2044
|
const amt = new import_decimal.default(item.amount || "0");
|
|
2044
|
-
|
|
2045
|
+
const rounding = new import_decimal.default(Number(item.rounding_amount) || "0");
|
|
2046
|
+
return sum.plus(amt).sub(rounding);
|
|
2045
2047
|
}, new import_decimal.default(0)).toFixed(2);
|
|
2046
2048
|
}
|
|
2047
2049
|
this.logInfo("定金金额确定结果", {
|