diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index c71990212334..61641aea6c9a 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -558,6 +558,8 @@ const ONYXKEYS = { WORKSPACE_NEW_TAX_FORM: 'workspaceNewTaxForm', WORKSPACE_NEW_TAX_FORM_DRAFT: 'workspaceNewTaxFormDraft', WORKSPACE_TAX_NAME_FORM: 'workspaceTaxNameForm', + WORKSPACE_TAX_CODE_FORM: 'workspaceTaxCodeForm', + WORKSPACE_TAX_CODE_FORM_DRAFT: 'workspaceTaxCodeFormDraft', WORKSPACE_TAX_NAME_FORM_DRAFT: 'workspaceTaxNameFormDraft', WORKSPACE_TAX_VALUE_FORM: 'workspaceTaxValueForm', WORKSPACE_TAX_VALUE_FORM_DRAFT: 'workspaceTaxValueFormDraft', @@ -639,6 +641,7 @@ type OnyxFormValuesMapping = { [ONYXKEYS.FORMS.POLICY_DISTANCE_RATE_EDIT_FORM]: FormTypes.PolicyDistanceRateEditForm; [ONYXKEYS.FORMS.POLICY_DISTANCE_RATE_TAX_RECLAIMABLE_ON_EDIT_FORM]: FormTypes.PolicyDistanceRateTaxReclaimableOnEditForm; [ONYXKEYS.FORMS.WORKSPACE_TAX_NAME_FORM]: FormTypes.WorkspaceTaxNameForm; + [ONYXKEYS.FORMS.WORKSPACE_TAX_CODE_FORM]: FormTypes.WorkspaceTaxCodeForm; [ONYXKEYS.FORMS.WORKSPACE_TAX_VALUE_FORM]: FormTypes.WorkspaceTaxValueForm; [ONYXKEYS.FORMS.NEW_CHAT_NAME_FORM]: FormTypes.NewChatNameForm; [ONYXKEYS.FORMS.SUBSCRIPTION_SIZE_FORM]: FormTypes.SubscriptionSizeForm; diff --git a/src/ROUTES.ts b/src/ROUTES.ts index f13724bf4322..ee913571daf9 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -815,6 +815,10 @@ const ROUTES = { route: 'settings/workspaces/:policyID/tax/:taxID/value', getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURIComponent(taxID)}/value` as const, }, + WORKSPACE_TAX_CODE: { + route: 'settings/workspaces/:policyID/tax/:taxID/tax-code', + getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURIComponent(taxID)}/tax-code` as const, + }, WORKSPACE_REPORT_FIELDS: { route: 'settings/workspaces/:policyID/reportFields', getRoute: (policyID: string) => `settings/workspaces/${policyID}/reportFields` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 3a0bb2248303..e5710380102d 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -371,6 +371,7 @@ const SCREENS = { TAX_EDIT: 'Workspace_Tax_Edit', TAX_NAME: 'Workspace_Tax_Name', TAX_VALUE: 'Workspace_Tax_Value', + TAX_CODE: 'Workspace_Tax_Code', TAXES_SETTINGS: 'Workspace_Taxes_Settings', TAXES_SETTINGS_CUSTOM_TAX_NAME: 'Workspace_Taxes_Settings_CustomTaxName', TAXES_SETTINGS_WORKSPACE_CURRENCY_DEFAULT: 'Workspace_Taxes_Settings_WorkspaceCurrency', diff --git a/src/languages/en.ts b/src/languages/en.ts index b431531bc854..9cb9103d7dac 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2849,6 +2849,7 @@ export default { taxRate: 'Tax rate', error: { taxRateAlreadyExists: 'This tax name is already in use.', + taxCodeAlreadyExists: 'This tax code is already in use.', valuePercentageRange: 'Please enter a valid percentage between 0 and 100.', customNameRequired: 'Custom tax name is required.', deleteFailureMessage: 'An error occurred while deleting the tax rate. Please try again or ask Concierge for help.', @@ -2867,6 +2868,8 @@ export default { enableMultiple: 'Enable rates', }, importedFromAccountingSoftware: 'The taxes below are imported from your', + taxCode: 'Tax code', + updateTaxCodeFailureMessage: 'An error occurred while updating the tax code, please try again.', }, emptyWorkspace: { title: 'Create a workspace', diff --git a/src/languages/es.ts b/src/languages/es.ts index 6c5841e2a7d6..09add3c57b60 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2899,6 +2899,7 @@ export default { taxReclaimableOn: 'Impuesto recuperable en', error: { taxRateAlreadyExists: 'Ya existe un impuesto con este nombre.', + taxCodeAlreadyExists: 'Ya existe un código de impuesto con este nombre.', customNameRequired: 'El nombre del impuesto es obligatorio.', valuePercentageRange: 'Por favor, introduce un porcentaje entre 0 y 100.', deleteFailureMessage: 'Se ha producido un error al intentar eliminar la tasa de impuesto. Por favor, inténtalo más tarde.', @@ -2917,6 +2918,8 @@ export default { enableMultiple: 'Activar tasas', }, importedFromAccountingSoftware: 'Impuestos importadas desde', + taxCode: 'Código de impuesto', + updateTaxCodeFailureMessage: 'Se produjo un error al actualizar el código tributario, inténtelo nuevamente.', }, emptyWorkspace: { title: 'Crea un espacio de trabajo', diff --git a/src/libs/API/parameters/UpdatePolicyTaxCodeParams.ts b/src/libs/API/parameters/UpdatePolicyTaxCodeParams.ts new file mode 100644 index 000000000000..9218b0223a2c --- /dev/null +++ b/src/libs/API/parameters/UpdatePolicyTaxCodeParams.ts @@ -0,0 +1,8 @@ +type UpdatePolicyTaxCodeParams = { + policyID: string; + oldTaxCode: string; + newTaxCode: string; + taxID: string; +}; + +export default UpdatePolicyTaxCodeParams; diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts index ac040752f0d0..bc74f9f305ea 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -221,6 +221,7 @@ export type {default as UpdatePolicyConnectionConfigParams} from './UpdatePolicy export type {default as UpdateManyPolicyConnectionConfigurationsParams} from './UpdateManyPolicyConnectionConfigurationsParams'; export type {default as RemovePolicyConnectionParams} from './RemovePolicyConnectionParams'; export type {default as RenamePolicyTaxParams} from './RenamePolicyTaxParams'; +export type {default as UpdatePolicyTaxCodeParams} from './UpdatePolicyTaxCodeParams'; export type {default as CompleteGuidedSetupParams} from './CompleteGuidedSetupParams'; export type {default as DismissTrackExpenseActionableWhisperParams} from './DismissTrackExpenseActionableWhisperParams'; export type {default as ConvertTrackedExpenseToRequestParams} from './ConvertTrackedExpenseToRequestParams'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index a8f51b6673d7..b2126334c093 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -207,6 +207,7 @@ const WRITE_COMMANDS = { DELETE_POLICY_TAXES: 'DeletePolicyTaxes', UPDATE_POLICY_TAX_VALUE: 'UpdatePolicyTaxValue', RENAME_POLICY_TAX: 'RenamePolicyTax', + UPDATE_POLICY_TAX_CODE: 'UpdatePolicyTaxCode', CREATE_POLICY_DISTANCE_RATE: 'CreatePolicyDistanceRate', REQUEST_WORKSPACE_OWNER_CHANGE: 'RequestWorkspaceOwnerChange', ADD_BILLING_CARD_AND_REQUEST_WORKSPACE_OWNER_CHANGE: 'AddBillingCardAndRequestPolicyOwnerChange', @@ -515,6 +516,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.REQUEST_WORKSPACE_OWNER_CHANGE]: Parameters.RequestWorkspaceOwnerChangeParams; [WRITE_COMMANDS.ADD_BILLING_CARD_AND_REQUEST_WORKSPACE_OWNER_CHANGE]: Parameters.AddBillingCardAndRequestWorkspaceOwnerChangeParams; [WRITE_COMMANDS.RENAME_POLICY_TAX]: Parameters.RenamePolicyTaxParams; + [WRITE_COMMANDS.UPDATE_POLICY_TAX_CODE]: Parameters.UpdatePolicyTaxCodeParams; [WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_UNIT]: Parameters.SetPolicyDistanceRatesUnitParams; [WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_DEFAULT_CATEGORY]: Parameters.SetPolicyDistanceRatesDefaultCategoryParams; [WRITE_COMMANDS.ENABLE_DISTANCE_REQUEST_TAX]: Parameters.SetPolicyDistanceRatesDefaultCategoryParams; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index c92fc139e943..33d496c9d914 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -411,6 +411,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/taxes/NamePage').default, [SCREENS.WORKSPACE.TAX_VALUE]: () => require('../../../../pages/workspace/taxes/ValuePage').default, [SCREENS.WORKSPACE.TAX_CREATE]: () => require('../../../../pages/workspace/taxes/WorkspaceCreateTaxPage').default, + [SCREENS.WORKSPACE.TAX_CODE]: () => require('../../../../pages/workspace/taxes/WorkspaceTaxCodePage').default, [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: () => require('../../../../pages/workspace/card/issueNew/IssueNewCardPage').default, [SCREENS.WORKSPACE.EXPENSIFY_CARD_BANK_ACCOUNT]: () => require('../../../../pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts').default, [SCREENS.WORKSPACE.EXPENSIFY_CARD_DETAILS]: () => require('../../../../pages/workspace/expensifyCard/WorkspaceExpensifyCardDetailsPage').default, diff --git a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts index 9bb6e817f0d8..a23d04b85ab5 100755 --- a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts @@ -127,6 +127,7 @@ const FULL_SCREEN_TO_RHP_MAPPING: Partial> = { SCREENS.WORKSPACE.TAX_EDIT, SCREENS.WORKSPACE.TAX_NAME, SCREENS.WORKSPACE.TAX_VALUE, + SCREENS.WORKSPACE.TAX_CODE, ], [SCREENS.WORKSPACE.TAGS]: [ SCREENS.WORKSPACE.TAGS_SETTINGS, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index beed9f1cca92..386bbe51d2d9 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -678,6 +678,12 @@ const config: LinkingOptions['config'] = { taxID: (taxID: string) => decodeURIComponent(taxID), }, }, + [SCREENS.WORKSPACE.TAX_CODE]: { + path: ROUTES.WORKSPACE_TAX_CODE.route, + parse: { + taxID: (taxID: string) => decodeURIComponent(taxID), + }, + }, [SCREENS.WORKSPACE.TAX_NAME]: { path: ROUTES.WORKSPACE_TAX_NAME.route, parse: { diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index c273b2db6a10..c31bf6dcddc9 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -661,6 +661,10 @@ type SettingsNavigatorParamList = { policyID: string; taxID: string; }; + [SCREENS.WORKSPACE.TAX_CODE]: { + policyID: string; + taxID: string; + }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: { policyID: string; }; diff --git a/src/libs/ValidationUtils.ts b/src/libs/ValidationUtils.ts index 5fedd5443a89..64cae69e0b15 100644 --- a/src/libs/ValidationUtils.ts +++ b/src/libs/ValidationUtils.ts @@ -478,6 +478,11 @@ function isExistingTaxName(taxName: string, taxRates: TaxRates): boolean { return !!Object.values(taxRates).find((taxRate) => taxRate.name === trimmedTaxName); } +function isExistingTaxCode(taxCode: string, taxRates: TaxRates): boolean { + const trimmedTaxCode = taxCode.trim(); + return !!Object.keys(taxRates).find((taxID) => taxID === trimmedTaxCode); +} + /** * Validates the given value if it is correct subscription size. */ @@ -528,4 +533,5 @@ export { isValidReportName, isExistingTaxName, isValidSubscriptionSize, + isExistingTaxCode, }; diff --git a/src/libs/actions/TaxRate.ts b/src/libs/actions/TaxRate.ts index 4792304cb9ce..0e7245a93f7b 100644 --- a/src/libs/actions/TaxRate.ts +++ b/src/libs/actions/TaxRate.ts @@ -2,7 +2,14 @@ import type {OnyxCollection} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; import type {FormOnyxValues} from '@components/Form/types'; import * as API from '@libs/API'; -import type {CreatePolicyTaxParams, DeletePolicyTaxesParams, RenamePolicyTaxParams, SetPolicyTaxesEnabledParams, UpdatePolicyTaxValueParams} from '@libs/API/parameters'; +import type { + CreatePolicyTaxParams, + DeletePolicyTaxesParams, + RenamePolicyTaxParams, + SetPolicyTaxesEnabledParams, + UpdatePolicyTaxCodeParams, + UpdatePolicyTaxValueParams, +} from '@libs/API/parameters'; import {WRITE_COMMANDS} from '@libs/API/types'; import {translateLocal} from '@libs/Localize'; import * as ValidationUtils from '@libs/ValidationUtils'; @@ -10,6 +17,8 @@ import CONST from '@src/CONST'; import * as ErrorUtils from '@src/libs/ErrorUtils'; import ONYXKEYS from '@src/ONYXKEYS'; import INPUT_IDS from '@src/types/form/WorkspaceNewTaxForm'; +// eslint-disable-next-line import/no-named-default +import {default as INPUT_IDS_TAX_CODE} from '@src/types/form/WorkspaceTaxCodeForm'; import type {Policy, TaxRate, TaxRates} from '@src/types/onyx'; import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; import type {OnyxData} from '@src/types/onyx/Request'; @@ -46,6 +55,17 @@ const validateTaxName = (policy: Policy, values: FormOnyxValues) => { + const errors = ValidationUtils.getFieldRequiredErrors(values, [INPUT_IDS_TAX_CODE.TAX_CODE]); + + const taxCode = values[INPUT_IDS_TAX_CODE.TAX_CODE]; + if (policy?.taxRates?.taxes && ValidationUtils.isExistingTaxCode(taxCode, policy.taxRates.taxes)) { + errors[INPUT_IDS_TAX_CODE.TAX_CODE] = translateLocal('workspace.taxes.error.taxCodeAlreadyExists'); + } + + return errors; +}; + /** * Function to validate tax value */ @@ -463,6 +483,82 @@ function renamePolicyTax(policyID: string, taxID: string, newName: string) { API.write(WRITE_COMMANDS.RENAME_POLICY_TAX, parameters, onyxData); } +function setPolicyTaxCode(policyID: string, oldTaxCode: string, newTaxCode: string) { + const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]; + const originalTaxRate = {...policy?.taxRates?.taxes[oldTaxCode]}; + const onyxData: OnyxData = { + optimisticData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + taxRates: { + taxes: { + [oldTaxCode]: null, + [newTaxCode]: { + ...originalTaxRate, + pendingFields: {code: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}, + pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, + errorFields: {code: null}, + previousTaxCode: oldTaxCode, + }, + }, + }, + }, + }, + ], + successData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + taxRates: { + taxes: { + [oldTaxCode]: null, + [newTaxCode]: { + ...originalTaxRate, + code: newTaxCode, + pendingFields: {code: null}, + pendingAction: null, + errorFields: {code: null}, + }, + }, + }, + }, + }, + ], + failureData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + taxRates: { + taxes: { + [newTaxCode]: null, + [oldTaxCode]: { + ...originalTaxRate, + code: originalTaxRate.code, + pendingFields: {code: null}, + pendingAction: null, + errorFields: {code: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.taxes.error.updateFailureMessage')}, + }, + }, + }, + }, + }, + ], + }; + + const parameters: UpdatePolicyTaxCodeParams = { + policyID, + oldTaxCode, + newTaxCode, + taxID: originalTaxRate.name ?? '', + }; + + API.write(WRITE_COMMANDS.UPDATE_POLICY_TAX_CODE, parameters, onyxData); +} + export { createPolicyTax, getNextTaxCode, @@ -471,8 +567,10 @@ export { getTaxValueWithPercentage, setPolicyTaxesEnabled, validateTaxName, + validateTaxCode, validateTaxValue, deletePolicyTaxes, updatePolicyTaxValue, renamePolicyTax, + setPolicyTaxCode, }; diff --git a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx index 66703679569f..08e7be149ad0 100644 --- a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx @@ -37,10 +37,11 @@ function WorkspaceEditTaxPage({ const {translate} = useLocalize(); const currentTaxRate = PolicyUtils.getTaxByID(policy, taxID); const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); - const canEdit = policy && PolicyUtils.canEditTaxRate(policy, taxID); + const canEditTaxRate = policy && PolicyUtils.canEditTaxRate(policy, taxID); const hasAccountingConnections = PolicyUtils.hasAccountingConnections(policy); + const canEditTaxCode = !PolicyUtils.isControlPolicy(policy); - const shouldShowDeleteMenuItem = canEdit && !hasAccountingConnections; + const shouldShowDeleteMenuItem = canEditTaxRate && !hasAccountingConnections; const toggleTaxRate = () => { if (!currentTaxRate) { @@ -87,7 +88,7 @@ function WorkspaceEditTaxPage({ isOn={!currentTaxRate?.isDisabled} accessibilityLabel={translate('workspace.taxes.actions.enable')} onToggle={toggleTaxRate} - disabled={!canEdit} + disabled={!canEditTaxRate} /> @@ -122,6 +123,22 @@ function WorkspaceEditTaxPage({ onPress={() => Navigation.navigate(ROUTES.WORKSPACE_TAX_VALUE.getRoute(`${policyID}`, taxID))} /> + clearTaxRateFieldError(policyID, taxID, 'code')} + > + Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID))} + /> + {shouldShowDeleteMenuItem && ( ; + +function WorkspaceTaxCodePage({route}: WorkspaceTaxCodePageProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + const policyID = route.params.policyID ?? '-1'; + const currentTaxCode = route.params.taxID; + + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); + const {inputCallbackRef} = useAutoFocusInput(); + + const setTaxCode = useCallback( + (values: FormOnyxValues) => { + const newTaxCode = values.taxCode.trim(); + if (currentTaxCode === newTaxCode) { + Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID, currentTaxCode)); + return; + } + + setPolicyTaxCode(policyID, currentTaxCode, newTaxCode); + Navigation.dismissModal(); + Navigation.navigate(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID, newTaxCode)); + }, + [currentTaxCode, policyID], + ); + + const validate = useCallback( + (values: FormOnyxValues) => { + if (!policy) { + return {}; + } + return validateTaxCode(policy, values); + }, + [policy], + ); + + return ( + + + Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID, currentTaxCode))} + /> + + + + + + + + + ); +} + +WorkspaceTaxCodePage.displayName = 'WorkspaceTaxCodePage'; + +export default WorkspaceTaxCodePage; diff --git a/src/types/form/WorkspaceTaxCodeForm.ts b/src/types/form/WorkspaceTaxCodeForm.ts new file mode 100644 index 000000000000..f278200a7cbb --- /dev/null +++ b/src/types/form/WorkspaceTaxCodeForm.ts @@ -0,0 +1,18 @@ +import type {ValueOf} from 'type-fest'; +import type Form from './Form'; + +const INPUT_IDS = { + TAX_CODE: 'taxCode', +} as const; + +type InputID = ValueOf; + +type WorkspaceTaxCodeForm = Form< + InputID, + { + [INPUT_IDS.TAX_CODE]: string; + } +>; + +export type {WorkspaceTaxCodeForm}; +export default INPUT_IDS; diff --git a/src/types/form/index.ts b/src/types/form/index.ts index 450de82a60cf..7cd10488399c 100644 --- a/src/types/form/index.ts +++ b/src/types/form/index.ts @@ -47,6 +47,7 @@ export type {WorkspaceNewTaxForm} from './WorkspaceNewTaxForm'; export type {WorkspaceTaxNameForm} from './WorkspaceTaxNameForm'; export type {WorkspaceTaxValueForm} from './WorkspaceTaxValueForm'; export type {WorkspaceTaxCustomName} from './WorkspaceTaxCustomName'; +export type {WorkspaceTaxCodeForm} from './WorkspaceTaxCodeForm'; export type {PolicyCreateDistanceRateForm} from './PolicyCreateDistanceRateForm'; export type {PolicyDistanceRateTaxReclaimableOnEditForm} from './PolicyDistanceRateTaxReclaimableOnEditForm'; export type {PolicyDistanceRateEditForm} from './PolicyDistanceRateEditForm'; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index ed10473ecb97..014901c6982a 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -130,6 +130,9 @@ type TaxRate = OnyxCommon.OnyxValueWithOfflineFeedback<{ /** Indicates if the tax rate is selected. */ isSelected?: boolean; + /** The old tax code of the tax rate when we edit the tax code */ + previousTaxCode?: string; + /** An error message to display to the user */ errors?: OnyxCommon.Errors;