Skip to content

Commit

Permalink
Merge pull request #38208 from software-mansion-labs/wave8/WorkspaceE…
Browse files Browse the repository at this point in the history
…ditPage

[Simplified Collect][Taxes] Tax editing and bulk actions
  • Loading branch information
luacmartins authored Mar 20, 2024
2 parents d98ee75 + d97bcd3 commit bf96b22
Show file tree
Hide file tree
Showing 32 changed files with 1,092 additions and 79 deletions.
5 changes: 5 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,11 @@ const CONST = {
DISABLE: 'disable',
ENABLE: 'enable',
},
TAX_RATES_BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
},

CUSTOM_UNITS: {
Expand Down
6 changes: 6 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ const ONYXKEYS = {
POLICY_TAG_NAME_FORM_DRAFT: 'policyTagNameFormDraft',
WORKSPACE_NEW_TAX_FORM: 'workspaceNewTaxForm',
WORKSPACE_NEW_TAX_FORM_DRAFT: 'workspaceNewTaxFormDraft',
WORKSPACE_TAX_NAME_FORM: 'workspaceTaxNameForm',
WORKSPACE_TAX_NAME_FORM_DRAFT: 'workspaceTaxNameFormDraft',
WORKSPACE_TAX_VALUE_FORM: 'workspaceTaxValueForm',
WORKSPACE_TAX_VALUE_FORM_DRAFT: 'workspaceTaxValueFormDraft',
},
} as const;

