[CP Staging] Revert "Add itemized receipt requirement settings for workspace and category rules"#80565
[CP Staging] Revert "Add itemized receipt requirement settings for workspace and category rules"#80565
Conversation
|
@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] |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
There was a problem hiding this comment.
💡 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".
| 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)); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 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.
|
|
I tested it on the adhoc build and i still can reproduce it Screen.Recording.2026-01-27.at.01.57.59.mov |
|
The issue was found as not a blocker in the end so this revert was also not needed |
Reverts #73939
Fixed issues
$ #80559