Repository navigation
Prevent adding expenses to bills - #105966
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@neil-marcellini 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] |
There was a problem hiding this comment.
NAB/follow-up: create BillUtils and pull bill-specific functions out of ReportUtils into it. ReportUtils is too long to support syntax highlighting. This function could go in BillUtils
There was a problem hiding this comment.
Done in #106122. It adds src/libs/BillUtils.ts with isBillReport and shouldHideBillReport, and removes src/libs/isBillReport.ts.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb Safari |
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.33-0 🚀
|
|
No FullStory changes needed — this PR only fixes incorrect expense-creation options on bills and adds defensive guards, without introducing new UI, screens, user properties, or sensitive content. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.5.33-1 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
A bill mirrors the vendor's invoice. Its expenses come only from that invoice, so users must not add expenses to a bill. We decided this in https://expensify.slack.com/archives/C0C3YKA2Z16/p1793667364423009.
This PR adds
isBillReportinsrc/libs/isBillReport.tsand uses it in three places:getMoneyRequestOptionsreturns no options for bills. This fixes a bug on main. Today the composer's + menu and drag and drop offer Submit expense and Track expense on a bill.canAddTransactionrejects bills. This hides Add expense in the More menu and on the report.isReportOutstandingrejects bills. This keeps bills out of the report lists where users pick which report an expense goes to. Those lists show when you create an expense or change an expense's report.On main,
canAddTransactionandisReportOutstandingalready return false for bills, becauseisExpenseReportexcludes them. A later PR makesisExpenseReportreturn true for bills. These checks keep bills blocked after that change.Note for reviewers: a later PR moves the bill type from
CONST.REPORT.UNSUPPORTED_TYPE.BILLtoCONST.REPORT.TYPE.BILL. Whichever PR merges second updatesisBillReport.ts.Fixed Issues
For https://github.com/Expensify/Expensify/issues/684654
PROPOSAL:
Tests
/r/<billReportID>to open the bill.Offline tests
QA Steps
Ping @cead22
/r/<billReportID>to open the bill.The More menu, Add expense button and report picker checks on bills can only run after the PR that opens bills in New Expensify is deployed.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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
The author adds these.
Android: mWeb Chrome
The author adds these.
iOS: Native
The author adds these.
iOS: mWeb Safari
The author adds these.
MacOS: Chrome / Safari
The author adds these.
Expense Report



