历史置换手续费预览采用原单费率,移除两处固定费率兜底
This commit is contained in:
1 parent
d2bc0bb85f
commit
ca19987108
6 files changed
+176
-69
No files matched your search
@@ -338,13 +338,31 @@ export function orderActions(
|
||||
const visible = correction
|
||||
? corrected?.kind === 'receipt' && isCreditCardAccount(values.account)
|
||||
: method === '信用卡' && ui.action === 'receipt';
|
||||
const rate = currentOrder.credit_card_rate_permille ?? state.shopSettings?.creditCardRatePermille ?? 6;
|
||||
const rate = currentOrder.credit_card_rate_permille ?? state.shopSettings?.creditCardRatePermille;
|
||||
let amount, formula;
|
||||
if (visible || ui.lastCardBasis !== undefined) {
|
||||
const basisAmount = visible ? (values.amount ?? (currentOrder.balance / 100).toFixed(2)) : ui.lastCardBasis;
|
||||
let cents, fee;
|
||||
try {
|
||||
const basisAmount = visible ? (values.amount ?? (currentOrder.balance / 100).toFixed(2)) : ui.lastCardBasis;
|
||||
const cents = LedgerCalc.cents(basisAmount);
|
||||
amount = (CreditCardFees.amount(cents, rate) / 100).toFixed(2);
|
||||
cents = LedgerCalc.cents(basisAmount);
|
||||
} catch {
|
||||
cents = null;
|
||||
}
|
||||
if (rate != null) {
|
||||
try {
|
||||
// 金额未填时也校验费率,只有两项均有效才展示费用。
|
||||
fee = CreditCardFees.amount(cents ?? 0, rate);
|
||||
} catch {
|
||||
fee = null;
|
||||
}
|
||||
}
|
||||
if (fee == null) {
|
||||
formula = '信用卡手续费率未能确认,请重新读取后核对。';
|
||||
} else if (cents == null) {
|
||||
formula =
|
||||
'填写客户付款金额后自动计算' + rate + '‰手续费;付款人默认' + teamMemberName('owner') + ',可按实际修改。';
|
||||
} else {
|
||||
amount = (fee / 100).toFixed(2);
|
||||
formula =
|
||||
basis +
|
||||
' ¥' +
|
||||
@@ -352,11 +370,8 @@ export function orderActions(
|
||||
' × ' +
|
||||
rate +
|
||||
'‰ = ¥' +
|
||||
yuan(CreditCardFees.amount(cents, rate)) +
|
||||
yuan(fee) +
|
||||
'。计入内部成本,客户付款金额不变;退款不退回已发生的手续费。';
|
||||
} catch {
|
||||
formula =
|
||||
'填写客户付款金额后自动计算' + rate + '‰手续费;付款人默认' + teamMemberName('owner') + ',可按实际修改。';
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user