small fix on the profitablity page

This commit is contained in:
2026-06-16 20:04:59 +05:30
parent b0bb2d63cf
commit 3442e61bd0

View File

@@ -64,7 +64,7 @@ function calcRiderMetrics(rider) {
} }
const varCost = kms * VARIABLE_RATE_KM; const varCost = kms * VARIABLE_RATE_KM;
const fixedCost = FIXED_COST_PER_SLOT; const fixedCost = orders.length > 0 ? FIXED_COST_PER_SLOT : 0;
const totalCost = varCost + fixedCost; const totalCost = varCost + fixedCost;
const net = revenue - totalCost; const net = revenue - totalCost;
const margin = revenue > 0 ? (net / revenue) * 100 : 0; const margin = revenue > 0 ? (net / revenue) * 100 : 0;