增加客户寄存料登记与置换使用,支持余额恢复
This commit is contained in:
1 parent
d0809d61a7
commit
1f1e6dd402
11 files changed
+170
-23
No files matched your search
@@ -148,3 +148,10 @@ test('逐件完整置换分别补金与退余料,整单汇总不沿用第一
|
||||
assert.equal((html.match(/data-recovery-item=/g)||[]).length,2);
|
||||
const discounted=h.calculate(h.input({...draft,discount:'5500'}));assert.equal(discounted.receivable,32000);assert.equal(discounted.netSettlement,-648000);
|
||||
});
|
||||
|
||||
test('寄存料按使用克重生成置换旧料,独立商品可混合本次来料,互不串来源',()=>{
|
||||
const h=harness(),extra={...h.draft(),new_name:'第二件',incoming_weight:'0.5',melted_weight:'0.5',new_quantity:'0.5',labor_rate:'20',cost_labor_value:'0',gold_price:'0'};
|
||||
const input=h.input({...swap,independent_products:true,old_source:'deposit',deposit_id:'synthetic-deposit',deposit_weight:'1',incoming_weight:'',melted_weight:'',new_quantity:'1',gold_price:'0',extra_products:[extra]});
|
||||
assert.equal(input.old_source,undefined);assert.equal(input.exchange.items[0].deposit_weight,'1');assert.equal(input.exchange.items[0].old_lines[0].melted_weight,'1');assert.equal(input.exchange.items[1].old_source,undefined);assert.equal(h.calculate(input).oldMg,1500);h.context.__input=input;assert.doesNotThrow(()=>h.run('validateRecoveryInput(__input)'));
|
||||
h.context.__draft=h.draft({...swap,independent_products:true});const html=h.run('recoveryFormHTML(__draft)');assert.match(html,/寄存,暂不结算/);assert.match(html,/name="old_source"/);assert.match(html,/name="deposit_id"/);assert.match(html,/name="deposit_weight"/);
|
||||
});
|
||||
Reference in new issue
Block a user