fix: Correct Total Hard Cost calculation - use baseHardCost for financing costs
Some checks are pending
CI / Engine — lint / typecheck / test (push) Waiting to run
CI / API — lint / typecheck / test (push) Waiting to run
CI / Web — typecheck / lint / build (push) Waiting to run

- Remove DSRA from Total Hard Cost (it's a financing reserve, not capital cost)
- Use baseHardCost instead of inflated totalCostCr for financing calculations
- DSRA shown separately after Total Hard Cost
This commit is contained in:
Manohar Gupta 2026-05-29 17:52:19 +05:30
parent dfa5ae36d8
commit e920fa6f71

View file

@ -805,18 +805,24 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) {
const idcRate = gv(inputs, "capex", "interest_rate_annual", 0.09); const idcRate = gv(inputs, "capex", "interest_rate_annual", 0.09);
const constrMonths = gv(inputs, "capex", "construction_months", 24); const constrMonths = gv(inputs, "capex", "construction_months", 24);
const debtFrac = gv(inputs, "capex", "debt_fraction", 0.75); const debtFrac = gv(inputs, "capex", "debt_fraction", 0.75);
const idcCost = totalCostCr * debtFrac * idcRate * constrMonths / 12;
const upfrontPct = gv(inputs, "capex", "upfront_fee_pct", 0.01); const upfrontPct = gv(inputs, "capex", "upfront_fee_pct", 0.01);
const upfrontCost = totalCostCr * debtFrac * upfrontPct;
const bankGuaranteePct = gv(inputs, "capex", "bank_guarantee_pct", 0.001); const bankGuaranteePct = gv(inputs, "capex", "bank_guarantee_pct", 0.001);
const bankGuaranteeCost = totalCostCr * bankGuaranteePct;
// DSRA (Debt Service Reserve Account) - typically 1-2 months of debt service // DSRA (Debt Service Reserve Account) - typically 1-2 months of debt service
const dsraMonths = gv(inputs, "capex", "dsra_months", 2); const dsraMonths = gv(inputs, "capex", "dsra_months", 2);
const annualDebtService = totalCostCr * debtFrac * 0.12; // approximate annual debt service
// First compute base hard cost without financing items
const baseHardCost = solarModule + solarBOS + windWTG + solarLandCost + windLandCost + bessAll + solarEPC + windEPC + epcMarginWTG + epcMarginSolarBOS + solarCont + windCont;
// Financing costs are based on base hard cost
const idcCost = baseHardCost * debtFrac * idcRate * constrMonths / 12;
const upfrontCost = baseHardCost * debtFrac * upfrontPct;
const bankGuaranteeCost = baseHardCost * bankGuaranteePct;
// DSRA: 2 months of debt service reserve (based on base hard cost)
const annualDebtService = baseHardCost * debtFrac * 0.12; // approximate annual debt service at 12% rate
const dsraCost = annualDebtService * dsraMonths / 12; const dsraCost = annualDebtService * dsraMonths / 12;
// Compute Total Hard Cost (sum of all component costs before financing) // Compute Total Hard Cost (sum of all component costs before financing)
const totalHardCost = solarModule + solarBOS + windWTG + solarLandCost + windLandCost + bessAll + dsraCost + solarEPC + windEPC + epcMarginWTG + epcMarginSolarBOS + solarCont + windCont; const totalHardCost = baseHardCost;
return ( return (
<div className="border border-border rounded-lg overflow-hidden"> <div className="border border-border rounded-lg overflow-hidden">