Add billing restriction check for Per Diem move-to-new-report#86616
Add billing restriction check for Per Diem move-to-new-report#86616
Conversation
…port flow Co-authored-by: dukenv0307 <dukenv0307@users.noreply.github.com>
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.
|
|
@MelvinBot can we move the logic of shouldRestrictUserBillableActions to the top? |
Co-authored-by: dukenv0307 <129500732+dukenv0307@users.noreply.github.com> Co-authored-by: dukenv0307 <dukenv0307@users.noreply.github.com>
|
Moved the |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-30.at.09.42.00.movAndroid: mWeb ChromeScreen.Recording.2026-03-30.at.09.37.00.moviOS: HybridAppScreen.Recording.2026-03-30.at.09.39.33.moviOS: mWeb SafariScreen.Recording.2026-03-30.at.09.37.10.movMacOS: Chrome / SafariScreen.Recording.2026-03-30.at.09.35.37.mov |
|
@MelvinBot open the PR |
|
@dukenv0307 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] |
|
Done — PR is now marked as ready for review. |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #86579 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
I think it's a little weird to block users from creating new reports in this case, but at least it's consistent with how we block from manually creating an expenses or report. Do you agree from a product standpoint @joekaufmanexpensify? |
|
Ugh there's a conflict, @dukenv0307 can you ask Melvin to fix it? I think it should be able to 🤞 |
|
@MelvinBot resolve the conflicts |
…licts Co-authored-by: dukenv0307 <dukenv0307@users.noreply.github.com>
|
@dukenv0307 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] |
|
Resolved the merge conflicts in both files:
What happened: I also fixed the variable names in the top-of-function check ( |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
🚧 @francoisl 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/francoisl in version: 9.3.52-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a purely internal logic fix that moves an existing billing restriction check (
The existing Per Diem help articles (Per-Diem-Expenses.md, Configure-Per-Diem-in-a-workspace.md) document how to create and configure Per Diem expenses — they don't cover internal billing enforcement behavior, which is what this fix addresses. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.52-9 🚀
|
Explanation of Change
When a Per Diem expense is moved to a "New report" via the "Move expense" action, the
createReportfunction in bothIOURequestEditReport.tsxandIOURequestStepReport.tsxreturns early for Per Diem transactions without checkingshouldRestrictUserBillableActions(). This allows Per Diem expenses to bypass the billing grace period restriction and create new reports when they should be blocked.This PR adds the
shouldRestrictUserBillableActionscheck inside the Per Diem early-return path in both files, mirroring the existing check already used for non-Per-Diem expenses in the same functions.Fixed Issues
$ #86579
PROPOSAL: #86579 (comment)
Tests
Onyx.merge('sharedNVP_private_billingGracePeriodEnd_[accountID]', {value: 1})Offline tests
N/A — Billing restriction state is stored locally in Onyx and the restriction check is synchronous. Offline behavior is unchanged.
QA Steps
Onyx.merge('sharedNVP_private_billingGracePeriodEnd_[accountID]', {value: 1})Onyx.merge('sharedNVP_private_billingGracePeriodEnd_[accountID]', null)PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — Logic-only change, no UI modifications
Android: mWeb Chrome
N/A — Logic-only change, no UI modifications
iOS: Native
N/A — Logic-only change, no UI modifications
iOS: mWeb Safari
N/A — Logic-only change, no UI modifications
MacOS: Chrome / Safari
N/A — Logic-only change, no UI modifications