新增锁价与每日购料管理
支持锁价交付、每日加权成本、购料修改与软删除,完善付款归属、结算及利润重算。 244项测试和隔离浏览器验收通过;记录尚未实施的剩料跨日结转与当天资金结清需求。
This commit is contained in:
1 parent
42d75a4968
commit
20bf6e7d24
23 files changed
+2330
-101
No files matched your search
@@ -88,7 +88,7 @@ test('HTTP开单接口受登录和CSRF保护,并发重试只记一次交付,
|
||||
t.after(async()=>{await new Promise(r=>app.server.close(r));app.ledger.close();fs.rmSync(dir,{recursive:true,force:true});});
|
||||
const base='http://127.0.0.1:'+app.server.address().port;let cookie='';
|
||||
const call=(route,data,key=randomUUID(),origin=base)=>fetch(base+route,{method:data?'POST':'GET',headers:{Cookie:cookie,...(data?{'Content-Type':'application/json',Origin:origin,'X-Requested-With':'maimai-ledger','Idempotency-Key':key}:{})},...(data?{body:JSON.stringify(data)}:{})});
|
||||
const p=input(),before=app.ledger.rows('SELECT * FROM orders').length;
|
||||
const p=input({date:app.ledger.orderBook().today}),before=app.ledger.rows('SELECT * FROM orders').length;
|
||||
assert.equal((await call('/api/orders/issue',p)).status,401);
|
||||
const login=await call('/api/demo-login',{role:'assistant'});cookie=login.headers.get('set-cookie').split(';')[0];
|
||||
assert.equal((await call('/api/orders/issue',p,randomUUID(),'https://invalid.example')).status,403);
|
||||
|
||||
Reference in new issue
Block a user