将助理成员显示名称统一为娜娜和小昊
This commit is contained in:
1 parent
f4ac7502d3
commit
518513e630
28 files changed
+120
-96
No files matched your search
@@ -36,7 +36,7 @@ test('打开单据即显示截图中的销售计算、附加收费、整单取
|
||||
assert.match(profit,/成交金额 ¥753\.00 − 成本合计 ¥571\.44 = 实际订单利润 ¥181\.56/);
|
||||
assert.equal((costs.match(/<td>料费成本/g)||[]).length,1);assert.doesNotMatch(html,/商品与成本|按付款人汇总成本|零元包装|<td>配件成本|<td>其他货品成本/);
|
||||
assert.match(html,/<div id="detail-form"/);assert.match(html,/<div id="detail-error"/);assert.match(html,/data-action="print"/);assert.match(html,/data-action="show-return"/);
|
||||
assert.match(html,/<details class="panel detail-settlement"><summary>与助理的结算/);assert.match(html,/<summary>收退款与费用记录/);assert.match(html,/<summary>商品来源与原始说明/);
|
||||
assert.match(html,/<details class="panel detail-settlement"><summary>与娜娜的结算/);assert.match(html,/<summary>收退款与费用记录/);assert.match(html,/<summary>商品来源与原始说明/);
|
||||
});
|
||||
|
||||
test('详情审批印章仅认可当前已复核版本,待审批与历史批准不冒充整单已审批',()=>{
|
||||
@@ -96,10 +96,10 @@ test('已核实的全零成本与缺失成本明确区分,零费用和零预
|
||||
|
||||
test('付款人小计只加有效已记账成本,零付款人省略,缺成本的非零小计标已知',()=>{
|
||||
const subtotals=html=>html.match(/<p class="detail-cost-payer-totals"[^>]*>([\s\S]*?)<\/p>/)?.[1]||'';
|
||||
const normal=text(subtotals(render().html));assert.match(normal,/付款人合计麦麦 ¥556\.14助理 ¥15\.30/);assert.doesNotMatch(normal,/已知/);
|
||||
const normal=text(subtotals(render().html));assert.match(normal,/付款人合计麦麦 ¥556\.14娜娜 ¥15\.30/);assert.doesNotMatch(normal,/已知/);
|
||||
const missing=order({goodsCost:null,knownGoodsCost:930,profit:null,lines:[line({cost:null,costParts:{material:null,labor:930,accessories:0,other:0}})]});
|
||||
const partial=text(subtotals(render(missing).html));assert.match(partial,/付款人合计(已知)助理 ¥15\.30/);assert.doesNotMatch(partial,/麦麦/);
|
||||
const returned=text(subtotals(render(order({status:'returned',profit:-600})).html));assert.equal(returned,'付款人合计助理 ¥6.00');
|
||||
const partial=text(subtotals(render(missing).html));assert.match(partial,/付款人合计(已知)娜娜 ¥15\.30/);assert.doesNotMatch(partial,/麦麦/);
|
||||
const returned=text(subtotals(render(order({status:'returned',profit:-600})).html));assert.equal(returned,'付款人合计娜娜 ¥6.00');
|
||||
assert.equal(subtotals(render(order({...withoutFees,lines:[zeroLine()],goodsCost:0,profit:75300})).html),'');
|
||||
});
|
||||
|
||||
@@ -114,14 +114,14 @@ test('日购料按整行实际耗用金额呈现,付款人分摊不冒充整
|
||||
const pooled=line({quantity:2000,goldPrice:100000,laborRate:10000,baseSale:220000,sale:220000,charges:[],cost:190000,costParts:{material:190000,labor:0,accessories:0,other:0},costMaterial:{mode:'pool',poolId:D},materialPool:{revision:4,averageRate:95000,allocations:[{payer:'owner',amount:80000},{payer:'assistant',amount:110000}]}});
|
||||
const html=render(order({...withoutFees,lines:[pooled],goodsCost:190000,total:220000,rounding_mode:'cent',rounding_adjustment:0,profit:30000})).html,costs=panel(html,'成本明细与付款人');
|
||||
assert.equal((costs.match(/<td>料费成本/g)||[]).length,1);assert.match(costs,/耗用 2\.000g · 加权均价约 950\.00元\/克;按实际购料分摊/);
|
||||
assert.match(costs,/麦麦 ¥800\.00<br>助理 ¥1,100\.00/);assert.match(costs,/class="number">¥1,900\.00/);assert.doesNotMatch(costs,/2\.000g ×|= ¥800\.00|= ¥1,100\.00/);
|
||||
assert.match(costs,/<span>麦麦 <b>¥800\.00<\/b><\/span><span>助理 <b>¥1,100\.00/);
|
||||
assert.match(costs,/麦麦 ¥800\.00<br>娜娜 ¥1,100\.00/);assert.match(costs,/class="number">¥1,900\.00/);assert.doesNotMatch(costs,/2\.000g ×|= ¥800\.00|= ¥1,100\.00/);
|
||||
assert.match(costs,/<span>麦麦 <b>¥800\.00<\/b><\/span><span>娜娜 <b>¥1,100\.00/);
|
||||
});
|
||||
|
||||
test('加权均价取整与累计分币差额保留实际金额,不由展示均价重算料费',()=>{
|
||||
const pooled=zeroLine({quantity:1001,cost:33367,costParts:{material:33367,labor:0,accessories:0,other:0},costMaterial:{mode:'pool',poolId:D},materialPool:{averageRate:33333,allocations:[{payer:'owner',amount:16683},{payer:'assistant',amount:16684}]}});
|
||||
const costs=panel(render(order({...withoutFees,lines:[pooled],goodsCost:33367,profit:41933})).html,'成本明细与付款人');
|
||||
assert.match(costs,/均价约 333\.33元\/克/);assert.match(costs,/¥333\.67/);assert.match(costs,/麦麦 ¥166\.83<br>助理 ¥166\.84/);assert.doesNotMatch(costs,/¥333\.66/);
|
||||
assert.match(costs,/均价约 333\.33元\/克/);assert.match(costs,/¥333\.67/);assert.match(costs,/麦麦 ¥166\.83<br>娜娜 ¥166\.84/);assert.doesNotMatch(costs,/¥333\.66/);
|
||||
});
|
||||
|
||||
test('锁价原料与补重分段保留真实克重、单价、付款人及料费合计',()=>{
|
||||
@@ -129,7 +129,7 @@ test('锁价原料与补重分段保留真实克重、单价、付款人及料
|
||||
{source:'original',payer:'owner',quantity:3000,rate:85000,amount:255000},{source:'extra',payer:'assistant',quantity:200,rate:90000,amount:18000}]});
|
||||
const costs=panel(render(order({...withoutFees,price_lock_id:'lock',lines:[locked],goodsCost:273000,total:320000,rounding_mode:'cent',rounding_adjustment:0,profit:47000})).html,'成本明细与付款人');
|
||||
assert.match(costs,/原锁料费/);assert.match(costs,/3\.000g × 850\.00元\/克/);assert.match(costs,/补重料费/);assert.match(costs,/0\.200g × 900\.00元\/克/);assert.match(costs,/¥2,550\.00 + ¥180\.00 = <strong>¥2,730\.00/);
|
||||
assert.match(costs,/麦麦/);assert.match(costs,/助理/);
|
||||
assert.match(costs,/麦麦/);assert.match(costs,/娜娜/);
|
||||
});
|
||||
|
||||
test('退货与取消显示冲回后的净额,原料费收起保留且不混入成本合计',()=>{
|
||||
|
||||
Reference in new issue
Block a user