每日对账展示料池耗用公式与麦麦垫付成本明细
This commit is contained in:
1 parent
9893ecf037
commit
a72f4a276e
7 files changed
+139
-3
No files matched your search
@@ -20,6 +20,7 @@ function reportForFunds(funds){
|
||||
const owned={member,name:member==='owner'?'麦麦':'助理',...funds.ownerReceipts,items,accounts:items.length?[{account:'麦麦微信',recipient:'owner',channel:'wechat',...funds.ownerReceipts,entryCount:items.length}]:[]};
|
||||
const ownershipReceipts={owner:owned,assistant:{member:'assistant',name:'助理',receipt:0,refund:0,net:0,accounts:[],items:[]}};
|
||||
const ownershipBusiness=Object.fromEntries(Object.entries(ownershipReceipts).map(([member,person])=>[member,{member,name:person.name,basis:'orderDate',from:funds.from,date:funds.date,sales:0,netReceipts:person.net,totalCost:0,knownTotalCost:0,selfCost:0,knownSelfCost:0,otherCost:0,knownOtherCost:0,profit:0,knownProfit:0,incomplete:false,missingCostCount:0,pendingCostCount:0,unknownProfitCount:0,draftCount:0,recordCount:0,orderCount:0,afterSaleCount:0,hasActivity:person.items.length>0,costByPayer:Object.fromEntries(['owner','assistant','assistant2'].map(key=>[key,{member:key,name:key,totalCost:0,knownTotalCost:0,missingCount:0,pendingCount:0}])),difference:{amount:person.net,reconciled:person.net===0,reasons:[]},equation:{basis:'sales',revenue:0,totalCost:0,profit:0,complete:true},settlement:{available:false,basis:'cumulative-through-date',from:funds.from,date:funds.date,dueOut:null,dueIn:null,partial:false,pendingCount:0,legacyCount:0,notice:'旧双人结算请核对原单。',counterparts:[]}}]));
|
||||
for(const b of Object.values(ownershipBusiness))b.poolMaterial={mg:0,amount:0,knownAmount:0,missingCount:0,hasPriceLocks:false,byPayer:Object.fromEntries(['owner','assistant','assistant2'].map(key=>[key,{amount:0,knownAmount:0}])),days:[],otherCosts:{amount:0,knownAmount:0}};
|
||||
return {basis:'orderDate',date:funds.date,from:funds.from,summary:{orderCount:0,completedCount:0,returnedCount:0,cancelledCount:0,draftCount:0,afterSaleCount:0,sale:0,profit:0,totalCost:0,missingCosts:0},orderRows:[],accounts:[],receiptsByOrderDate:funds.ownerReceipts,recipientReceipts,ownershipReceipts,ownershipBusiness,payerCosts:{owner:cost('麦麦'),assistant:cost('助理')},goods:0,expense:0,inventory:[],unsettled:[],warnings:[],customerBalance:0,settlementDue:0,close:null,dailyFunds:funds};
|
||||
}
|
||||
function attrs(tag){const result={};for(const match of tag.matchAll(/([\w-]+)="([^"]*)"/g))result[match[1]]=match[2].replace(/"/g,'"').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');return result;}
|
||||
|
||||
Reference in new issue
Block a user