新增老板专属私域运营概况与订单新老客户统计
This commit is contained in:
1 parent
000a80af3c
commit
d18089aaf6
21 files changed
+248
-79
No files matched your search
+1
-1
@@ -207,7 +207,7 @@ function deliver(ledger,id,input,actor,env){return atomic(ledger,()=>{
|
||||
let settlementAccount=lock.cash_events.find(event=>event.kind==='receipt')?.account??'助理微信';
|
||||
if(difference){if(input.settlement?.verified!==true)env.fail('请确认客户补款或退款已经实际完成');const amount=env.money(input.settlement.amount,'实际补退款金额');if(amount!==Math.abs(difference))env.fail('实际补退款金额须与最终成交差额一致');settlementAccount=paymentAccount(input.settlement.account,env);}
|
||||
else if(input.settlement?.amount!==undefined&&env.money(input.settlement.amount,'实际补退款金额')!==0)env.fail('本单无需补退款,不能重复记收款');
|
||||
const note=customerNote(lock,input.note,env),normal={date,customer:lock.customer,salesperson:lock.salesperson,note,discount:yuan(discount),rounding_mode:'yuan',payment_account:settlementAccount,lines:actualLines,fee_items:fees.map(fee=>({...fee,amount:fee.amount===null?'':yuan(fee.amount),status:'estimated'})),fees_date:date};
|
||||
const note=customerNote(lock,input.note,env),normal={date,customer_type:input.customer_type,customer:lock.customer,salesperson:lock.salesperson,note,discount:yuan(discount),rounding_mode:'yuan',payment_account:settlementAccount,lines:actualLines,fee_items:fees.map(fee=>({...fee,amount:fee.amount===null?'':yuan(fee.amount),status:'estimated'})),fees_date:date};
|
||||
const finalId=env.saveDeliveryOrder(normal).id,storedLines=ledger.rawOrder(finalId).lines,deliveryRows=[],group=randomUUID();
|
||||
CreditCardRates.capture(ledger,'order',finalId,lock.credit_card_rate_permille);
|
||||
for(const [index,result] of results.entries()){
|
||||
|
||||
Reference in new issue
Block a user