Compare commits

..

No commits in common. "5098bf86f4f67a0e2aac2ac318bfb16a5a5df576" and "35cfc409e268900c3e8261c9864bfe41b9852969" have entirely different histories.

2 changed files with 13 additions and 28 deletions

View file

@ -683,13 +683,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) {
const solarTotalCr = computeCostWithTax(costItems, "SolarOnly");
const windTotalCr = computeCostWithTax(costItems, "WindOnly");
const bessTotalCr = computeCostWithTax(costItems, "BESSOnly");
// 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;
const totalCostCr = solarTotalCr + windTotalCr + bessTotalCr;
// COD sync helper
function handlePlantCodChange(v: string) {
@ -987,7 +981,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) {
<NumField
label="Lease Rate"
sub="Lakh/acre/year"
value={leaseRate}
value={gv(inputs, "project", "land_lease_rate", 0.4)}
onChange={(v) => upd("project", "land_lease_rate", v)}
step={0.05}
min={0}
@ -996,7 +990,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) {
<NumField
label="Lease Years"
sub="3, 5, 10 or custom"
value={leaseYears}
value={gv(inputs, "project", "land_lease_years", 5)}
onChange={(v) => upd("project", "land_lease_years", v)}
step={1}
min={1}
@ -1004,7 +998,7 @@ export function InputsTab({ scenarioId, inputsJson, onSaved }: Props) {
suffix="yr"
/>
<div className="col-span-3 text-[10px] text-muted-foreground py-1">
Upfront Lease Cost (included in Total Project Cost): <span className="font-medium text-foreground">{upfrontLeaseCostCr.toFixed(2)} Cr</span>
Upfront Lease Cost: <span className="font-medium text-foreground">{effectiveLandAcres * (gv(inputs, "project", "land_lease_rate", 0.4) || 0) * (gv(inputs, "project", "land_lease_years", 5) || 0)} Cr</span>
</div>
</CollapsibleCard>

View file

@ -4,11 +4,6 @@ import { useState } from "react";
import { Button } from "@/components/ui/button";
import type { ScenarioInputPayload } from "@/lib/api";
// Helper to convert decimal to percentage display
function pct(raw: number): number {
return parseFloat((raw * 100).toFixed(2));
}
const LOCATION_OPTIONS = [
{ value: "RJ", label: "Rajasthan (High Solar)" },
{ value: "GJ", label: "Gujarat (High Solar)" },
@ -364,18 +359,14 @@ function StepSolver({
/>
</Field>
{state.solver_mode === "solve_tariff" ? (
<Field label="Target Equity IRR">
<div className="flex items-center gap-1.5">
<Field label="Target Equity IRR (e.g. 0.18 = 18%)">
<Input
type="number"
value={pct(state.target_irr)}
step={1}
min={5}
max={40}
onChange={(v) => set("target_irr", Number(v) / 100)}
value={state.target_irr}
step={0.01}
min={0.05}
onChange={(v) => set("target_irr", Number(v))}
/>
<span className="text-sm text-muted-foreground">%</span>
</div>
</Field>
) : (
<Field label="Fixed Tariff (INR/kWh)">