From 6cc796e33d52e2cf40bbc3730a53bbac6084096e Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 00:57:53 +0300 Subject: [PATCH 1/8] category title to name --- src/pages/workspace/categories/CategorySettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/categories/CategorySettingsPage.tsx b/src/pages/workspace/categories/CategorySettingsPage.tsx index 2732a928b6a4..6955e3fce767 100644 --- a/src/pages/workspace/categories/CategorySettingsPage.tsx +++ b/src/pages/workspace/categories/CategorySettingsPage.tsx @@ -131,7 +131,7 @@ function CategorySettingsPage({route, policyCategories, navigation}: CategorySet From 34d80a6f10026e23709a82347636b15d1ce6cdad Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 01:04:42 +0300 Subject: [PATCH 2/8] enable payroll --- src/pages/workspace/categories/CategorySettingsPage.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/workspace/categories/CategorySettingsPage.tsx b/src/pages/workspace/categories/CategorySettingsPage.tsx index 6955e3fce767..d1d605759d36 100644 --- a/src/pages/workspace/categories/CategorySettingsPage.tsx +++ b/src/pages/workspace/categories/CategorySettingsPage.tsx @@ -41,7 +41,6 @@ function CategorySettingsPage({route, policyCategories, navigation}: CategorySet const [deleteCategoryConfirmModalVisible, setDeleteCategoryConfirmModalVisible] = useState(false); const backTo = route.params?.backTo; const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${route.params.policyID}`); - const shouldDisablePayrollCode = !isControlPolicy(policy); const policyCategory = policyCategories?.[route.params.categoryName] ?? Object.values(policyCategories ?? {}).find((category) => category.previousCategoryName === route.params.categoryName); @@ -162,7 +161,6 @@ function CategorySettingsPage({route, policyCategories, navigation}: CategorySet Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_PAYROLL_CODE.getRoute(route.params.policyID, policyCategory.name)); }} shouldShowRightIcon - disabled={shouldDisablePayrollCode} /> {!isThereAnyAccountingConnection && ( From 878bbab0b36076452fc0bb051d12e7f09939f5b7 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 01:09:24 +0300 Subject: [PATCH 3/8] enable tax code --- src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx index 08e7be149ad0..64dfae422e39 100644 --- a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx @@ -39,7 +39,6 @@ function WorkspaceEditTaxPage({ const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); const canEditTaxRate = policy && PolicyUtils.canEditTaxRate(policy, taxID); const hasAccountingConnections = PolicyUtils.hasAccountingConnections(policy); - const canEditTaxCode = !PolicyUtils.isControlPolicy(policy); const shouldShowDeleteMenuItem = canEditTaxRate && !hasAccountingConnections; @@ -135,8 +134,13 @@ function WorkspaceEditTaxPage({ description={translate('workspace.taxes.taxCode')} style={[styles.moneyRequestMenuItem]} titleStyle={styles.flex1} - disabled={canEditTaxCode} - onPress={() => Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID))} + onPress={() => { + if (!PolicyUtils.isControlPolicy(policy)) { + Navigation.navigate(ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, CONST.UPGRADE_FEATURE_INTRO_MAPPING.glAndPayrollCodes.alias)); + return; + } + Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID)); + }} /> {shouldShowDeleteMenuItem && ( From 9a8fca120b9bdef8fe9acb67e4f917fbfccf9802 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 01:17:03 +0300 Subject: [PATCH 4/8] add spanish --- src/CONST.ts | 8 ++++++++ src/languages/en.ts | 5 +++++ src/languages/es.ts | 5 +++++ src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index e2ba7ef0aa1d..68d4217677ab 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -5356,6 +5356,14 @@ const CONST = { description: 'workspace.upgrade.glAndPayrollCodes.description' as const, icon: 'FolderOpen', }, + taxCodes: { + id: 'taxCodes' as const, + alias: 'tax-codes', + name: 'Tax codes', + title: 'workspace.upgrade.taxCodes.title' as const, + description: 'workspace.upgrade.taxCodes.description' as const, + icon: 'Coins', + }, }; }, REPORT_FIELD_TYPES: { diff --git a/src/languages/en.ts b/src/languages/en.ts index e0ed30050bb1..003a75366324 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3395,6 +3395,11 @@ export default { description: `Add GL & Payroll codes to your categories for easy export of expenses to your accounting and payroll systems.`, onlyAvailableOnPlan: 'GL & Payroll codes are only available on the Control plan, starting at ', }, + taxCodes: { + title: 'Tax codes', + description: `Add tax codes to your taxes for easy export of expenses to your accounting and payroll systems.`, + onlyAvailableOnPlan: 'Tax codes are only available on the Control plan, starting at ', + }, pricing: { amount: '$9 ', perActiveMember: 'per active member per month.', diff --git a/src/languages/es.ts b/src/languages/es.ts index e56ae303a813..987ff41f5025 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3450,6 +3450,11 @@ export default { description: `Añada códigos de libro mayor y nómina a sus categorías para exportar fácilmente los gastos a sus sistemas de contabilidad y nómina.`, onlyAvailableOnPlan: 'Los códigos de libro mayor y nómina solo están disponibles en el plan Control, a partir de ', }, + taxCodes: { + title: 'Código de impuesto', + description: `Añada código de impuesto mayor a sus categorías para exportar fácilmente los gastos a sus sistemas de contabilidad y nómina.`, + onlyAvailableOnPlan: 'Los código de impuesto mayor solo están disponibles en el plan Control, a partir de ', + }, note: { upgradeWorkspace: 'Mejore su espacio de trabajo para acceder a esta función, o', learnMore: 'más información', diff --git a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx index 64dfae422e39..32dcb538fbdd 100644 --- a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx @@ -136,7 +136,7 @@ function WorkspaceEditTaxPage({ titleStyle={styles.flex1} onPress={() => { if (!PolicyUtils.isControlPolicy(policy)) { - Navigation.navigate(ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, CONST.UPGRADE_FEATURE_INTRO_MAPPING.glAndPayrollCodes.alias)); + Navigation.navigate(ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, CONST.UPGRADE_FEATURE_INTRO_MAPPING.taxCodes.alias)); return; } Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID)); From 5186d4de5c03e6d41e196ab33d5e4c2fc5940a88 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 01:20:52 +0300 Subject: [PATCH 5/8] use tag name --- src/pages/workspace/tags/TagSettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/tags/TagSettingsPage.tsx b/src/pages/workspace/tags/TagSettingsPage.tsx index d73127593d37..2a03c7c8a275 100644 --- a/src/pages/workspace/tags/TagSettingsPage.tsx +++ b/src/pages/workspace/tags/TagSettingsPage.tsx @@ -130,7 +130,7 @@ function TagSettingsPage({route, policyTags, navigation}: TagSettingsPageProps) From edf21d1655aa3fcf7eb15721d0810f54dd1f1971 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Mon, 22 Jul 2024 19:26:50 +0300 Subject: [PATCH 6/8] hide tax id --- src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx index 32dcb538fbdd..54af80a59f7d 100644 --- a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx @@ -61,6 +61,7 @@ function WorkspaceEditTaxPage({ if (!currentTaxRate) { return ; } + const taxCodeToShow = PolicyUtils.isControlPolicy(policy) ? taxID : ''; return ( Date: Mon, 22 Jul 2024 19:31:13 +0300 Subject: [PATCH 7/8] dont update tax id if its not updated --- src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx b/src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx index 00cc283b9f00..3704a99dc3e2 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxCodePage.tsx @@ -52,9 +52,14 @@ function WorkspaceTaxCodePage({route}: WorkspaceTaxCodePageProps) { if (!policy) { return {}; } + const newTaxCode = values.taxCode.trim(); + if (newTaxCode === currentTaxCode) { + return {}; + } + return validateTaxCode(policy, values); }, - [policy], + [currentTaxCode, policy], ); return ( From d787c29ea39abeb3de640660791406ed1ac48c11 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Tue, 30 Jul 2024 18:49:56 +0300 Subject: [PATCH 8/8] cleanup --- src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx index cc45807f40ce..bcf20bfff207 100644 --- a/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx @@ -150,7 +150,6 @@ function WorkspaceEditTaxPage({ } Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID)); }} - onPress={() => Navigation.navigate(ROUTES.WORKSPACE_TAX_CODE.getRoute(`${policyID}`, taxID))} /> {shouldShowDeleteMenuItem && (