feat(est): print annual allocations
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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: "금액",
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user