Skip to content

Commit

Permalink
Fallback to default tax rate
Browse files Browse the repository at this point in the history
  • Loading branch information
MonilBhavsar committed May 14, 2024
1 parent f34a2ac commit d2c656c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/iou/request/step/IOURequestStepAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ function IOURequestStepAmount({

// If currency has changed, then we get the default tax rate based on currency, otherwise we use the current tax rate selected in transaction, if we have it.
const transactionTaxCode = transaction?.taxCode ?? '';
const taxCode = currency !== transactionCurrency ? TransactionUtils.getDefaultTaxCode(policy, transaction, currency) ?? '' : transactionTaxCode;
const defaultTaxCode = TransactionUtils.getDefaultTaxCode(policy, transaction, currency) ?? '';
const taxCode = (currency !== transactionCurrency ? defaultTaxCode : transactionTaxCode) ?? defaultTaxCode;
const taxPercentage = TransactionUtils.getTaxValue(policy, transaction, taxCode) ?? '';
const taxAmount = CurrencyUtils.convertToBackendAmount(TransactionUtils.calculateTaxAmount(taxPercentage, newAmount));

Expand Down

0 comments on commit d2c656c

Please sign in to comment.