订单增加打印登记,支持多商品销售公式识别预填

This commit is contained in:
summer committed 2026-12-03 17:46:23 +08:00
1 parent 6cde5e6999
commit 718dbfde2c
13 files changed
+339 -15

No files matched your search

+1 -1
View File
@@ -99,6 +99,6 @@ test('HTTP内部字段保存每克料价,客户公开接口与打印页隔离
const internal=await (await call('/api/orders/'+id)).json();assert.equal(internal.lines[0].costParts.material,182654);assert.deepEqual(internal.lines[0].costMaterial,{mode:'gram',rate:91327});assert.equal(internal.profit,37346);
const publicResponse=await call('/api/orders/'+id+'/public');assert.equal(publicResponse.status,200);const customer=await publicResponse.json(),json=JSON.stringify(customer);
for(const key of ['costMaterial','costParts','costLabor','payer','profit','costDue'])assert.ok(!json.includes('"'+key+'"'));
const printResponse=await call('/print/'+id);assert.equal(printResponse.status,200);const html=await printResponse.text();assert.equal(html,receipt(customer));
const printResponse=await call('/print/'+id);assert.equal(printResponse.status,200);const html=await printResponse.text();assert.match(html,/id="confirm-document-print"/);assert.equal(html.replace(/<span id="document-print-state"[\s\S]*?(?=<button id="print")/,''),receipt(customer));
for(const secret of ['costMaterial','料费成本','进货料价','913.27','1826.54','373.46'])assert.ok(!html.includes(secret));
});