支持按账号自定义单据默认经办人

This commit is contained in:
summer committed 2026-10-22 15:26:55 +08:00
1 parent 476f81a8d1
commit 81584dc45a
9 files changed
+152 -15

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ function create(ledger,input,actor,env){return atomic(ledger,()=>{
costParts:{material:yuan(costs.originalPurchase),labor:'0',accessories:'0',other:'0'},costMaterial:{mode:'total'},costLabor:{mode:'total'},costPayers:{material:payer,labor:payer}}])[0];
const discount=env.money(input.discount??'0','整单优惠'),estimated=Calc.orderTotal([line.sale],discount,'yuan');
const id=randomUUID(),number='SJ'+date.replaceAll('-','')+'-'+id.slice(0,8).toUpperCase(),timestamp=env.now();
const customer=env.text(input.customer,'客户称呼',60),salesperson=env.text(input.salesperson||actor.name,'开单人',30),note=env.text(input.note,'客户单备注',240,true);
const customer=env.text(input.customer,'客户称呼',60),salesperson=env.text(input.salesperson||ledger.defaultSalesperson(actor),'开单人',30),note=env.text(input.note,'客户单备注',240,true);
customerNote({number,sell_rate:sellRate,note},undefined,env);
ledger.run('INSERT INTO price_locks(id,number,date,customer,salesperson,note,line,locked_mg,sell_rate,buy_rate,buy_payer,material_amount,estimated_total,discount,status,revision,actor,created,updated) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
id,number,date,customer,salesperson,note,JSON.stringify(line),quantity,sellRate,buyRate,payer,costs.originalPurchase,estimated.total,discount,'pending',1,actor.name,timestamp,timestamp);