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,
};