Open IuliiaHerets opened 5 days ago
Triggered auto assignment to @strepanier03 (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Hold option is missing when submitting expense to workspace chat offline as employee.
In case offline, we set reportActorAccountID
as managerID
in here
This leads to isActionOwner = false
here
=> canModifyStatus = false
=> canHoldRequest = false
We should add new field as actorAccountID = currentUserAccountID
to buildOptimisticExpenseReport
function here
Update this condition to align with what the BE is returning.
const reportActorAccountID = (isInvoiceReport(iouReport) ? iouReport?.ownerAccountID : iouReport?.actorAccountID) ?? -1;
NA
Held expense - Hold option is missing when submitting expense to workspace offline as employee
For non-invoice reports we set the report preview action's actorAccountID to the managerID
https://github.com/Expensify/App/blob/2d2555b173b47c0bce0b1c16b275f1f98639664c/src/libs/ReportUtils.ts#L5152
So when the current user is not the managerID of the expense report (for instance, when the managerID is set to the approver) isActionOwner
will be false here
https://github.com/Expensify/App/blob/2d2555b173b47c0bce0b1c16b275f1f98639664c/src/libs/ReportUtils.ts#L3328
and canModifyStatus
will be false for the non-admin user (that's why the current issue is visible only when creating expenses as non-admin employee) and canHoldRequest
will be false until the correct actorAccountID is set by the BE
We should set the correct actorAccountID for the previewAction that aligns with the BE which is the currentUserAccountID or the expense report ownerAccountID
(payeeAccountID).
We can easily set it to the the expense report's ownerAccountID
adding isExpenseReport
condition here
https://github.com/Expensify/App/blob/2d2555b173b47c0bce0b1c16b275f1f98639664c/src/libs/ReportUtils.ts#L5152
const reportActorAccountID = (isInvoiceReport(iouReport) || isExpenseReport(iouReport) ? iouReport?.ownerAccountID : iouReport?.managerID) ?? -1;
Note: applying the solution in the above proposal will make the actorAccountID to be set to -1
optimistically as IOU report's actorAccountID
do not exist neither in iou reports nor in expense reports.
or we can directly set the currenUserAccountID/payeeAccountID for expense reports case by passing it to buildOptimisticReportPreview
as a param for expense reports only.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.64-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y Email or phone of affected tester (no customers): applausetester+21425443235@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Precondition:
Expected Result:
Hold option will be present when submitting expense to workspace chat offline as employee.
Actual Result:
Hold option is missing when submitting expense to workspace chat offline as employee.
This issue is not reproducible when admin submits expense to workspace chat offline.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/0b9d7a9a-729a-4250-b45d-d41ff926dcbb
View all open jobs on GitHub