Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
6999b0c
Improve deleted tax behavior
huult Dec 26, 2025
4e80669
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Dec 29, 2025
2e421b1
Handle case where tax value changes
huult Dec 29, 2025
c8f59f2
update case where tax value changes
huult Dec 29, 2025
d9ff23b
fix perf-4
huult Dec 29, 2025
37e04f1
Rename variables for clarity
huult Dec 29, 2025
428ca4a
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Dec 31, 2025
ed5140b
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 5, 2026
af412be
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 8, 2026
bc50497
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 12, 2026
28f7339
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 13, 2026
fa45c84
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 14, 2026
5de4239
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 15, 2026
b490167
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 16, 2026
fbef0d2
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 19, 2026
c34bb58
Update params for updateMoneyRequestTaxRate
huult Jan 19, 2026
c70f01d
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 20, 2026
72b1594
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 22, 2026
25b1f06
Rename variable for clarity
huult Jan 22, 2026
572e04c
Refactor if-else conditions for clarity
huult Jan 22, 2026
dfde2dd
fix lint
huult Jan 22, 2026
e6bf62e
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 23, 2026
65b8733
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 25, 2026
5801168
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 27, 2026
5d23785
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 29, 2026
1179ab0
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Jan 31, 2026
e487d99
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 3, 2026
eae5805
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 4, 2026
2bbdff6
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 5, 2026
61defc8
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 6, 2026
3229edb
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 9, 2026
ed8c3b1
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 10, 2026
3b6150a
update selection when tax value changes but tax code stays the same
huult Feb 10, 2026
5ad7231
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 12, 2026
eca6220
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 13, 2026
15da7fa
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 14, 2026
78c5bb8
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 16, 2026
781f197
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 18, 2026
3aac97c
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 19, 2026
99ad095
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 21, 2026
6cf2d82
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 23, 2026
a2de645
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 23, 2026
d1d38cc
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 24, 2026
396cb9b
run prettier
huult Feb 24, 2026
5bb730d
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 25, 2026
4847d44
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 26, 2026
b726f90
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Feb 27, 2026
db65630
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 2, 2026
11f1234
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 3, 2026
c12b2f2
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 4, 2026
a68b792
Fix logic for adding tax option
huult Mar 4, 2026
e02657c
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 5, 2026
5381fb1
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 6, 2026
5356433
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 10, 2026
c156dbc
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 10, 2026
b67509f
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 11, 2026
e6fa850
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 12, 2026
a9a5588
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 13, 2026
cd95258
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 13, 2026
1aed809
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 14, 2026
5f9fc90
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 16, 2026
58ab3a8
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 16, 2026
f530db5
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 17, 2026
499681a
update to use baseTransaction
huult Mar 17, 2026
915d5fa
Merge remote-tracking branch 'upstream/main' into 73033-invalid-tax-a…
huult Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ import {
getTagArrayFromName,
getTagForDisplay,
getTaxName,
getTaxValue,
hasMissingSmartscanFields,
hasMultipleSplitChildren,
hasReservationList,
Expand Down Expand Up @@ -305,7 +306,12 @@ function MoneyRequestView({
: convertToDisplayString(Math.abs(transactionTaxAmount ?? 0), actualCurrency);

const taxRatesDescription = taxRates?.name;
const taxRateTitle = updatedTransaction ? getTaxName(policy, updatedTransaction, isExpenseUnreported) : getTaxName(policy, transaction, isExpenseUnreported);

const baseTransaction = updatedTransaction ?? transaction;
const {taxCode, taxValue} = baseTransaction ?? {};

const taxRateTitle = taxCode ? getTaxName(policy, baseTransaction, isExpenseUnreported) : '';
const hasTaxValueChanged = taxCode ? getTaxValue(policy, baseTransaction, taxCode) !== baseTransaction?.taxValue : false;

const actualTransactionDate = isFromMergeTransaction && updatedTransaction ? getFormattedCreated(updatedTransaction) : transactionDate;
const fallbackTaxRateTitle = transaction?.taxValue;
Expand Down Expand Up @@ -592,7 +598,7 @@ function MoneyRequestView({
const decodedCategoryName = getDecodedCategoryName(categoryValue);
const categoryCopyValue = !canEdit ? decodedCategoryName : undefined;
const cardCopyValue = cardProgramName;
const taxRateValue = transaction?.taxName ?? taxRateTitle ?? fallbackTaxRateTitle;
const taxRateValue = hasTaxValueChanged ? taxValue : (transaction?.taxName ?? taxRateTitle ?? fallbackTaxRateTitle ?? '');
const taxRateCopyValue = !canEditTaxFields ? taxRateValue : undefined;
const taxAmountTitle = formattedTaxAmount ? formattedTaxAmount.toString() : '';
const taxAmountCopyValue = !canEditTaxFields ? taxAmountTitle : undefined;
Expand Down
35 changes: 32 additions & 3 deletions src/components/TaxPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type TaxPickerProps = {
transactionID?: string;

/** Callback to fire when a tax is pressed */
onSubmit: (tax: TaxRatesOption) => void;
onSubmit: (tax: TaxRatesOption, shouldClearTax?: boolean) => void;

/** The action to take */
action?: IOUAction;
Expand Down Expand Up @@ -68,6 +68,22 @@ function TaxPicker({selectedTaxRate = '', policyID, transactionID, onSubmit, act

const shouldShowTextInput = !isTaxRatesCountBelowThreshold;

const {taxCode, taxValue} = transaction ?? {};
const hasTaxBeenDeleted = !!taxCode && taxValue !== undefined && !taxRates?.taxes?.[taxCode];
const hasTaxValueChanged = !!taxCode && taxValue !== undefined && taxRates?.taxes?.[taxCode]?.value !== taxValue;

const deletedTaxOption = !hasTaxBeenDeleted
? null
: {
code: undefined,
text: taxValue ?? '',
keyForList: taxCode ?? '',
searchText: taxValue ?? '',
tooltipText: taxValue ?? '',
isDisabled: true,
isSelected: true,
};

const selectedOptions = selectedTaxRate
? [
{
Expand All @@ -89,11 +105,17 @@ function TaxPicker({selectedTaxRate = '', policyID, transactionID, onSubmit, act
const selectedOptionKey = sections?.at(0)?.data?.find((taxRate) => taxRate.searchText === selectedTaxRate)?.keyForList;

const handleSelectRow = (newSelectedOption: TaxRatesOption) => {
if (hasTaxValueChanged) {
onSubmit(newSelectedOption, !newSelectedOption.code);
return;
}

if (selectedOptionKey === newSelectedOption.keyForList) {
onDismiss();
return;
}
onSubmit(newSelectedOption);

onSubmit(newSelectedOption, hasTaxBeenDeleted);
};

const textInputOptions = {
Expand All @@ -103,9 +125,16 @@ function TaxPicker({selectedTaxRate = '', policyID, transactionID, onSubmit, act
headerMessage: getHeaderMessageForNonUserList((sections.at(0)?.data?.length ?? 0) > 0, searchValue),
};

const updatedSections = deletedTaxOption
? sections.map((section) => ({
...section,
data: [...section.data.map((item) => (item.code === deletedTaxOption.code ? {...item, isSelected: false} : item)), deletedTaxOption],
}))
: sections;

return (
<SelectionListWithSections
sections={sections}
sections={updatedSections}
shouldShowTextInput={shouldShowTextInput}
textInputOptions={textInputOptions}
onSelectRow={handleSelectRow}
Expand Down
39 changes: 23 additions & 16 deletions src/pages/iou/request/step/IOURequestStepTaxRatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,28 @@ function IOURequestStepTaxRatePage({
const currency = getCurrency(currentTransaction);
const decimals = getCurrencyDecimals(currency);

const updateTaxRates = (taxes: TaxRatesOption) => {
const updateTaxRates = (taxes: TaxRatesOption, shouldClearTax?: boolean) => {
const updateTaxRateParams = {
transactionID: currentTransaction?.transactionID,
transactionThreadReport: report,
parentReport,
taxCode: '',
taxValue: '',
taxAmount: 0,
policy,
policyTagList: policyTags,
policyCategories,
currentUserAccountIDParam,
currentUserEmailParam,
isASAPSubmitBetaEnabled,
parentReportNextStep,
};

if (shouldClearTax && isEditing) {
updateMoneyRequestTaxRate(updateTaxRateParams);
navigateBack();
return;
}
if (!currentTransaction || !taxes.code || !taxRates) {
Navigation.goBack();
return;
Expand All @@ -97,21 +118,7 @@ function IOURequestStepTaxRatePage({

if (isEditing) {
const newTaxCode = taxes.code;
updateMoneyRequestTaxRate({
transactionID: currentTransaction?.transactionID,
transactionThreadReport: report,
parentReport,
taxCode: newTaxCode,
taxValue,
taxAmount: convertToBackendAmount(taxAmount ?? 0),
policy,
policyTagList: policyTags,
policyCategories,
currentUserAccountIDParam,
currentUserEmailParam,
isASAPSubmitBetaEnabled,
parentReportNextStep,
});
updateMoneyRequestTaxRate({...updateTaxRateParams, taxCode: newTaxCode, taxValue, taxAmount: convertToBackendAmount(taxAmount ?? 0)});
navigateBack();
return;
}
Expand Down
Loading