-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2024-04-09] [Held Requests] Approving/Paying expense reports with held requests #31345
Comments
Hello, I'm Bartosz Grajdek from Software Mansion, the expert agency, and I would like to work on this task. |
There's a mistake in the task description I think
Shouldn't it say
|
Also in:
I think that the file you meant was actually |
You are correct, apologies for the confusion! 🙇 |
In progress! |
In progress! |
After a discussion with Robert, it turns out that some things weren't mentioned in the issue description, but they are necessary for it to work properly. Working on them right now and discussing everything with Robert accordingly 🙏🏻 |
We're working on getting hold functionality out first, and will raise discussion around offline flows/final items around this shortly. |
Please see main issue for a full-picture update: https://github.com/Expensify/Expensify/issues/274076#issuecomment-1878519877 |
In progress under WIP PR: #33124 |
Please see https://github.com/Expensify/Expensify/issues/274076#issuecomment-1899437428 for the latest consolidated update! |
Backend changes for this was merged and on the way out by Wednesday 🙌 |
Yo yo! @robertjchen @JmillsExpensify @BartoszGrajdek... just a heads up, I'm going to go through and prefix these project issues with |
Make sense, thanks! I've added it to all the other related GH issues from this list as well 👍 |
Latest update: https://expensify.slack.com/archives/C036QM0SLJK/p1710490163098179?thread_ts=1710203436.990009&cid=C036QM0SLJK
|
Latest update with more context/discusion on Slack. We're trying to get past a backend bug with report previews that'll allow us to continue with the FE PR. |
|
|
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
I had this blocker #39335 created which I think is related to this PR #33124. The "bug" is that when you click approve on the request preview in the "main chat" it doesn't trigger the hold confirmation model like it does when you're directly viewing the manual request. I don't actually see that mentioned in the OP though so it might just not have been considered initially. Is this something we'd want to block the roll out of the feature for? I'm leaning "no" but just want to double check that with ya'll. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
@bondydaa Ah, great catch- definitely not a blocker, but definitely a polish item we should address! |
okay coolio I'll remove the label then, want me to just assign the issue to @BartoszGrajdek and/or you? or let it go through the normal external bug flow? |
I'd say external would be good! |
Update The FE changes are on staging and we've had a few bug reports come through already:
Keep those reports coming! 🙌 |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-09. 🎊 For reference, here are some details about the assignees on this issue:
|
Suggested Implementation Guide
Paying expense reports with held requests (admin)
When paying out an expense report, we need to total up and present held and non-held amounts.
Under src/components create a new
<ProcessMoneyRequestHoldMenu
. This component will solely contain a<PopoverMenu
withiou.confirmPay
(oriou.confirmApproval
) as the header text,iou.confirmPayAmount
(or iou.confirmApprovalAmount) as the description body depending onprops.type
, followed by two<Button>
's one for the held amount and payable amount. The two props the menu takes are:props.fullAmount
props.heldAmount
props.type
- either 'pay' or 'approve'This component is only displayed if the payer can unhold the requests, which we'll determine with the function below.
In
src/components/ReportActionItem/ReportPreview.js
, update<SettlementButton
to first call a new local methodconfirmSettle()
, we will move the existingIOU.payMoneyRequest
into this new local method.The new local method would do the following:
IOU.payMoneyRequest
IOU.payMoneyRequest
<PayMoneyRequestHoldMenu
visible, passing the full and held amounts to it so that it may be displayed on the buttons.In
src/libs/actions/IOU.js
updatepayMoneyRequest()
to take a new additional flag full which will determine whether or not we pay the full amount, or just the held amounts. This flag will also be passed to the backend API as part of the call.In the case where we reveal the
<PayMoneyRequestHoldMenu
, the user has the option to pay the full amount or just the non-held amount. Depending on what they select, we'll either callIOU.payMoneyRequest
with thefull
parameter set to true or false.Approving expense reports with held requests (approvers)
Similar to the above, we'll make the same changes but to different places:
In
src/components/ReportActionItem/ReportPreview.js
, update<Button
undershouldShowApproveButton
to first call a new local methodconfirmApproval()
, we will move the existingIOU.approveMoneyRequest
into this new local method.In the new local method, check for held amounts, permissions and call
IOU.approveMoneyRequest()
as appropriate (same logic as above).Pass 'approve' as the type parameter to the
<ProcessMoneyRequestHoldMenu
component.The rest should be the same, particularly with adding a new full parameter to
IOU.payMoneyRequest
and passing that onwards into the backend.The text was updated successfully, but these errors were encountered: