Fix payment discrepancy column

This commit is contained in:
Roba Boru
2026-07-20 16:55:09 +03:00
parent 8f0eb0c48b
commit c71f4df6a1

View File

@@ -59,6 +59,10 @@ interface DiscrepancyReport {
// ── Helpers ───────────────────────────────────────────────────────────────────
function fmtStation(name: string) {
return name.replace(/\s+Station$/i, '');
}
function fmtMoney(amount: number, currency: string) {
return `${currency} ${amount.toLocaleString('en-US', { minimumFractionDigits: 2 })}`;
}
@@ -73,7 +77,7 @@ function exportCsv(rows: DiscrepancyRow[]) {
r.passengerName,
r.phone,
new Date(r.bookingDate).toLocaleDateString('en-GB'),
`${r.origin.city || r.origin.name}${r.destination.city || r.destination.name}`,
`${fmtStation(r.origin.name)}${fmtStation(r.destination.name)}`,
new Date(r.departureAt).toLocaleString('en-GB', { dateStyle: 'medium', timeStyle: 'short' }),
r.seatType,
r.coachNumber ?? '—',
@@ -334,11 +338,11 @@ export default function PaymentDiscrepancyPage() {
</td>
<td className="px-4 py-3 whitespace-nowrap">
<span className="text-gray-900 dark:text-white font-medium">
{row.origin.city || row.origin.name}
{fmtStation(row.origin.name)}
</span>
<span className="text-gray-400 dark:text-gray-500 mx-1"></span>
<span className="text-gray-900 dark:text-white font-medium">
{row.destination.city || row.destination.name}
{fmtStation(row.destination.name)}
</span>
</td>
<td className="px-4 py-3 text-gray-600 dark:text-gray-400 whitespace-nowrap">