fix(est): match project costs and stored formulas
This commit is contained in:
@@ -56,9 +56,11 @@ const EstRows = (() => {
|
||||
const rounded =
|
||||
num(row.Index) === 1
|
||||
? EstMath.half(quotient)
|
||||
: num(row.Index) === 2
|
||||
? Math.trunc(quotient)
|
||||
: EstMath.half(quotient + 0.5);
|
||||
: num(row.Gangub) < 1
|
||||
? quotient
|
||||
: num(row.Index) === 2
|
||||
? Math.trunc(quotient)
|
||||
: EstMath.half(quotient + 0.5);
|
||||
components.forEach((k) => (row[k] = 0));
|
||||
row[target[num(row.SCheck)] || "JC"] = rounded * step - base;
|
||||
row.TU = base;
|
||||
@@ -70,8 +72,8 @@ const EstRows = (() => {
|
||||
const values = Object.fromEntries(
|
||||
components.map((k) => [k, eligible.reduce((n, r) => n + num(r[k]), 0)]),
|
||||
);
|
||||
const kind = baseKind(row),
|
||||
sc = target[num(row.SCheck)];
|
||||
const kind = num(row.LinkIndex) === 68 ? null : baseKind(row),
|
||||
sc = num(row.LinkIndex) === 68 ? undefined : target[num(row.SCheck)];
|
||||
units.forEach((key) => (row[key] = 0));
|
||||
if (sc) row[units[components.indexOf(sc)]] = kind === "TC" ? sum(values) : num(values[kind]);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user