fix(est): match prior unnamed cost codes

This commit is contained in:
2026-11-07 02:38:42 +09:00
parent c03929e369
commit 19097b7255
3 changed files with 33 additions and 5 deletions
@@ -121,3 +121,22 @@ def test_progress_preserves_zero_wonga_total_and_falls_back_only_when_absent():
assert result["zero"]["rows"][0]["GumTC"] == 200
assert result["zero"]["total"] == 0
assert result["absent"]["total"] == 200
def test_progress_preserves_prior_costs_for_multiple_blank_codes():
result = run(
"math",
"""(()=>{
const p=EstNative.empty();p.options.SourceRefresh=false;
p.tables.EstMainDat=[{PkID:1,Code:'R',GN:10,GU:100,NU:50},{LinkIndex:54}];
p.tables.Wonga=[{Gubun:'',Name:'material',BaseField:'GC'},
{Gubun:'',Name:'labor',BaseField:'NC'}];
p.progress=[{id:'one',inputs:{'1':{Gum:2}}}];
const q=EstProgress.lock(EstNative.calculate(p),'one');
q.progress.push({id:'two',inputs:{'1':{Gum:3}}});
return EstProgress.calculate(q,'two');
})()""",
)
assert result["errors"] == []
assert [row["JunCost"] for row in result["costs"]] == [200, 100]
assert [row["TotalCost"] for row in result["costs"]] == [500, 250]