diff --git a/src/app/admin/rentals/page.tsx b/src/app/admin/rentals/page.tsx
index 97a25be..d73893f 100644
--- a/src/app/admin/rentals/page.tsx
+++ b/src/app/admin/rentals/page.tsx
@@ -584,9 +584,9 @@ export default function RentalsPage() {
Bike |
User |
Type |
- Subscription |
Hub |
Deposit |
+ {/* Subscription | */}
Rent Payment |
Status |
Actions |
@@ -627,9 +627,6 @@ export default function RentalsPage() {
{typeBadge.label}
-
- {rental.subscriptionType}
- |
{rental.hubName}
|
@@ -641,25 +638,32 @@ export default function RentalsPage() {
-
- {(paymentBadge.pendingRent && paymentBadge.pendingRent > 0) ? (
-
-
- Pending
-
- ৳{paymentBadge.pendingRent} ({paymentBadge.pendingRentDays}d)
-
- ) : (
-
- Clear
-
- )}
- |
{/*
-
- {penaltyBadge.label}
-
+ {rental.subscriptionType}
| */}
+
+ {(() => {
+ const rent = rental[rental.subscriptionType === 'daily' ? 'dailyRate' : rental.subscriptionType === 'weekly' ? 'weeklyRate' : 'monthlyRate'];
+ const due = rental.pendingRent || 0;
+ const penalty = rental.penaltyAmount || 0;
+ const totalDue = due + penalty;
+ if (totalDue > 0) {
+ return (
+
+ ৳{totalDue.toLocaleString()}
+ {rental.subscriptionType} ৳{rent}/{(rental.subscriptionType === 'daily' ? 'day' : rental.subscriptionType === 'weekly' ? 'wk' : 'mo')}
+ {penalty > 0 && +৳{penalty} penalty}
+
+ );
+ }
+ return (
+
+ ৳{rent.toLocaleString()}
+ {rental.subscriptionType}
+
+ );
+ })()}
+ |
{statusBadge.label}
@@ -698,8 +702,11 @@ export default function RentalsPage() {
{filteredRentals.map(rental => {
const statusBadge = getStatusBadge(rental.status);
- const paymentBadge = getPaymentStatusBadge(rental.paymentStatus, rental.pendingRent, rental.pendingRentDays);
const typeBadge = getTypeBadge(rental.type);
+ const rent = rental[rental.subscriptionType === 'daily' ? 'dailyRate' : rental.subscriptionType === 'weekly' ? 'weeklyRate' : 'monthlyRate'];
+ const due = rental.pendingRent || 0;
+ const penalty = rental.penaltyAmount || 0;
+ const totalDue = due + penalty;
return (
@@ -744,14 +751,17 @@ export default function RentalsPage() {
{rental.depositPaid ? 'Paid' : 'Unpaid'}
- {(paymentBadge.pendingRent && paymentBadge.pendingRent > 0) ? (
-
- ৳{paymentBadge.pendingRent}
-
+ {totalDue > 0 ? (
+
+ ৳{totalDue.toLocaleString()}
+ {rental.subscriptionType} ৳{rent}/{(rental.subscriptionType === 'daily' ? 'day' : rental.subscriptionType === 'weekly' ? 'wk' : 'mo')}
+ {penalty > 0 && +৳{penalty}}
+
) : (
-
- Clear
-
+
+ ৳{rent.toLocaleString()}
+ {rental.subscriptionType}
+
)}
|