新增老板专属私域运营概况与订单新老客户统计
This commit is contained in:
1 parent
000a80af3c
commit
d18089aaf6
21 files changed
+248
-79
No files matched your search
+4
-1
@@ -22,6 +22,7 @@ const OrderEdit=require('./order-edit');
|
||||
const OrderCancellations=require('./order-cancellations');
|
||||
const OrderChanges=require('./order-changes');
|
||||
const TeamMembers=require('./team-members');
|
||||
const PrivateOperations=require('./private-operations');
|
||||
const ShopSettings=require('./shop-settings');
|
||||
const TeamFunds=require('./team-funds');
|
||||
const TeamProfits=require('./team-profits');
|
||||
@@ -180,7 +181,7 @@ class Ledger {
|
||||
DailyFunds.initialize(this);
|
||||
TeamMembers.initialize(this);TeamFunds.initialize(this);OrderOwnership.initialize(this);InventoryChanges.initialize(this);Recoveries.initialize(this);RecoveryMaterial.initialize(this);RecoveryChanges.initialize(this);MaterialPurchaseChanges.initialize(this);AfterSales.initialize(this);Pockets.initialize(this);
|
||||
OrderAfterSales.initialize(this);
|
||||
PrintStatus.initialize(this);
|
||||
PrintStatus.initialize(this);PrivateOperations.initialize(this);
|
||||
if(filename!==':memory:') fs.chmodSync(filename,0o600);
|
||||
}
|
||||
pocketCatalog(){return Pockets.list(this);}
|
||||
@@ -496,6 +497,7 @@ class Ledger {
|
||||
const paper=newNumber?this.paperNumber(date,true):autoNumber?date.replaceAll('-','')+autoNumber[1]:prior.paper_number;
|
||||
if(this.one("SELECT id FROM orders WHERE REPLACE(paper_number,'-','')=? AND id<>?",paper.replaceAll('-',''),id||''))fail('该日期已有相同纸单号,请保留原日期或取消后重开',409);
|
||||
const internalNote=text(input.internal_note===undefined?prior?.internal_note:input.internal_note,'内部备注',500,true);
|
||||
const customerType=PrivateOperations.customerType(input.customer_type===undefined?prior?.customer_type:input.customer_type);
|
||||
const common=[date,customer,salesperson,text(input.note,'客户单备注',240,true),internalNote,paper,JSON.stringify(lines),discount,total];
|
||||
if(id){
|
||||
this.run('UPDATE orders SET date=?,customer=?,salesperson=?,note=?,internal_note=?,paper_number=?,lines=?,discount=?,total=? WHERE id=?',...common,id);this.touch(id);
|
||||
@@ -504,6 +506,7 @@ class Ledger {
|
||||
this.run('INSERT INTO orders(id,number,date,customer,salesperson,note,internal_note,paper_number,lines,discount,total,status,created) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)',id,number,...common,'draft',now());this.assignMember('order',id,member,{fresh:true});this.enqueue('order:'+id);
|
||||
CreditCardRates.capture(this,'order',id);
|
||||
}
|
||||
this.run('UPDATE orders SET customer_type=? WHERE id=?',customerType,id);
|
||||
this.run('UPDATE orders SET paper_date=?,payment_account=?,fee_items=?,fees_date=?,rounding_mode=?,fee_cost_mode=? WHERE id=?',newNumber||autoNumber?date:prior?.paper_date||'',account,JSON.stringify(fees),feesDate,roundingMode,feeCostMode,id);
|
||||
this.audit(id,'保存草稿',actor,{revision:this.rawOrder(id).revision});return {id};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user