Skip to content

Commit

Permalink
Merge pull request #42051 from Expensify/monil-fixTaxSystemMessages
Browse files Browse the repository at this point in the history
[CP Staging] Fix system message when tax amount is updated
  • Loading branch information
Julesssss authored May 13, 2024
2 parents 1e5c18c + b83cd80 commit 8b437af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,9 @@ function getModifiedExpenseOriginalMessage(
originalMessage.tag = transactionChanges?.tag;
}

if ('taxAmount' in transactionChanges) {
// We only want to display a tax amount update system message when tax amount is updated by user.
// Tax amount can change as a result of amount, currency or tax rate update. In such cases, we want to skip displaying a system message, as discussed.
if ('taxAmount' in transactionChanges && !('amount' in transactionChanges || 'currency' in transactionChanges || 'taxCode' in transactionChanges)) {
originalMessage.oldTaxAmount = TransactionUtils.getTaxAmount(oldTransaction, isFromExpenseReport);
originalMessage.taxAmount = transactionChanges?.taxAmount;
originalMessage.currency = TransactionUtils.getCurrency(oldTransaction);
Expand Down

0 comments on commit 8b437af

Please sign in to comment.