From afd75d3f0974c66ebe393b62dae1039038987f9e Mon Sep 17 00:00:00 2001 From: siddharthd Date: Thu, 13 Aug 2026 12:32:17 +1000 Subject: [PATCH] transactions: never print a foreign amount as AUD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The amount cell rendered formatAmount(amount_aud ?? amount) with no currency argument, so a row with no AUD figure fell back to its native amount and was stamped with a dollar sign. A USD 10,782.00 Wise credit showed as "+$10,782.00" in a column of AUD figures — the same payment from the statement, one row above, correctly showed $15,518.53 over USD 10,782.00. So the feed row read as $10,782 AUD when the real value is about $15,500, and the sub-line just repeated the same number correctly labelled. amount_unconverted is already selected by the transactions query (queries.ts:298) and was simply unused here. When set, the native figure becomes the headline and the absence of a rate is stated rather than papered over. Pre-existing rather than Frollo's: any row with amount_aud NULL and a foreign currency hits it, including foreign order-receipt rows. Frollo made it visible at scale — 39 rows. --- src/app/transactions/page.tsx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/app/transactions/page.tsx b/src/app/transactions/page.tsx index acf02ce..fbeb8aa 100644 --- a/src/app/transactions/page.tsx +++ b/src/app/transactions/page.tsx @@ -1059,11 +1059,32 @@ function TransactionsContent() { - {formatAmount(t.amount_aud ?? t.amount, t.transaction_type)} - {t.currency && t.currency !== "AUD" && ( -
+ {/* + A row with no AUD figure must NOT be printed as AUD. + `amount_aud ?? amount` formatted with the default currency + rendered a USD 10,782.00 Wise credit as "+$10,782.00" in a + column of AUD figures — the real value was about $15,500, + and the row directly above it (the same payment from the + statement) showed exactly that. The native figure is the + only true one here, so it becomes the headline and the + absence of a rate is stated rather than papered over. + */} + {t.amount_unconverted ? ( + <> {formatAmount(t.amount, t.transaction_type, t.currency)} -
+
+ no AUD rate +
+ + ) : ( + <> + {formatAmount(t.amount_aud ?? t.amount, t.transaction_type)} + {t.currency && t.currency !== "AUD" && ( +
+ {formatAmount(t.amount, t.transaction_type, t.currency)} +
+ )} + )}