1 parent
81584dc45a
commit
3bf9e8d82d
9 files changed
+15
-152
No files matched your search
+1
-1
@@ -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||ledger.defaultSalesperson(actor),'开单人',30),note=env.text(input.note,'客户单备注',240,true);
|
||||
const customer=env.text(input.customer,'客户称呼',60),salesperson=env.text(input.salesperson||actor.name,'开单人',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);
|
||||
|
||||
Reference in new issue
Block a user