内部备注必填并支持快捷标签,置换结算可带入当日加权料价
This commit is contained in:
1 parent
6fe7504e52
commit
ac9073471d
30 files changed
+194
-72
No files matched your search
@@ -17,7 +17,7 @@ async function fixture(t){
|
||||
for(const [member,name] of [['owner','麦麦'],['assistant','助理1'],['assistant2','助理2']]){const result=await call(member,'/api/login',{name,password});assert.equal(result.status,200);assert.equal(result.body.user.member,member);cookies[member]=result.response.headers.get('set-cookie').split(';')[0];}
|
||||
const issue=async(member,extra={})=>{
|
||||
const account={owner:'麦麦微信',assistant:'助理微信',assistant2:'助理2微信'}[member];
|
||||
const input={date:today(),customer:'仅'+member+'可见客户',salesperson:'相同可改显示名',payment_account:account,rounding_mode:'cent',discount:'0',lines:[{name:'测试银饰',unit:'件',quantity:'1',pocket:'',payer:member,cost:'100',sale:'150'}],fee_items:[],...extra};
|
||||
const input={date:today(),customer:'仅'+member+'可见客户',internal_note:'测试内部备注',salesperson:'相同可改显示名',payment_account:account,rounding_mode:'cent',discount:'0',lines:[{name:'测试银饰',unit:'件',quantity:'1',pocket:'',payer:member,cost:'100',sale:'150'}],fee_items:[],...extra};
|
||||
const result=await call(member,'/api/orders/issue',input);assert.equal(result.status,200,JSON.stringify(result.body));return result.body.id;
|
||||
};
|
||||
return {ledger,app,call,issue,cookies};
|
||||
@@ -102,7 +102,7 @@ test('三人HTTP共享完整盘点流水但不共享结构化成本和业务详
|
||||
test('锁价、独立售后、私有同名模板、人数和审批列表都只包含本人;老板可全部复核',async t=>{
|
||||
const f=await fixture(t),d=today(),locks={},templates={},changes={},cancellations={};
|
||||
for(const self of ['assistant','assistant2']){
|
||||
const lock=await f.call(self,'/api/price-locks',{date:d,customer:self+'独有锁价客户',salesperson:'相同显示名',line:{name:'足金999',quantity:'1.000',goldPrice:'900',laborRate:'0',laborMode:'gram',pieces:'1',charges:[]},material:{rate:'850',payer:self,verified:true},payment:{amount:'900',account:self==='assistant'?'助理微信':'助理2微信',verified:true}});assert.equal(lock.status,200,JSON.stringify(lock.body));locks[self]=lock.body.id;
|
||||
const lock=await f.call(self,'/api/price-locks',{date:d,customer:self+'独有锁价客户',internal_note:'测试内部备注',salesperson:'相同显示名',line:{name:'足金999',quantity:'1.000',goldPrice:'900',laborRate:'0',laborMode:'gram',pieces:'1',charges:[]},material:{rate:'850',payer:self,verified:true},payment:{amount:'900',account:self==='assistant'?'助理微信':'助理2微信',verified:true}});assert.equal(lock.status,200,JSON.stringify(lock.body));locks[self]=lock.body.id;
|
||||
const after=await f.call(self,'/api/after-sales',{date:d,project:self+'独有售后项目',customer:self+'独有售后客户',amount:'5',payer:self});assert.equal(after.status,200,JSON.stringify(after.body));
|
||||
const template=await f.call(self,'/api/order-templates',{name:'双方独立同名模板',preset:{lines:[{name:'银饰',unit:'件',quantity:'1',pocket:'',payer:self,cost:'2',sale:'3'}],fee_items:[]}});assert.equal(template.status,200,JSON.stringify(template.body));templates[self]=template.body.id;
|
||||
const id=await f.issue(self,{customer:self+'审批客户'}),edit=(await f.call(self,'/api/orders/'+id+'/edit')).body;
|
||||
|
||||
Reference in new issue
Block a user