fix(stmate-test): resolve 5 UI/calculation issues found during browser control verification
This commit is contained in:
@@ -327,7 +327,10 @@ const StmateCalc = (() => {
|
||||
});
|
||||
const directT = directM + directL + directS,
|
||||
govCombinedRaw = govRawTotal + govFeeTotal;
|
||||
const totals = { directM, directL, directS, directT, govRawTotal, govFeeTotal, govCombinedRaw };
|
||||
const totals = Object.assign(
|
||||
{ directM, directL, directS, directT },
|
||||
{ govRawTotal, govMatTotal: govRawTotal, govFeeTotal, govCombinedRaw },
|
||||
);
|
||||
return Object.assign({ rows, directTotal: directT, totals }, totals);
|
||||
}
|
||||
|
||||
@@ -348,7 +351,7 @@ const StmateCalc = (() => {
|
||||
const truncAmt = truncInd(rawCalcAmt);
|
||||
const base = Object.assign(
|
||||
{ key: code, code, label, formula: baseDesc },
|
||||
{ baseDesc, baseAmt, rate: ratePct, ratePct },
|
||||
{ baseDesc, baseAmt, base: baseAmt, rate: ratePct, ratePct },
|
||||
);
|
||||
if (!origKanjubRes) return Object.assign(base, { amount: truncAmt, modeUsed: "원설계" });
|
||||
const origRow = origKanjubRes.itemMap[code],
|
||||
@@ -507,6 +510,7 @@ const StmateCalc = (() => {
|
||||
["label", label],
|
||||
["formula", formula],
|
||||
["baseAmt", baseAmt],
|
||||
["base", baseAmt],
|
||||
["rate", rate],
|
||||
["amount", amount],
|
||||
]);
|
||||
@@ -658,8 +662,19 @@ const StmateCalc = (() => {
|
||||
kanjubOrig = calcKanjub(data, boqOrig, null);
|
||||
const boqRev = calcBoq(data, resources.map, machines.map, sanCal.map, ilwi.map, true),
|
||||
kanjubRev = calcKanjub(data, boqRev, kanjubOrig);
|
||||
const revMap = Object.fromEntries((boqRev.rows || []).map((r) => [r.id, r]));
|
||||
(boqOrig.rows || []).forEach((r) => {
|
||||
const rv = revMap[r.id];
|
||||
r.changedTAmt = rv ? rv.tAmt : r.tAmt;
|
||||
r.diffTAmt = r.changedTAmt - r.tAmt;
|
||||
});
|
||||
const base = { resources, machines, sanCal, ilwi, boqOrig, kanjubOrig };
|
||||
Object.assign(base, { boqRev, kanjubRev, resList: resources.list });
|
||||
Object.assign(base, {
|
||||
boqRev,
|
||||
kanjubRev,
|
||||
resList: resources.list,
|
||||
revComputed: { revBoq: boqRev, revKj: kanjubRev },
|
||||
});
|
||||
return Object.assign(base, { boqComputed: boqOrig, kanjubComputed: kanjubOrig });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user