完善订单审批、每日对账与信用卡手续费

加入助理订单变更复核、收款人汇总、每日报销和应转金额;优化库存筛选、订单明细与连续浏览。开单身份必填,信用卡手续费按实收4‰自动计算并默认由麦麦承担,打印优惠显示在人民币大写旁。

验证:484项测试通过;独立HTTP与浏览器覆盖普通订单、锁价、修改审批、断线恢复和打印隔离。旧报表兼容,本机升级原29表295行数据保持一致。
This commit is contained in:
summer committed 2026-10-23 09:49:36 +08:00
1 parent 27a11e9b35
commit a506fb1228
68 files changed
+3591 -259

No files matched your search

+4 -1
View File
@@ -6,6 +6,7 @@
})(typeof globalThis==='object'?globalThis:this,function(Fees){
const money=value=>value==null?'':(value/100).toFixed(2);
const nonblank=value=>value!=null&&String(value).trim()!=='';
const cardFee=item=>item?.system==='credit_card'||String(item?.key||'').startsWith('card_fee:');
function inputs(order){
return {...order,rounding_mode:order.rounding_mode||'cent',discount:money(order.discount),fee_items:(order.fee_items||[]).map(item=>({...item,amount:money(item.amount)})),lines:order.lines.map(line=>({
...line,quantity:line.unit==='g'?(line.quantity/1000).toFixed(3):line.quantity,sale:money(line.sale),baseSale:money(line.baseSale??line.sale),cost:money(line.cost),
@@ -18,11 +19,13 @@
}
function copyFees(order,lines,chargeIds,newId){
const corrected=new Set((order.corrections||[]).filter(row=>row.type==='expense').map(row=>row.target));
const positives=order.expenses.filter(row=>row.amount>0&&!String(row.note||'').startsWith('更正冲回:'));
const cardExpenseIds=new Set(order.fee_items.filter(cardFee).map(fee=>fee.expense_id).filter(Boolean));
const positives=order.expenses.filter(row=>row.amount>0&&!String(row.note||'').startsWith('更正冲回:')&&!cardFee(row)&&!cardExpenseIds.has(row.id));
const active=positives.filter(row=>!corrected.has(row.id)),matched=new Set(),used=new Set(),items=[];
const pending=new Set((order.pendingFees||[]).map(item=>item.key));
const same=(expense,fee)=>expense.amount===fee.amount&&expense.payer===fee.payer&&Fees.normalize(expense.note)===Fees.normalize(fee.note);
for(const fee of order.fee_items){
if(cardFee(fee)||fee.expense_id&&cardExpenseIds.has(fee.expense_id))continue;
const linked=chargeIds.get(String(fee.key).replace(/^charge:/,''));
const key=linked?'charge:'+linked:fee.key==='shipping'?'shipping':'manual:'+newId();
let amount=fee.amount,payer=fee.payer;