mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Fix payment discrepancy column
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user