Skip to content

Commit e3b041d

Browse files
authored
Merge pull request #89514 from mukhrr/fix/custom-report-blockers
[CP Staging] fixed tax rate and tax visibility and negative IOU expense
2 parents df26892 + 0f1a66a commit e3b041d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/components/TransactionItemRow/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ function TransactionItemRow({
589589
const hasConvertedAmount = transactionItem.convertedAmount != null;
590590
// Offline expenses don't have a BE-computed convertedAmount yet — fall back to the unconverted
591591
// amount in the transaction's own currency so users don't see a misleading $0.00 placeholder.
592-
const totalAmount = hasConvertedAmount ? getConvertedAmount(transactionItem, isFromExpenseReport, false, true) : getAmount(transactionItem, isFromExpenseReport, false, true);
592+
// Pass isFromExpenseReport so IOU reports stay positive while expense reports get NewDot's signed display.
593+
const totalAmount = hasConvertedAmount ? getConvertedAmount(transactionItem, isFromExpenseReport) : getAmount(transactionItem, isFromExpenseReport);
593594
// When converted, display in the report's output currency; otherwise use the transaction's own currency.
594595
const totalCurrency = hasConvertedAmount ? (report?.currency ?? policy?.outputCurrency ?? getCurrency(transactionItem)) : getCurrency(transactionItem);
595596
return (

src/libs/SearchUIUtils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5330,9 +5330,11 @@ function getColumnsToShow({
53305330
columns[CONST.SEARCH.TABLE_COLUMNS.CARD] = true;
53315331
}
53325332

5333-
// If the transaction has any tax info (code, value, or amount),
5334-
// show both TAX_RATE and TAX_AMOUNT columns. Zero is valid tax data.
5335-
const hasTaxInfo = !!transaction.taxCode || transaction.taxAmount != null || (transaction.taxValue !== undefined && transaction.taxValue !== '');
5333+
// Show both TAX_RATE and TAX_AMOUNT when the transaction has a meaningful tax signal.
5334+
// Use truthy checks so default/no-tax values (0, null, '', undefined) don't trigger
5335+
// false positives — buildOptimisticTransaction seeds taxAmount: 0 on every new draft,
5336+
// which would otherwise flash tax columns on for offline-pending transactions.
5337+
const hasTaxInfo = !!transaction.taxCode || !!transaction.taxAmount || !!transaction.taxValue;
53365338
if (hasTaxInfo) {
53375339
columns[CONST.SEARCH.TABLE_COLUMNS.TAX_RATE] = true;
53385340
columns[CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT] = true;

0 commit comments

Comments
 (0)