From 5098bf86f4f67a0e2aac2ac318bfb16a5a5df576 Mon Sep 17 00:00:00 2001 From: Manohar Gupta Date: Fri, 22 May 2026 16:57:29 +0530 Subject: [PATCH] Fix Total Project Cost calculation: include upfront lease cost - Added upfrontLeaseCostCr to totalCostCr calculation - IDC and upfront fee now calculated on full project cost including lease - Updated Land & Common card to show lease cost is included in total --- packages/web/components/InputsTab.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/web/components/InputsTab.tsx b/packages/web/components/InputsTab.tsx index 2d2119f..ccbb284 100644 --- a/packages/web/components/InputsTab.tsx +++ b/packages/web/components/InputsTab.tsx @@ -683,7 +683,13 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) { const solarTotalCr = computeCostWithTax(costItems, "SolarOnly"); const windTotalCr = computeCostWithTax(costItems, "WindOnly"); const bessTotalCr = computeCostWithTax(costItems, "BESSOnly"); - const totalCostCr = solarTotalCr + windTotalCr + bessTotalCr; + + // Calculate upfront lease cost based on user inputs (acres * rate * years) + const leaseRate = gv(inputs, "project", "land_lease_rate", 0.4); + const leaseYears = gv(inputs, "project", "land_lease_years", 5); + const upfrontLeaseCostCr = effectiveLandAcres * leaseRate * leaseYears; + + const totalCostCr = solarTotalCr + windTotalCr + bessTotalCr + upfrontLeaseCostCr; // COD sync helper function handlePlantCodChange(v: string) { @@ -967,7 +973,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) { - {/* ── Land & Common ────────────────────────────────────── */} + {/* ── Land & Common ────────────────────────────────────── */} upd("project", "land_lease_rate", v)} step={0.05} min={0} @@ -990,7 +996,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) { upd("project", "land_lease_years", v)} step={1} min={1} @@ -998,7 +1004,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) { suffix="yr" />
- Upfront Lease Cost: {effectiveLandAcres * (gv(inputs, "project", "land_lease_rate", 0.4) || 0) * (gv(inputs, "project", "land_lease_years", 5) || 0)} Cr + Upfront Lease Cost (included in Total Project Cost): {upfrontLeaseCostCr.toFixed(2)} Cr