From 5512b020700c2f32435f3fa98ac770402582aab9 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 31 Oct 2025 23:56:20 +0000 Subject: [PATCH] minor styling --- .../temp-reporting/ProjectProposal.tsx | 18 +++++++++--------- .../[slug]/(portfolio)/temp-reporting/utils.ts | 11 ++++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/app/portfolio/[slug]/(portfolio)/temp-reporting/ProjectProposal.tsx b/src/app/portfolio/[slug]/(portfolio)/temp-reporting/ProjectProposal.tsx index 3a0be4e0..7dbffd19 100644 --- a/src/app/portfolio/[slug]/(portfolio)/temp-reporting/ProjectProposal.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/temp-reporting/ProjectProposal.tsx @@ -74,9 +74,9 @@ export function ProjectProposal({ plans }: { plans: any[] }) { : null; return ( -
+
{/* Chart */} - + Homes by Work Type @@ -112,7 +112,7 @@ export function ProjectProposal({ plans }: { plans: any[] }) { {/* Metrics */} - + {mappedTitles[selectedType || "default"]} @@ -135,19 +135,19 @@ export function ProjectProposal({ plans }: { plans: any[] }) {

Funding

-

+

£{formatNumber(selectedData?.totalFunding || 0)}

Carbon

-

+

{((selectedData?.totalCarbon || 0) * 1000).toFixed(2)} kgCO₂e

Bills

-

+

£{formatNumber(selectedData?.totalBills || 0)}

@@ -185,13 +185,13 @@ export function DashboardSummary({ plans }: { plans: any[] }) { { title: "Carbon Savings", value: `${(totalCarbon * 1000).toFixed(2)} kgCO₂e`, - subtitle: "Your projects’ total estimated CO₂e savings.", + subtitle: "Your projects’ total estimated CO₂e savings, per year.", icon: Leaf, }, { title: "Bill Savings", value: `£${formatNumber(totalBills)}`, - subtitle: "Expected total bill reductions across all homes.", + subtitle: "Expected total bill reductions across all homes, per year.", icon: Zap, }, { @@ -237,7 +237,7 @@ export function DashboardSummary({ plans }: { plans: any[] }) { -
+
{c.value}

{c.subtitle}

diff --git a/src/app/portfolio/[slug]/(portfolio)/temp-reporting/utils.ts b/src/app/portfolio/[slug]/(portfolio)/temp-reporting/utils.ts index 8adb9074..70b1cb54 100644 --- a/src/app/portfolio/[slug]/(portfolio)/temp-reporting/utils.ts +++ b/src/app/portfolio/[slug]/(portfolio)/temp-reporting/utils.ts @@ -14,6 +14,7 @@ export interface PlanWithTotals extends Record { postcode: string | null; fundingScheme: string | null; totalFunding: number | null; + totalUplift: number | null; totalCarbonSavings: number | null; totalBillSavings: number | null; totalRecommendationCost?: number | null; @@ -36,6 +37,7 @@ export async function getPlansWithTotals( p.postcode AS "postcode", fp.scheme AS "fundingScheme", COALESCE(fp.project_funding, 0) AS "totalFunding", + COALESCE(fp.total_uplift, 0) AS "totalUplift", COALESCE(SUM(r.co2_equivalent_savings), 0) AS "totalCarbonSavings", COALESCE(SUM(r.energy_cost_savings), 0) AS "totalBillSavings", COALESCE(SUM(r.estimated_cost), 0) AS "totalRecommendationCost" @@ -67,7 +69,8 @@ export async function getPlansWithTotals( p.address, p.postcode, fp.scheme, - fp.project_funding + fp.project_funding, + fp.total_uplift ORDER BY pl.created_at DESC; `); @@ -79,13 +82,15 @@ export async function getPlansWithTotals( : DOMNA_COST_MAP.default; const totalCost = plan.totalRecommendationCost ?? 0; - const funding = plan.totalFunding ?? 0; + const funding = (plan.totalFunding ?? 0) + (plan.totalUplift ?? 0); + const uplift = plan.totalUplift ?? 0; - const rawContribution = totalCost + surveyCost - funding; + const rawContribution = totalCost + surveyCost - funding - uplift; const clientContribution = rawContribution > 0 ? rawContribution : 0; return { ...plan, + totalFunding: funding, // overwrite surveyCost, clientContribution, };