diff --git a/src/libs/actions/Policy/CopyPolicySettings.ts b/src/libs/actions/Policy/CopyPolicySettings.ts index 866e28372e42..3aee0eb5a6d1 100644 --- a/src/libs/actions/Policy/CopyPolicySettings.ts +++ b/src/libs/actions/Policy/CopyPolicySettings.ts @@ -38,7 +38,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 @@ -51,12 +51,16 @@ const PARTS_TO_POLICY_FIELDS = { 'maxExpenseAmountNoReceipt', 'maxExpenseAmountNoItemizedReceipt', 'defaultBillable', + 'defaultReimbursable', 'prohibitedExpenses', 'eReceipts', 'isAttendeeTrackingEnabled', 'preventSelfApproval', + 'disabledFields', + 'glCodes', 'shouldShowAutoApprovalOptions', 'shouldShowAutoReimbursementLimitOption', + 'customRules', ], codingRules: ['rules'], distanceRates: ['areDistanceRatesEnabled', 'customUnits'], 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; }