updates on the profitiability page
This commit is contained in:
@@ -286,6 +286,7 @@ export default function ProfitabilityReport() {
|
||||
let totalCost = 0;
|
||||
let profitableRiders = 0;
|
||||
let lossRiders = 0;
|
||||
let totalKms = 0;
|
||||
|
||||
const list = ridersList
|
||||
.map((r) => {
|
||||
@@ -341,6 +342,7 @@ export default function ProfitabilityReport() {
|
||||
totalOrders += ordersInSlots;
|
||||
totalRevenue += rRevenue;
|
||||
totalCost += rTotalCost;
|
||||
totalKms += rKms;
|
||||
activeRiders++;
|
||||
|
||||
return {
|
||||
@@ -368,6 +370,7 @@ export default function ProfitabilityReport() {
|
||||
totalMargin,
|
||||
profitableRiders,
|
||||
lossRiders,
|
||||
totalKms,
|
||||
enrichedRiders: list
|
||||
};
|
||||
}, [ridersList, customBatches]);
|
||||
@@ -392,6 +395,14 @@ export default function ProfitabilityReport() {
|
||||
value: stats?.activeRiders ?? 0,
|
||||
detail: `${stats?.profitableRiders ?? 0} in profit · ${stats?.lossRiders ?? 0} at loss`
|
||||
},
|
||||
{
|
||||
key: 'kms',
|
||||
label: 'Total Distance',
|
||||
color: '#10b981',
|
||||
icon: MdStraighten,
|
||||
value: `${(stats?.totalKms ?? 0).toFixed(1)} km`,
|
||||
detail: 'Cumulative travel distance'
|
||||
},
|
||||
{
|
||||
key: 'revenue',
|
||||
label: 'Slot Revenue',
|
||||
@@ -449,7 +460,7 @@ export default function ProfitabilityReport() {
|
||||
{KPI_META.map((item) => {
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
<Grid item key={item.key} xs={6} sm={6} md={3}>
|
||||
<Grid item key={item.key} xs={6} sm={4} md={2.4}>
|
||||
<StatCard
|
||||
title={item.label}
|
||||
value={item.value ?? 0}
|
||||
|
||||
Reference in New Issue
Block a user