mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 21:48:18 +00:00
Merge pull request #843 from Tria-plc/alpha
Fix payment discrepancy column
This commit is contained in:
@@ -59,6 +59,10 @@ interface DiscrepancyReport {
|
|||||||
|
|
||||||
// ── Helpers ───────────────────────────────────────────────────────────────────
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
function fmtStation(name: string) {
|
||||||
|
return name.replace(/\s+Station$/i, '');
|
||||||
|
}
|
||||||
|
|
||||||
function fmtMoney(amount: number, currency: string) {
|
function fmtMoney(amount: number, currency: string) {
|
||||||
return `${currency} ${amount.toLocaleString('en-US', { minimumFractionDigits: 2 })}`;
|
return `${currency} ${amount.toLocaleString('en-US', { minimumFractionDigits: 2 })}`;
|
||||||
}
|
}
|
||||||
@@ -73,7 +77,7 @@ function exportCsv(rows: DiscrepancyRow[]) {
|
|||||||
r.passengerName,
|
r.passengerName,
|
||||||
r.phone,
|
r.phone,
|
||||||
new Date(r.bookingDate).toLocaleDateString('en-GB'),
|
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' }),
|
new Date(r.departureAt).toLocaleString('en-GB', { dateStyle: 'medium', timeStyle: 'short' }),
|
||||||
r.seatType,
|
r.seatType,
|
||||||
r.coachNumber ?? '—',
|
r.coachNumber ?? '—',
|
||||||
@@ -334,11 +338,11 @@ export default function PaymentDiscrepancyPage() {
|
|||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-3 whitespace-nowrap">
|
<td className="px-4 py-3 whitespace-nowrap">
|
||||||
<span className="text-gray-900 dark:text-white font-medium">
|
<span className="text-gray-900 dark:text-white font-medium">
|
||||||
{row.origin.city || row.origin.name}
|
{fmtStation(row.origin.name)}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-gray-400 dark:text-gray-500 mx-1">→</span>
|
<span className="text-gray-400 dark:text-gray-500 mx-1">→</span>
|
||||||
<span className="text-gray-900 dark:text-white font-medium">
|
<span className="text-gray-900 dark:text-white font-medium">
|
||||||
{row.destination.city || row.destination.name}
|
{fmtStation(row.destination.name)}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-3 text-gray-600 dark:text-gray-400 whitespace-nowrap">
|
<td className="px-4 py-3 text-gray-600 dark:text-gray-400 whitespace-nowrap">
|
||||||
|
|||||||
Reference in New Issue
Block a user