diff --git a/src/app/admin/investors/[id]/page.tsx b/src/app/admin/investors/[id]/page.tsx index fb84a44..c2f4749 100644 --- a/src/app/admin/investors/[id]/page.tsx +++ b/src/app/admin/investors/[id]/page.tsx @@ -134,7 +134,7 @@ export default function InvestorDetailPage() { selectedBikeIds: [] as string[], totalInvestment: 0, paidAmount: 0, - paymentOption: 'full' as 'full' | 'partial', + paymentType: 'full' as 'full' | 'partial', monthlyReturn: 0, expectedRoi: 15, startDate: new Date().toISOString().split('T')[0], @@ -233,7 +233,7 @@ export default function InvestorDetailPage() { selectedBikeIds: [], totalInvestment: 0, paidAmount: 0, - paymentOption: 'full', + paymentType: 'full', monthlyReturn: 0, expectedRoi: 15, startDate: new Date().toISOString().split('T')[0], @@ -2234,7 +2234,7 @@ export default function InvestorDetailPage() { planType: plan.tier.toLowerCase() as any, totalInvestment: plan.evBasePrice * plan.minQuantity, paidAmount: plan.evBasePrice * plan.minQuantity, - paymentOption: 'full', + paymentType: 'full', monthlyReturn: 0 }); }} @@ -2301,7 +2301,7 @@ export default function InvestorDetailPage() { setNewInvestment({ ...newInvestment, totalInvestment: val, - paidAmount: newInvestment.paymentOption === 'full' ? val : Math.max(val * 0.5, newInvestment.paidAmount) + paidAmount: newInvestment.paymentType === 'full' ? val : Math.max(val * 0.5, newInvestment.paidAmount) }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm bg-yellow-50" @@ -2328,6 +2328,8 @@ export default function InvestorDetailPage() { + +

@@ -2370,6 +2372,61 @@ export default function InvestorDetailPage() { />

+
+

+ Payment Options +

+
+ + +
+ {newInvestment.paymentType === 'partial' && ( +
+ + { + const val = Number(e.target.value); + if (val >= newInvestment.totalInvestment * 0.5 && val <= newInvestment.totalInvestment) { + setNewInvestment({ ...newInvestment, paidAmount: val }); + } + }} + className="w-full px-3 py-2 border border-investor rounded-lg text-sm bg-white" + /> +

Balance: ৳{(newInvestment.totalInvestment - newInvestment.paidAmount).toLocaleString()}

+
+ )} +
+
@@ -2447,54 +2504,7 @@ export default function InvestorDetailPage() {
-
- -
- - -
- - {newInvestment.paymentOption === 'partial' && ( -
- -
- - setNewInvestment({ ...newInvestment, paidAmount: Number(e.target.value) })} - className="w-full pl-8 pr-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-investor outline-none text-sm" - /> -
-

- Remaining ৳{(newInvestment.totalInvestment - newInvestment.paidAmount).toLocaleString()} will be recorded as pending. -

-
- )} -