diff --git a/resources/tester/test_est_documents.py b/resources/tester/test_est_documents.py index df5c810cd..f4d4cfe52 100644 --- a/resources/tester/test_est_documents.py +++ b/resources/tester/test_est_documents.py @@ -1,6 +1,24 @@ from test_est_rea_parity import run +def test_annual_print_contains_each_stage_and_calculation_errors(): + result = run( + "math", + """(()=>{ + const p=EstNative.empty();p.options.SourceRefresh=false; + p.tables.EstMainDat=[{PkID:1,Code:'R',GN:3,GU:100},{LinkIndex:54}]; + p.annual=[{name:'first',formula:'[기준]*0.25'},{name:'second',formula:'[기준]-[first]'}]; + const q=EstNative.calculate(p), good=EstForms.data('annual-summary',q); + q.annual[0].formula='[unknown]'; + return {good,bad:EstForms.data('annual-summary',q)}; + })()""", + ) + assert [row["directCost"] for row in result["good"]["rows"]] == [75, 225] + assert result["good"]["rows"][1]["formula"] == "[기준]-[first]" + assert result["good"]["errors"] == [] + assert result["bad"]["errors"] + + def test_progress_and_escalation_print_use_selected_calculations(): result = run( "math", diff --git a/tools/est-test/native-forms.js b/tools/est-test/native-forms.js index b4b6fdf1f..8bebdeb26 100644 --- a/tools/est-test/native-forms.js +++ b/tools/est-test/native-forms.js @@ -1,6 +1,19 @@ const EstForms = (() => { const common = ["Code", "Name", "Size", "Unite"]; function data(id, project, state = {}) { + if (id === "annual-summary") { + const output = EstBusiness.annual(project, false); + return { + columns: ["Name", "formula", "directCost", "contractCost"], + rows: project.annual.map((year, index) => ({ + Name: year.name, + formula: year.formula, + directCost: output.results[index]?.project.calculation.direct.TC, + contractCost: output.results[index]?.project.calculation.total, + })), + errors: output.errors, + }; + } if (id === "progress-summary") { const round = project.progress.find((item) => item.id === state.roundId) || project.progress.at(-1); @@ -241,6 +254,8 @@ const EstForms = (() => { EGC: "재료비 증감", EJC: "경비 증감", ESC: "산출경비 증감", + directCost: "순공사비", + contractCost: "도급액", TargetCode: "연결 내역", TU: "단가", TC: "금액", diff --git a/tools/est-test/native-report.js b/tools/est-test/native-report.js index b3cb70ccb..6de74e170 100644 --- a/tools/est-test/native-report.js +++ b/tools/est-test/native-report.js @@ -133,6 +133,7 @@ const EstReport = (() => { catalog.push( { Index: "progress-summary", Name: "기성 내역서", Name2: "기성 내역서" }, { Index: "escalation-summary", Name: "물가변동 내역서", Name2: "물가변동 내역서" }, + { Index: "annual-summary", Name: "연차 배분표", Name2: "연차 배분표" }, ); const table = EstApp.state.project.tables[EstApp.state.view]; const s = setting(),