Expand Down Expand Up @@ -471,6 +475,8 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.POLICY_TAG_NAME_FORM]: FormTypes.PolicyTagNameForm;
[ONYXKEYS.FORMS.WORKSPACE_NEW_TAX_FORM]: FormTypes.WorkspaceNewTaxForm;
[ONYXKEYS.FORMS.POLICY_CREATE_DISTANCE_RATE_FORM]: FormTypes.PolicyCreateDistanceRateForm;
[ONYXKEYS.FORMS.WORKSPACE_TAX_NAME_FORM]: FormTypes.WorkspaceTaxNameForm;
[ONYXKEYS.FORMS.WORKSPACE_TAX_VALUE_FORM]: FormTypes.WorkspaceTaxValueForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down
12 changes: 12 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,18 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/taxes/new',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/taxes/new` as const,
},
WORKSPACE_TAX_EDIT: {
route: 'settings/workspaces/:policyID/tax/:taxID',
getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURI(taxID)}` as const,
},
WORKSPACE_TAX_NAME: {
route: 'settings/workspaces/:policyID/tax/:taxID/name',
getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURI(taxID)}/name` as const,
},
WORKSPACE_TAX_VALUE: {
route: 'settings/workspaces/:policyID/tax/:taxID/value',
getRoute: (policyID: string, taxID: string) => `settings/workspaces/${policyID}/tax/${encodeURI(taxID)}/value` as const,
},
WORKSPACE_DISTANCE_RATES: {
route: 'settings/workspaces/:policyID/distance-rates',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/distance-rates` as const,
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ const SCREENS = {
TAGS_EDIT: 'Tags_Edit',
TAG_EDIT: 'Tag_Edit',
TAXES: 'Workspace_Taxes',
TAX_EDIT: 'Workspace_Tax_Edit',
TAX_NAME: 'Workspace_Tax_Name',
TAX_VALUE: 'Workspace_Tax_Value',
TAXES_SETTINGS: 'Workspace_Taxes_Settings',
TAXES_SETTINGS_CUSTOM_TAX_NAME: 'Workspace_Taxes_Settings_CustomTaxName',
TAXES_SETTINGS_WORKSPACE_CURRENCY_DEFAULT: 'Workspace_Taxes_Settings_WorkspaceCurrency',
Expand Down
3 changes: 2 additions & 1 deletion src/components/AmountPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function AmountPicker({value, description, title, errorText = '', onInputChange,

const updateInput = (updatedValue: string) => {
if (updatedValue !== value) {
onInputChange?.(updatedValue);
// We cast the updatedValue to a number and then back to a string to remove any leading zeros and separating commas
onInputChange?.(String(Number(updatedValue)));
}
hidePickerModal();
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/ButtonWithDropdownMenu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type WorkspaceMemberBulkActionType = DeepValueOf<typeof CONST.POLICY.MEMBERS_BUL

type WorkspaceDistanceRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.DISTANCE_RATES_BULK_ACTION_TYPES>;

type WorkspaceTaxRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.TAX_RATES_BULK_ACTION_TYPES>;

type DropdownOption<TValueType> = {
value: TValueType;
text: string;
Expand Down Expand Up @@ -73,4 +75,4 @@ type ButtonWithDropdownMenuProps<TValueType> = {
wrapperStyle?: StyleProp<ViewStyle>;
};

export type {PaymentType, WorkspaceMemberBulkActionType, WorkspaceDistanceRatesBulkActionType, DropdownOption, ButtonWithDropdownMenuProps};
export type {PaymentType, WorkspaceMemberBulkActionType, WorkspaceDistanceRatesBulkActionType, DropdownOption, ButtonWithDropdownMenuProps, WorkspaceTaxRatesBulkActionType};
14 changes: 13 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,19 @@ export default {
errors: {
taxRateAlreadyExists: 'This tax name is already in use.',
valuePercentageRange: 'Please enter a valid percentage between 0 and 100.',
genericFailureMessage: 'An error occurred while updating the tax rate, please try again.',
deleteFailureMessage: 'An error occurred while deleting the tax rate. Please try again or ask Concierge for help.',
updateFailureMessage: 'An error occurred while updating the tax rate. Please try again or ask Concierge for help.',
createFailureMessage: 'An error occurred while creating the tax rate. Please try again or ask Concierge for help.',
},
deleteTaxConfirmation: 'Are you sure you want to delete this tax?',
deleteMultipleTaxConfirmation: ({taxAmount}) => `Are you sure you want to delete ${taxAmount} taxes?`,
actions: {
delete: 'Delete rate',
deleteMultiple: 'Delete rates',
disable: 'Disable rate',
disableMultiple: 'Disable rates',
enable: 'Enable rate',
enableMultiple: 'Enable rates',
},
},
emptyWorkspace: {
Expand Down
16 changes: 14 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1899,8 +1899,20 @@ export default {
value: 'Valor',
errors: {
taxRateAlreadyExists: 'Ya existe un impuesto con este nombre',
valuePercentageRange: 'Introduzca un porcentaje válido entre 0 y 100',
genericFailureMessage: 'Se produjo un error al actualizar el tipo impositivo, inténtelo nuevamente.',
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.',
updateFailureMessage: 'Se ha producido un error al intentar modificar la tasa de impuesto. Por favor, inténtalo más tarde.',
createFailureMessage: 'Se ha producido un error al intentar crear la tasa de impuesto. Por favor, inténtalo más tarde.',
},
deleteTaxConfirmation: '¿Estás seguro de que quieres eliminar este impuesto?',
deleteMultipleTaxConfirmation: ({taxAmount}) => `¿Estás seguro de que quieres eliminar ${taxAmount} impuestos?`,
actions: {
delete: 'Eliminar tasa',
deleteMultiple: 'Eliminar tasas',
disable: 'Desactivar tasa',
disableMultiple: 'Desactivar tasas',
enable: 'Activar tasa',
enableMultiple: 'Activar tasas',
},
},
emptyWorkspace: {
Expand Down
11 changes: 11 additions & 0 deletions src/libs/API/parameters/DeletePolicyTaxesParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type DeletePolicyTaxesParams = {
policyID: string;
/**
* Stringified JSON object with type of following structure:
* Array<string>
* Each element is a tax name
*/
taxNames: string;
};

export default DeletePolicyTaxesParams;
7 changes: 7 additions & 0 deletions src/libs/API/parameters/RenamePolicyTaxParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type SetPolicyCurrencyDefaultParams = {
policyID: string;
taxCode: string;
newName: string;
};

export default SetPolicyCurrencyDefaultParams;
10 changes: 10 additions & 0 deletions src/libs/API/parameters/SetPolicyTaxesEnabledParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type SetPolicyTaxesEnabledParams = {
policyID: string;
/**
* Stringified JSON object with type of following structure:
* Array<{taxCode: string, enabled: bool}>
*/
taxFieldsArray: string;
};

export default SetPolicyTaxesEnabledParams;
7 changes: 7 additions & 0 deletions src/libs/API/parameters/UpdatePolicyTaxValueParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type UpdatePolicyTaxValueParams = {
policyID: string;
taxCode: string;
taxAmount: number;
};

export default UpdatePolicyTaxValueParams;
4 changes: 4 additions & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ export type {default as CreatePolicyDistanceRateParams} from './CreatePolicyDist
export type {default as SetPolicyDistanceRatesUnitParams} from './SetPolicyDistanceRatesUnitParams';
export type {default as SetPolicyDistanceRatesDefaultCategoryParams} from './SetPolicyDistanceRatesDefaultCategoryParams';
export type {default as CreatePolicyTagsParams} from './CreatePolicyTagsParams';
export type {default as SetPolicyTaxesEnabledParams} from './SetPolicyTaxesEnabledParams';
export type {default as DeletePolicyTaxesParams} from './DeletePolicyTaxesParams';
export type {default as UpdatePolicyTaxValueParams} from './UpdatePolicyTaxValueParams';
export type {default as RenamePolicyTagsParams} from './RenamePolicyTagsParams';
export type {default as DeletePolicyTagsParams} from './DeletePolicyTagsParams';
export type {default as SetPolicyCustomTaxNameParams} from './SetPolicyCustomTaxNameParams';
export type {default as SetPolicyForeignCurrencyDefaultParams} from './SetPolicyForeignCurrencyDefaultParams';
export type {default as SetPolicyCurrencyDefaultParams} from './SetPolicyCurrencyDefaultParams';
export type {default as RenamePolicyTaxParams} from './RenamePolicyTaxParams';
8 changes: 8 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ const WRITE_COMMANDS = {
ACCEPT_JOIN_REQUEST: 'AcceptJoinRequest',
DECLINE_JOIN_REQUEST: 'DeclineJoinRequest',
CREATE_POLICY_TAX: 'CreatePolicyTax',
SET_POLICY_TAXES_ENABLED: 'SetPolicyTaxesEnabled',
DELETE_POLICY_TAXES: 'DeletePolicyTaxes',
UPDATE_POLICY_TAX_VALUE: 'UpdatePolicyTaxValue',
RENAME_POLICY_TAX: 'RenamePolicyTax',
CREATE_POLICY_DISTANCE_RATE: 'CreatePolicyDistanceRate',
SET_POLICY_DISTANCE_RATES_UNIT: 'SetPolicyDistanceRatesUnit',
SET_POLICY_DISTANCE_RATES_DEFAULT_CATEGORY: 'SetPolicyDistanceRatesDefaultCategory',
Expand Down Expand Up @@ -365,7 +369,11 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.SET_POLICY_CUSTOM_TAX_NAME]: Parameters.SetPolicyCustomTaxNameParams;
[WRITE_COMMANDS.SET_POLICY_TAXES_FOREIGN_CURRENCY_DEFAULT]: Parameters.SetPolicyForeignCurrencyDefaultParams;
[WRITE_COMMANDS.CREATE_POLICY_TAX]: Parameters.CreatePolicyTaxParams;
[WRITE_COMMANDS.SET_POLICY_TAXES_ENABLED]: Parameters.SetPolicyTaxesEnabledParams;
[WRITE_COMMANDS.DELETE_POLICY_TAXES]: Parameters.DeletePolicyTaxesParams;
[WRITE_COMMANDS.UPDATE_POLICY_TAX_VALUE]: Parameters.UpdatePolicyTaxValueParams;
[WRITE_COMMANDS.CREATE_POLICY_DISTANCE_RATE]: Parameters.CreatePolicyDistanceRateParams;
[WRITE_COMMANDS.RENAME_POLICY_TAX]: Parameters.RenamePolicyTaxParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_UNIT]: Parameters.SetPolicyDistanceRatesUnitParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_DEFAULT_CATEGORY]: Parameters.SetPolicyDistanceRatesDefaultCategoryParams;
};
Expand Down
16 changes: 16 additions & 0 deletions src/libs/ErrorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ function getEarliestErrorField<TOnyxData extends OnyxDataWithErrorFields>(onyxDa
return {[key]: getErrorMessageWithTranslationData(errorsForField[key])};
}

/**
* Method used to get the latest error field for any field
*/
function getLatestErrorFieldForAnyField<TOnyxData extends OnyxDataWithErrorFields>(onyxData: TOnyxData): Errors {
const errorFields = onyxData.errorFields ?? {};

if (Object.keys(errorFields).length === 0) {
return {};
}

const fieldNames = Object.keys(errorFields);
const latestErrorFields = fieldNames.map((fieldName) => getLatestErrorField(onyxData, fieldName));
return latestErrorFields.reduce((acc, error) => ({...acc, ...error}), {});
}

/**
* Method used to attach already translated message with isTranslated property
* @param errors - An object containing current errors in the form
Expand Down Expand Up @@ -176,6 +191,7 @@ export {
getLatestErrorField,
getLatestErrorMessage,
getLatestErrorMessageField,
getLatestErrorFieldForAnyField,
getMicroSecondOnyxError,
getMicroSecondOnyxErrorObject,
isReceiptError,
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.SETTINGS.EXIT_SURVEY.CONFIRM]: () => require('../../../pages/settings/ExitSurvey/ExitSurveyConfirmPage').default as React.ComponentType,
[SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY]: () => require('../../../pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage').default as React.ComponentType,
[SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET]: () => require('../../../pages/workspace/workflows/WorkspaceAutoReportingMonthlyOffsetPage').default as React.ComponentType,
[SCREENS.WORKSPACE.TAX_EDIT]: () => require('../../../pages/workspace/taxes/WorkspaceEditTaxPage').default as React.ComponentType,
[SCREENS.WORKSPACE.TAX_NAME]: () => require('../../../pages/workspace/taxes/NamePage').default as React.ComponentType,
[SCREENS.WORKSPACE.TAX_VALUE]: () => require('../../../pages/workspace/taxes/ValuePage').default as React.ComponentType,
[SCREENS.WORKSPACE.TAX_CREATE]: () => require('../../../pages/workspace/taxes/WorkspaceCreateTaxPage').default as React.ComponentType,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const FULL_SCREEN_TO_RHP_MAPPING: Partial<Record<FullScreenName, string[]>> = {
SCREENS.WORKSPACE.TAXES_SETTINGS_CUSTOM_TAX_NAME,
SCREENS.WORKSPACE.TAXES_SETTINGS_FOREIGN_CURRENCY_DEFAULT,
SCREENS.WORKSPACE.TAXES_SETTINGS_WORKSPACE_CURRENCY_DEFAULT,
SCREENS.WORKSPACE.TAX_CREATE,
SCREENS.WORKSPACE.TAX_EDIT,
SCREENS.WORKSPACE.TAX_NAME,
SCREENS.WORKSPACE.TAX_VALUE,
],
[SCREENS.WORKSPACE.TAGS]: [SCREENS.WORKSPACE.TAGS_SETTINGS, SCREENS.WORKSPACE.TAGS_EDIT, SCREENS.WORKSPACE.TAG_CREATE, SCREENS.WORKSPACE.TAG_SETTINGS, SCREENS.WORKSPACE.TAG_EDIT],
[SCREENS.WORKSPACE.CATEGORIES]: [SCREENS.WORKSPACE.CATEGORY_CREATE, SCREENS.WORKSPACE.CATEGORY_SETTINGS, SCREENS.WORKSPACE.CATEGORIES_SETTINGS, SCREENS.WORKSPACE.CATEGORY_EDIT],
Expand Down
9 changes: 9 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.WORKSPACE.TAX_CREATE]: {
path: ROUTES.WORKSPACE_TAX_CREATE.route,
},
[SCREENS.WORKSPACE.TAX_EDIT]: {
path: ROUTES.WORKSPACE_TAX_EDIT.route,
},
[SCREENS.WORKSPACE.TAX_NAME]: {
path: ROUTES.WORKSPACE_TAX_NAME.route,
},
[SCREENS.WORKSPACE.TAX_VALUE]: {
path: ROUTES.WORKSPACE_TAX_VALUE.route,
},
},
},
[SCREENS.RIGHT_MODAL.PRIVATE_NOTES]: {
Expand Down
12 changes: 12 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,18 @@ type SettingsNavigatorParamList = {
[SCREENS.WORKSPACE.TAX_CREATE]: {
policyID: string;
};
[SCREENS.WORKSPACE.TAX_EDIT]: {
policyID: string;
taxID: string;
};
[SCREENS.WORKSPACE.TAX_NAME]: {
policyID: string;
taxID: string;
};
[SCREENS.WORKSPACE.TAX_VALUE]: {
policyID: string;
taxID: string;
};
} & ReimbursementAccountNavigatorParamList;

type NewChatNavigatorParamList = {
Expand Down
18 changes: 16 additions & 2 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {ValueOf} from 'type-fest';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {PersonalDetailsList, Policy, PolicyCategories, PolicyMembers, PolicyTagList, PolicyTags} from '@src/types/onyx';
import type {PersonalDetailsList, Policy, PolicyCategories, PolicyMembers, PolicyTagList, PolicyTags, TaxRate} from '@src/types/onyx';
import type {PolicyFeatureName} from '@src/types/onyx/Policy';
import type {EmptyObject} from '@src/types/utils/EmptyObject';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -35,7 +35,7 @@ function hasPolicyMemberError(policyMembers: OnyxEntry<PolicyMembers>): boolean
* Check if the policy has any tax rate errors.
*/
function hasTaxRateError(policy: OnyxEntry<Policy>): boolean {
return Object.values(policy?.taxRates?.taxes ?? {}).some((taxRate) => Object.keys(taxRate?.errors ?? {}).length > 0);
return Object.values(policy?.taxRates?.taxes ?? {}).some((taxRate) => Object.keys(taxRate?.errors ?? {}).length > 0 || Object.values(taxRate?.errorFields ?? {}).some(Boolean));
}

/**
Expand Down Expand Up @@ -277,6 +277,18 @@ function goBackFromInvalidPolicy() {
Navigation.navigate(ROUTES.SETTINGS_WORKSPACES);
}

/** Get a tax with given ID from policy */
function getTaxByID(policy: OnyxEntry<Policy>, taxID: string): TaxRate | undefined {
return policy?.taxRates?.taxes?.[taxID];
}

/**
* Whether the tax rate can be deleted and disabled
*/
function canEditTaxRate(policy: Policy, taxID: string): boolean {
return policy.taxRates?.defaultExternalID !== taxID;
}

function isPolicyFeatureEnabled(policy: OnyxEntry<Policy> | EmptyObject, featureName: PolicyFeatureName): boolean {
if (featureName === CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED) {
return Boolean(policy?.tax?.trackingEnabled);
Expand Down Expand Up @@ -305,6 +317,7 @@ export {
getIneligibleInvitees,
getTagLists,
getTagListName,
canEditTaxRate,
getTagList,
getCleanedTagName,
getCountOfEnabledTagsOfList,
Expand All @@ -317,6 +330,7 @@ export {
goBackFromInvalidPolicy,
isPolicyFeatureEnabled,
hasTaxRateError,
getTaxByID,
hasPolicyCategoriesError,
};

Expand Down
5 changes: 3 additions & 2 deletions src/libs/ValidationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,9 @@ function isValidPercentage(value: string): boolean {
/**
* Validates the given value if it is correct tax name.
*/
function isExistingTaxName(value: string, taxRates: TaxRates): boolean {
return !!Object.values(taxRates).find((taxRate) => taxRate.name === value);
function isExistingTaxName(taxName: string, taxRates: TaxRates): boolean {
const trimmedTaxName = taxName.trim();
return !!Object.values(taxRates).find((taxRate) => taxRate.name === trimmedTaxName);
}

export {
Expand Down
3 changes: 2 additions & 1 deletion src/libs/WorkspacesSettingsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ function hasGlobalWorkspaceSettingsRBR(policies: OnyxCollection<Policy>, policyM

function hasWorkspaceSettingsRBR(policy: Policy) {
const policyMemberError = allPolicyMembers ? hasPolicyMemberError(allPolicyMembers[`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policy.id}`]) : false;
const taxRateError = hasTaxRateError(policy);

return Object.keys(reimbursementAccount?.errors ?? {}).length > 0 || hasPolicyError(policy) || hasCustomUnitsError(policy) || policyMemberError;
return Object.keys(reimbursementAccount?.errors ?? {}).length > 0 || hasPolicyError(policy) || hasCustomUnitsError(policy) || policyMemberError || taxRateError;
}

function getChatTabBrickRoad(policyID?: string): BrickRoad | undefined {
Expand Down
Loading

0 comments on commit bf96b22

Please sign in to comment.