Files
weiguang-jewelry-ledger/新账系统/public/credit-card-fees.js
T
summer a506fb1228 完善订单审批、每日对账与信用卡手续费
加入助理订单变更复核、收款人汇总、每日报销和应转金额;优化库存筛选、订单明细与连续浏览。开单身份必填,信用卡手续费按实收4‰自动计算并默认由麦麦承担,打印优惠显示在人民币大写旁。

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

13 lines
669 B
JavaScript

'use strict';
// 手续费预览使用整数分;真实费用由服务端按每笔客户付款生成。
(function(root){
const isAccount=account=>['助理信用卡','麦麦信用卡'].includes(account);
const isFee=item=>item?.system==='credit_card'||String(item?.key||'').startsWith('card_fee:');
function amount(cents){
if(!Number.isSafeInteger(cents)||cents<0||cents>100000000000)throw new Error('客户付款金额无效');
return Math.floor((cents*4+500)/1000);
}
const api={isAccount,isFee,amount};
if(typeof module==='object'&&module.exports)module.exports=api;else root.CreditCardFees=api;
})(typeof globalThis==='object'?globalThis:this);