Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libs/actions/Policy/CopyPolicySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,12 +51,16 @@ const PARTS_TO_POLICY_FIELDS = {
'maxExpenseAmountNoReceipt',
'maxExpenseAmountNoItemizedReceipt',
'defaultBillable',
'defaultReimbursable',
'prohibitedExpenses',
'eReceipts',
'isAttendeeTrackingEnabled',
'preventSelfApproval',
'disabledFields',
'glCodes',
'shouldShowAutoApprovalOptions',
'shouldShowAutoReimbursementLimitOption',
'customRules',
Comment thread
ishpaul777 marked this conversation as resolved.
],
codingRules: ['rules'],
distanceRates: ['areDistanceRatesEnabled', 'customUnits'],
Expand Down
12 changes: 12 additions & 0 deletions src/pages/workspace/duplicate/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading