统一结账押金字段为押金赔付扣除

号主修正去掉无效的其他押金扣款,仅保留押金赔付扣除;
前后端与账单文案统一,修正时 other 与 deduct 对齐。
This commit is contained in:
yml2213
2026-07-17 17:17:29 +08:00
parent c492a1cc85
commit 98772867a7
8 changed files with 25 additions and 42 deletions
@@ -11,7 +11,6 @@ export interface CheckoutFormSnapshot {
export interface CounterFormSnapshot {
consumableAmountYuan: number
coin_consumed_m: number
otherAmountYuan: number
depositDeductAmountYuan: number
reason: string
evidenceText: string
@@ -181,11 +180,16 @@ export function buildCheckoutContentWithSummary(options: {
}
export function hydrateCounterFormFromCheckout(checkout: Checkout): CounterFormSnapshot {
// 号主修正只暴露押金赔付扣除;优先用结算字段,兼容旧单 only other 的情况
const depositDeductYuan = amountYuan(
checkout.deposit_deduct_amount_cent > 0
? checkout.deposit_deduct_amount_cent
: checkout.other_amount_cent
)
return {
consumableAmountYuan: amountYuan(checkout.consumable_amount_cent),
coin_consumed_m: checkout.coin_consumed_m,
otherAmountYuan: amountYuan(checkout.other_amount_cent),
depositDeductAmountYuan: amountYuan(checkout.deposit_deduct_amount_cent),
depositDeductAmountYuan: depositDeductYuan,
reason: '',
evidenceText: '',
}
@@ -193,16 +197,9 @@ export function hydrateCounterFormFromCheckout(checkout: Checkout): CounterFormS
export function calculateCounterTotal(counterForm: {
consumableAmountYuan: number
coin_consumed_m: number
otherAmountYuan: number
depositDeductAmountYuan: number
}) {
return roundMoney(
counterForm.consumableAmountYuan +
counterForm.coin_consumed_m +
counterForm.otherAmountYuan +
counterForm.depositDeductAmountYuan
)
return roundMoney(counterForm.consumableAmountYuan + counterForm.depositDeductAmountYuan)
}
export function getSnapshotHafCoinM(order: Order | null) {