Skip to content

[CP Staging] Revert "Add itemized receipt requirement settings for workspace and category rules"#80565

Closed
mountiny wants to merge 1 commit intomainfrom
revert-73939-feature/itemized-receipt-requirements
Closed

[CP Staging] Revert "Add itemized receipt requirement settings for workspace and category rules"#80565
mountiny wants to merge 1 commit intomainfrom
revert-73939-feature/itemized-receipt-requirements

Conversation

@mountiny
Copy link
Contributor

Reverts #73939

Fixed issues

$ #80559

@mountiny mountiny self-assigned this Jan 27, 2026
@mountiny mountiny requested review from a team as code owners January 27, 2026 00:49
@melvin-bot melvin-bot bot requested review from parasharrajat and removed request for a team January 27, 2026 00:49
@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2026

@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot requested review from JmillsExpensify and removed request for a team January 27, 2026 00:49
@github-actions
Copy link
Contributor

🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #80565.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Web 🕸️
https://80565.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2367394a20

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +42 to +44
const maxExpenseAmountToDisplay = policy?.maxExpenseAmountNoReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE ? 0 : policy?.maxExpenseAmountNoReceipt;

if (policy?.maxExpenseAmountNoItemizedReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE || policy?.maxExpenseAmountNoItemizedReceipt === undefined) {
return translate(`workspace.rules.categoryRules.requireItemizedReceiptsOverList.never`);
}

return translate(
`workspace.rules.categoryRules.requireItemizedReceiptsOverList.default`,
convertToDisplayString(policy.maxExpenseAmountNoItemizedReceipt, policy?.outputCurrency ?? CONST.CURRENCY.USD),
);
return translate(`workspace.rules.categoryRules.requireReceiptsOverList.default`, convertToShortDisplayString(maxExpenseAmountToDisplay, policy?.outputCurrency ?? CONST.CURRENCY.USD));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show “never” when policy disables receipts

When the workspace rule is set to “never require receipts” (maxExpenseAmountNoReceipt = DISABLED_MAX_EXPENSE_VALUE), this forces the default amount to 0 and formats it as “$0 • Default.” That label corresponds to “always require receipts,” so the category settings summary misrepresents the effective policy. Admins in this configuration will see a default that implies the opposite behavior. Consider preserving the “never” label or hiding the default option when the policy is disabled (as the previous logic did).

Useful? React with 👍 / 👎.

const isAlwaysSelected = policyCategories?.[categoryName]?.maxAmountNoReceipt === 0;
const isNeverSelected = policyCategories?.[categoryName]?.maxAmountNoReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE;
const isPolicyReceiptDisabled = policy?.maxExpenseAmountNoReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE || policy?.maxExpenseAmountNoReceipt === undefined;
const maxExpenseAmountToDisplay = policy?.maxExpenseAmountNoReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE ? 0 : policy?.maxExpenseAmountNoReceipt;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Default option mislabels disabled receipt policy

On the category rule selection screen, if the workspace rule is “never require receipts” (DISABLED_MAX_EXPENSE_VALUE), this code substitutes 0 for the policy amount, so the default option renders as “$0 • Default.” That implies “always require receipts,” even though selecting it clears the override back to “never.” This is misleading specifically when the policy-level rule is disabled.

Useful? React with 👍 / 👎.

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 83.89% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/ROUTES.ts 13.32% <ø> (-0.08%) ⬇️
src/SCREENS.ts 100.00% <ø> (ø)
...m/TransactionPreview/TransactionPreviewContent.tsx 76.08% <ø> (ø)
src/hooks/useViolations.ts 3.12% <ø> (-47.65%) ⬇️
src/libs/API/types.ts 100.00% <ø> (ø)
...gation/AppNavigator/ModalStackNavigators/index.tsx 8.01% <ø> (+0.02%) ⬆️
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 75.00% <ø> (ø)
... and 13 more
... and 6 files with indirect coverage changes

@abzokhattab
Copy link
Contributor

I tested it on the adhoc build and i still can reproduce it

Screen.Recording.2026-01-27.at.01.57.59.mov

@mountiny
Copy link
Contributor Author

The issue was found as not a blocker in the end so this revert was also not needed

@mountiny mountiny closed this Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants