支持三人台账、库存更正审批与每日人数增量
This commit is contained in:
1 parent
8d9039aacf
commit
f6bdfcf10d
57 files changed
+2536
-564
No files matched your search
@@ -1,11 +1,12 @@
|
||||
'use strict';
|
||||
// 只构造可编辑的新单输入;不分配订单号、不写账,也不携带历史财务身份。
|
||||
(function(root,factory){
|
||||
const api=factory(typeof module==='object'&&module.exports?require('./fee-estimates'):root.FeeEstimates);
|
||||
const api=factory(typeof module==='object'&&module.exports?require('./fee-estimates'):root.FeeEstimates,typeof module==='object'&&module.exports?require('./credit-card-fees'):root.CreditCardFees);
|
||||
if(typeof module==='object'&&module.exports)module.exports=api;else root.OrderCopy=api;
|
||||
})(typeof globalThis==='object'?globalThis:this,function(Fees){
|
||||
})(typeof globalThis==='object'?globalThis:this,function(Fees,Cards){
|
||||
const money=value=>value==null?'':(value/100).toFixed(2);
|
||||
const nonblank=value=>value!=null&&String(value).trim()!=='';
|
||||
const normalizeAccount=account=>Cards?.normalizeAccount?Cards.normalizeAccount(account):(['助理信用卡','助理1信用卡','助理2信用卡','麦麦信用卡'].includes(account)?'麦麦信用卡':account);
|
||||
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=>({
|
||||
@@ -76,7 +77,7 @@
|
||||
}else result.cost=line.cost;
|
||||
return result;
|
||||
});
|
||||
return {date:today,fees_date:today,customer:'',salesperson:source.salesperson||'',payment_account:source.payment_account||'助理微信',discount:source.discount,note:locked?String(source.note||'').replace(/;?锁价单 [^;]*;按原锁定金价 [^;]*元\/克结算$/,''):source.note||'',rounding_mode:'yuan',
|
||||
return {date:today,fees_date:today,customer:'',salesperson:source.salesperson||'',payment_account:normalizeAccount(source.payment_account||'助理微信'),discount:source.discount,note:locked?String(source.note||'').replace(/;?锁价单 [^;]*;按原锁定金价 [^;]*元\/克结算$/,''):source.note||'',rounding_mode:'yuan',
|
||||
copy_kind:locked?'price-lock':'ordinary',fee_auto_initialized:true,lines,fee_items:copyFees(order,lines,chargeIds,newId)};
|
||||
}
|
||||
function hasDraftContent(draft,{today,salesperson}={}){
|
||||
|
||||
Reference in new issue
Block a user