From 014690f20e6184588b00dd7f69c7828cb7f33706 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 18 Jun 2026 18:14:18 +0530 Subject: [PATCH 1/2] CopyPolicySettings: add missing rules and categories fields Add defaultReimbursable, disabledFields, glCodes, and customRules to the rules part optimistic update fields. Add requiresCategory to the categories part. Matches the new fields being copied on the Auth side. --- src/libs/actions/Policy/CopyPolicySettings.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Policy/CopyPolicySettings.ts b/src/libs/actions/Policy/CopyPolicySettings.ts index d646bac6e0be..e2753d9431ba 100644 --- a/src/libs/actions/Policy/CopyPolicySettings.ts +++ b/src/libs/actions/Policy/CopyPolicySettings.ts @@ -33,7 +33,7 @@ const PARTS_TO_POLICY_FIELDS = { members: ['employeeList'], reports: ['fieldList', 'areReportFieldsEnabled'], accounting: ['connections', 'areConnectionsEnabled'], - categories: ['areCategoriesEnabled'], + categories: ['areCategoriesEnabled', 'requiresCategory'], tags: ['areTagsEnabled'], taxes: ['tax', 'taxRates'], // achAccount is intentionally excluded — the backend remaps bankAccountID per-caller @@ -46,12 +46,16 @@ const PARTS_TO_POLICY_FIELDS = { 'maxExpenseAmountNoReceipt', 'maxExpenseAmountNoItemizedReceipt', 'defaultBillable', + 'defaultReimbursable', 'prohibitedExpenses', 'eReceipts', 'isAttendeeTrackingEnabled', 'preventSelfApproval', + 'disabledFields', + 'glCodes', 'shouldShowAutoApprovalOptions', 'shouldShowAutoReimbursementLimitOption', + 'customRules', ], codingRules: ['rules'], distanceRates: ['areDistanceRatesEnabled', 'customUnits'], From f445bda19a2f9d069ea5af4fb2aceb98794aafb5 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Mon, 27 Jul 2026 13:20:04 +0530 Subject: [PATCH 2/2] Include new rule fields in the rules-row eligibility gate --- src/pages/workspace/duplicate/utils.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pages/workspace/duplicate/utils.ts b/src/pages/workspace/duplicate/utils.ts index 7974f0ebc877..c373d790cf61 100644 --- a/src/pages/workspace/duplicate/utils.ts +++ b/src/pages/workspace/duplicate/utils.ts @@ -48,6 +48,18 @@ function getWorkspaceRules(policy: Policy | undefined, translate: LocaleContextP if (policy?.shouldShowAutoReimbursementLimitOption && !autoPayApprovedReportsUnavailable) { total.push(translate('workspace.rules.expenseReportRules.autoPayApprovedReportsTitle')); } + if (policy?.customRules) { + total.push(translate('workspace.rules.customRules.title')); + } + if (policy?.glCodes) { + total.push(translate('workspace.categories.glCode')); + } + + // defaultReimbursable defaults to true, so a flipped default or a hidden billable/reimbursable field + // (disabledFields) both indicate a non-default cash expense rule worth copying. + if (policy?.defaultReimbursable === false || Object.values(policy?.disabledFields ?? {}).some(Boolean)) { + total.push(translate('workspace.rules.individualExpenseRules.cashExpenseDefault')); + } return total.length > 0 ? total : null; }