@@ -6,14 +6,16 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
66import useLocalize from '@hooks/useLocalize' ;
77import useOnyx from '@hooks/useOnyx' ;
88import usePermissions from '@hooks/usePermissions' ;
9+ import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses' ;
910import usePolicyForTransaction from '@hooks/usePolicyForTransaction' ;
1011import useRestartOnReceiptFailure from '@hooks/useRestartOnReceiptFailure' ;
1112import { convertToBackendAmount } from '@libs/CurrencyUtils' ;
1213import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID' ;
14+ import { isMovingTransactionFromTrackExpense } from '@libs/IOUUtils' ;
1315import Navigation from '@libs/Navigation/Navigation' ;
1416import type { TaxRatesOption } from '@libs/TaxOptionsListUtils' ;
15- import { calculateTaxAmount , getAmount , getCurrency , getTaxName , getTaxValue } from '@libs/TransactionUtils' ;
16- import { setMoneyRequestTaxAmount , setMoneyRequestTaxRate , updateMoneyRequestTaxRate } from '@userActions/IOU' ;
17+ import { calculateTaxAmount , getAmount , getCurrency , getTaxRateTitle , getTaxValue } from '@libs/TransactionUtils' ;
18+ import { setMoneyRequestTaxRateValues , updateMoneyRequestTaxRate } from '@userActions/IOU' ;
1719import { setDraftSplitTransaction } from '@userActions/IOU/Split' ;
1820import CONST from '@src/CONST' ;
1921import ONYXKEYS from '@src/ONYXKEYS' ;
@@ -62,14 +64,15 @@ function IOURequestStepTaxRatePage({
6264 const currentUserPersonalDetails = useCurrentUserPersonalDetails ( ) ;
6365 const currentUserAccountIDParam = currentUserPersonalDetails . accountID ;
6466 const currentUserEmailParam = currentUserPersonalDetails . login ?? '' ;
67+ const { policyForMovingExpenses} = usePolicyForMovingExpenses ( ) ;
6568 const { isBetaEnabled} = usePermissions ( ) ;
6669 const isASAPSubmitBetaEnabled = isBetaEnabled ( CONST . BETAS . ASAP_SUBMIT ) ;
6770
6871 const navigateBack = ( ) => {
6972 Navigation . goBack ( backTo ) ;
7073 } ;
7174
72- const taxRateTitle = getTaxName ( policy , currentTransaction ) ;
75+ const taxRateTitle = getTaxRateTitle ( policy , currentTransaction , isMovingTransactionFromTrackExpense ( action ) , policyForMovingExpenses ) ;
7376 const currency = getCurrency ( currentTransaction ) ;
7477 const decimals = getCurrencyDecimals ( currency ) ;
7578
@@ -86,6 +89,7 @@ function IOURequestStepTaxRatePage({
8689 setDraftSplitTransaction ( currentTransaction . transactionID , splitDraftTransaction , {
8790 taxAmount : convertToBackendAmount ( taxAmount ?? 0 ) ,
8891 taxCode : taxes . code ,
92+ taxValue,
8993 } ) ;
9094 navigateBack ( ) ;
9195 return ;
@@ -117,8 +121,8 @@ function IOURequestStepTaxRatePage({
117121 return ;
118122 }
119123 const amountInSmallestCurrencyUnits = convertToBackendAmount ( taxAmount ) ;
120- setMoneyRequestTaxRate ( currentTransaction ?. transactionID , taxes ?. code ?? '' ) ;
121- setMoneyRequestTaxAmount ( currentTransaction . transactionID , amountInSmallestCurrencyUnits ) ;
124+
125+ setMoneyRequestTaxRateValues ( currentTransaction . transactionID , { taxCode : taxes ?. code ?? '' , taxAmount : amountInSmallestCurrencyUnits , taxValue } ) ;
122126
123127 navigateBack ( ) ;
124128 } ;
0 commit comments