Report - "Outstanding" seen as status when cancelling payment offline with approvals disabled#73936
Conversation
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 217 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Hi @suneox 👋 We need two test steps for this issue, right? I'm using the test steps from this PR #56950, but I cannot see the delete button until I retract the expense. Am I doing something wrong, or has the behavior changed since the PR is 9 months old? REC-20251101173812.mp4Thanks. |
Yes, please do that.
the Retract action is simply a new label for Undo submit, so your steps are correct with the current flow |
|
@mohammadjafarinejad Could you please also address the bot’s code review comment about the redundant ternary operator? Also update the test steps to match your current testing behavior. |
Added Test 2 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-06.at.01.09.20.mp4Android: mWeb ChromeScreen.Recording.2025-11-06.at.01.04.47.mp4iOS: HybridAppScreen.Recording.2025-11-06.at.01.07.41.mp4iOS: mWeb SafariScreen.Recording.2025-11-06.at.01.01.19.mp4MacOS: Chrome / SafariScreen.Recording.2025-11-06.at.00.56.15.mp4MacOS: DesktopScreen.Recording.2025-11-06.at.00.58.35.mp4 |
|
✋ 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/Julesssss in version: 9.2.45-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.45-6 🚀
|
…ext step separately Reverts the statusNum change that caused regression on Expensify#72750. The optimistic stateNum/statusNum (Approved/Closed) was correctly set by PR Expensify#73936. Instead of changing the report status, we now pass SUBMITTED as the predictedNextStatus only to the next step builders, so the report status stays CLOSED while the next step message correctly shows "waiting to pay". Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
| const stateNum: ValueOf<typeof CONST.REPORT.STATE_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATE_NUM.SUBMITTED : CONST.REPORT.STATE_NUM.APPROVED; | ||
| const statusNum: ValueOf<typeof CONST.REPORT.STATUS_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATUS_NUM.SUBMITTED : CONST.REPORT.STATUS_NUM.APPROVED; | ||
| const stateNum: ValueOf<typeof CONST.REPORT.STATE_NUM> = CONST.REPORT.STATE_NUM.APPROVED; | ||
| const statusNum: ValueOf<typeof CONST.REPORT.STATUS_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATUS_NUM.CLOSED : CONST.REPORT.STATUS_NUM.APPROVED; |
There was a problem hiding this comment.
This change was too broad. Next step message was not considered so it caused Expense - "Waiting for you to approve expenses" after Cancel Payment if Approvals is OFF
For OPTIONAL approval mode with a connected bank account, the report status is CLOSED but the next step should show "waiting to pay", so we should use SUBMITTED as the predictedNextStatus which routes through the correct next step path. Without a bank account, keep CLOSED which shows "no further action required".
Fixed in #90719
Explanation of Change
This PR fixes the issue where canceled payments incorrectly showed "Outstanding" status instead of "Done" when approvals are disabled.
Fixed Issues
$ #72750
PROPOSAL: #72750 (comment)
Tests
Test 1
When payment of an expense is canceled, the status should change to "Done" instead of "Outstanding" if approvals are disabled.
Prerequisite: Delayed submissions enabled and approvals disabled.
Test 2
Prerequisite: Add approvals disabled and Delayed Submission disabled.
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
FIX_72750_ANDROID.mp4
Android: mWeb Chrome
FIX_72750_ANDROID_WEB.mp4
iOS: Native
FIX_72750_IOS.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
FIX_72750_WEB.mp4
MacOS: Desktop
FIX_72750_DESKTOP.mp4