From ce4bbfaf816770802062d3394f1652144d1c069a Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Sat, 16 May 2026 15:28:33 +0600 Subject: [PATCH] fix: include batteryRentPending in rental interface and sanitize pending rent calculation --- src/app/admin/rentals/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/admin/rentals/page.tsx b/src/app/admin/rentals/page.tsx index 7d2bf5a..d419759 100644 --- a/src/app/admin/rentals/page.tsx +++ b/src/app/admin/rentals/page.tsx @@ -36,6 +36,7 @@ interface Rental { batteryId?: string; batteryName?: string; batteryRent?: number; + batteryRentPending?: number; type: RentalType; status: RentalStatus; startDate: string; @@ -702,7 +703,7 @@ export default function RentalsPage() { ? Math.round(batteryRent / 4) : batteryRent; const totalRent = bikeRent + batteryRentAdjusted; - const due = rental.pendingRent + rental.batteryRentPending || 0; + const due = (rental.pendingRent || 0) + (rental.batteryRentPending || 0); const penalty = rental.penaltyAmount || 0; const totalDue = due + penalty; const periodLabel = rental.subscriptionType === 'daily' ? 'day' : rental.subscriptionType === 'weekly' ? 'wk' : 'mo';