Fix Reimbursable row appearing when tax or billable triggers breakdown#85117
Fix Reimbursable row appearing when tax or billable triggers breakdown#85117
Conversation
…ers breakdown Reverts the outOfPocket row visibility condition from PR #84792 to match Classic (OD) behavior: the Reimbursable row only shows when there are non-reimbursable expenses, not whenever reimbursableSpend > 0. Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The failing check ( Failing test: Error: Analysis: The mock file imports Evidence this is unrelated:
This appears to be a pre-existing flaky test issue with the |
|
@MelvinBot Changes LGTM. Mark pr as |
|
PR has been marked as ready for review as requested. ✅ |
| <View style={[styles.dFlex, styles.alignItemsEnd, styles.gap2, styles.mb2, styles.flex1]}> | ||
| {[ | ||
| {text: 'cardTransactions.outOfPocket', value: formattedOutOfPocketAmount, shouldShow: !!reimbursableSpend}, | ||
| {text: 'cardTransactions.outOfPocket', value: formattedOutOfPocketAmount, shouldShow: shouldShowExpenseReportBreakDown}, |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The two files that render the expense breakdown section (MoneyReportView.tsx and MoneyRequestReportTransactionList.tsx) use different conditions for the same outOfPocket row visibility:
MoneyReportView.tsx(line 253):show: !!nonReimbursableSpendMoneyRequestReportTransactionList.tsx(line 733):shouldShow: shouldShowExpenseReportBreakDown
While both aim to express "show the Reimbursable row when there are non-reimbursable expenses," they use different mechanisms. shouldShowExpenseReportBreakDown checks if any transaction is non-reimbursable (transaction-level check), while !!nonReimbursableSpend checks the aggregated monetary amount (amount-level check). These could diverge in edge cases (e.g., non-reimbursable expenses that net to zero). Since nonReimbursableSpend is already available in this file (line 180) and would be consistent with how the adjacent companySpend row works in both files, consider using !!nonReimbursableSpend here as well:
{text: 'cardTransactions.outOfPocket', value: formattedOutOfPocketAmount, shouldShow: !!nonReimbursableSpend},Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
I think we can make this consistent with others
@MelvinBot Let us use !!nonReimbursableSpend as suggested. What do you think?
There was a problem hiding this comment.
Good call — using !!nonReimbursableSpend here makes both files consistent with each other and with the adjacent companySpend row. Updated in 6b37a8c.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppRan into build issues with android hybrid but I think it is fine to skip this as the changes here are not platform specific. Android: mWeb Chrome85117-mweb-chrome-001.mp4iOS: HybridApp85117-ios-hybrid-001.mp4iOS: mWeb Safari85117-mweb-safari-001.mp4MacOS: Chrome / Safari85117-web-chrome-001.mp4 |
|
The failing check Failing test: Analysis: The error originates in Evidence this is unrelated:
The other failing check ( A re-run of the test job should resolve this. The underlying mock bug should be tracked separately. |
|
@MelvinBot Please address the comment here |
Update the outOfPocket row shouldShow condition in MoneyRequestReportTransactionList.tsx to use !!nonReimbursableSpend, matching MoneyReportView.tsx and the adjacent companySpend row. Co-authored-by: Roji Philip <rojiphil@users.noreply.github.com>
|
@parasharrajat @deetergp One of you needs to 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] |
|
@jjcoffee @parasharrajat please ignore the review request here. Thanks. |
|
The failing check is unrelated to this PR's changes. Failing test: Error: Root cause: The mock file imports Why this is unrelated:
|
|
🚧 @deetergp 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! 🧪🧪
|
…ibility Fix Reimbursable row appearing when tax or billable triggers breakdown (cherry picked from commit 75c590e) (cherry-picked to staging by luacmartins)
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 9.3.36-10 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.36-10 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 9.3.37-0 🚀
|
Explanation of Change
PR #84792 changed the "Reimbursable" (outOfPocket) row visibility condition from checking for the presence of non-reimbursable expenses to simply checking
!!reimbursableSpend. SincereimbursableSpendis always > 0 for any normal reimbursable expense, the Reimbursable row now appears anytime the breakdown section is visible — including when the breakdown is only triggered by tax or billable amounts. This causes a redundant "Reimbursable" row showing the same value as "Total".This PR reverts the outOfPocket row condition in both components to match Classic (OD) behavior, as directed by
JmillsExpensifyin this comment:show: !!reimbursableSpend→show: !!nonReimbursableSpendshouldShow: !!reimbursableSpend→shouldShow: shouldShowExpenseReportBreakDownThe Reimbursable row now only appears when there are non-reimbursable expenses (a genuine split), while the companySpend fix from PR #84792 is preserved.
Fixed Issues
$ #84968
PROPOSAL: #84968 (comment)
Tests
Offline tests
No offline-specific behavior changes — this is a purely visual/conditional rendering fix that depends on local report data already available in Onyx.
QA Steps
Same as tests above.
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
Web: Tested via automated browser testing
Scenario 1 — Single reimbursable expense with 5% tax: breakdown shows only Tax row, no redundant "Reimbursable" row.
Scenario 2 — Mixed reimbursable + non-reimbursable expenses: both "Reimbursable" and "Non-reimbursable" rows correctly appear alongside Tax row.