Skip to content

Commit d8be544

Browse files
committed
Switch tax defaults when currency changes
1 parent aa35758 commit d8be544

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/MoneyRequestConfirmationList/sections/AmountField.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,9 @@ function AmountField({
242242
persistMainDraftTotal(updatedAmount, value);
243243

244244
if (isMovingTransactionFromTrackExpense(action)) {
245-
const taxCode = getTaxCode(transactionForHandlers);
245+
const taxCode = value !== policy?.outputCurrency ? policy?.taxRates?.foreignTaxDefault : policy?.taxRates?.defaultExternalID;
246246
if (taxCode) {
247+
setMoneyRequestTaxRate(transactionID, taxCode);
247248
const taxPercentage = getTaxValue(policy, transactionForHandlers, taxCode) ?? '';
248249
const taxAmount = convertToBackendAmount(calculateTaxAmount(taxPercentage, updatedAmount, getCurrencyDecimals(value)));
249250
setMoneyRequestTaxAmount(transactionID, taxAmount);

0 commit comments

Comments
 (0)