/* Payments module */ (function () { const { useState } = React; const Icon = window.Icon, PageHead = window.PageHead, LineChart = window.LineChart, BarChart = window.BarChart; const D = window.YEIDA, fmt = D.fmtINR; function Payments({ go, toast }) { const [tab, setTab] = useState('dues'); const [pay, setPay] = useState(null); // due being paid const totalDue = D.dues.reduce((s, d) => s + d.amount, 0); return (
{/* summary cards */}
{[ ['Outstanding', fmt(totalDue), 'amber', 'rupee', '3 dues pending'], ['Paid (FY 25-26)', fmt(265370), 'emerald', 'checkCircle', '5 transactions'], ['Next Due', '30 Jun', 'blue', 'calendar', 'Lease Rent 2026-27'], ['Total Premium', fmt(D.property.totalValue), 'navy', 'building', '90% paid'], ].map(([l, v, c, ic, sub]) => { const cc = { blue: ['var(--blue-50)', 'var(--blue-600)'], emerald: ['var(--emerald-50)', 'var(--emerald-700)'], amber: ['var(--amber-50)', 'var(--amber-600)'], navy: ['#e9eefb', 'var(--navy-700)'] }[c]; return (
{v}
{l}
{sub}
); })}
{/* tabs */}
{[['dues', 'Outstanding Dues'], ['history', 'Payment History'], ['receipts', 'Receipts'], ['construction', 'Construction Payments'], ['analytics', 'Financial Analytics']].map(([k, l]) => ( ))}
{tab === 'dues' && toast && toast('e-Challan generated · CH-2026-0606-18')} />} {tab === 'history' && } {tab === 'receipts' && } {tab === 'construction' && } {tab === 'analytics' && } {pay && setPay(null)} onDone={() => { setPay(null); toast && toast('Payment successful · receipt sent to email'); }} />}
); } function Dues({ onPay, onChallan }) { return (
{D.dues.map(d => ( ))}
DescriptionTypeDue DateStatusAmount
{d.label}
{d.id}
{d.type} {d.due} {d.status === 'overdue' ? 'Overdue' : d.status === 'due' ? 'Due soon' : 'Upcoming'} {fmt(d.amount)}
); } function History() { return (
{D.payments.map(p => ( ))}
TransactionDateModeChallanStatusAmount
{p.label}
{p.id}
{p.date} {p.mode} {p.challan} {p.status} {fmt(p.amount)}
); } function Receipts({ toast }) { return (
{D.payments.map(p => (
Paid
{p.label}
{p.challan} · {p.date}
{fmt(p.amount)}
))}
); } function ConstructionPayments({ toast }) { const CP = D.constructionPayments; const C = D.construction; const paid = CP.filter(p => p.status === 'Paid').reduce((s, p) => s + p.amount, 0); const upcoming = CP.filter(p => p.status !== 'Paid').reduce((s, p) => s + p.amount, 0); return (
{[['Estimated Build Cost', fmt(C.estimatedCost), 'navy', 'building'], ['Paid to Contractor', fmt(paid), 'emerald', 'checkCircle'], ['Upcoming Milestones', fmt(upcoming), 'amber', 'clock']].map(([l, v, c, ic]) => { const cc = { emerald: ['var(--emerald-50)', 'var(--emerald-700)'], amber: ['var(--amber-50)', 'var(--amber-600)'], navy: ['#e9eefb', 'var(--navy-700)'] }[c]; return (
{v}
{l}
); })}

Milestone Payments & Invoices

Contractor · {C.contractor.name}
{CP.map(p => ( ))}
MilestoneInvoiceVendorDateStatusAmount
{p.milestone} {p.id} {p.vendor} {p.date} {p.status === 'Paid' ? : null}{p.status} {fmt(p.amount)} {p.status === 'Paid' ? : }
); } function Analytics() { return (

Cumulative payments

Premium + lease rent paid since allotment

20192021202320252026

By category

Lifetime breakdown

{[['Location Premium', 82, 'var(--blue-500)'], ['Lease Rent', 11, 'var(--emerald-500)'], ['Fees & Charges', 5, 'var(--amber-500)'], ['Utilities', 2, 'var(--navy-700)']].map(([l, p, c]) => (
{l}{p}%
))}

Yearly payments

Total paid per financial year (₹ lakh)

{['19', '20', '21', '22', '23', '24', '25', '26'].map(y => FY{y})}
); } function PayModal({ due, onClose, onDone }) { const [method, setMethod] = useState('upi'); const [stage, setStage] = useState('select'); const methods = [['upi', 'UPI', 'phone'], ['card', 'Debit/Credit Card', 'payments'], ['net', 'Net Banking', 'building']]; const pay = () => { setStage('processing'); setTimeout(() => setStage('done'), 1600); }; return (
e.stopPropagation()} className="anim-pop card" style={{ width: 440, maxWidth: '100%', padding: 0, overflow: 'hidden' }}> {stage !== 'done' ? ( <>

Complete Payment

{due.label}
{fmt(due.amount)}
Payment Method
{methods.map(([k, l, ic]) => ( ))}
Secured by YEIDA Payment Gateway
) : (

Payment Successful

{fmt(due.amount)} paid · Receipt CH-2026-0606-18

)}
); } window.Payments = Payments; })();