Skip to content

Commit 4c09ab8

Browse files
committed
show total as unconverted amount on offline
1 parent b5d7a95 commit 4c09ab8

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/components/TransactionItemRow/index.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -586,21 +586,21 @@ function TransactionItemRow({
586586
</View>
587587
);
588588
case CONST.SEARCH.TABLE_COLUMNS.TOTAL: {
589-
// getConvertedAmount flips the stored opposite-sign value to the display convention, so an expense
590-
// with a negative Amount renders Total as negative too (matching Classic).
591-
const convertedAmount = getConvertedAmount(transactionItem, isExpenseReport(transactionItem.report ?? report), false, true);
592-
// convertedAmount is expressed in the report's output currency. Prefer the report currency, then the
593-
// policy output currency. Fall back to the transaction's own currency only when neither is available
594-
// (e.g. self-DM or unreported contexts) — in that case no conversion happened so the currencies match.
595-
const convertedCurrency = report?.currency ?? policy?.outputCurrency ?? getCurrency(transactionItem);
589+
const isFromExpenseReport = isExpenseReport(transactionItem.report ?? report);
590+
const hasConvertedAmount = transactionItem.convertedAmount != null;
591+
// Offline expenses don't have a BE-computed convertedAmount yet — fall back to the unconverted
592+
// amount in the transaction's own currency so users don't see a misleading $0.00 placeholder.
593+
const totalAmount = hasConvertedAmount ? getConvertedAmount(transactionItem, isFromExpenseReport, false, true) : getAmount(transactionItem, isFromExpenseReport, false, true);
594+
// When converted, display in the report's output currency; otherwise use the transaction's own currency.
595+
const totalCurrency = hasConvertedAmount ? (report?.currency ?? policy?.outputCurrency ?? getCurrency(transactionItem)) : getCurrency(transactionItem);
596596
return (
597597
<View
598598
key={column}
599599
style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT, {isAmountColumnWide})]}
600600
>
601601
<AmountCell
602-
total={convertedAmount}
603-
currency={convertedCurrency}
602+
total={totalAmount}
603+
currency={totalCurrency}
604604
/>
605605
</View>
606606
);

0 commit comments

Comments
 (0)