-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[$250] Rules - "Auto-pay approved reports" feature does not work #62606
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
Comments
Triggered auto assignment to @twisterdotcom ( |
The feature auto-pays when you have a VBA, not just marks stuff as paid automatically right? So we should only allow that toggle when you have a VBA. |
🚨 Edited by proposal-police: This proposal was edited at 2025-05-23 10:21:44 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The feature auto-pays when you have a VBA, not just marks stuff as paid automatically right? So we should only allow that toggle when you have a VBA. What is the root cause of that problem?We allow enabling that toggle when App/src/pages/workspace/rules/ExpenseReportRulesSection.tsx Lines 112 to 113 in 34d77b7
What changes do you think we should make in order to solve the problem?Modify the autoPayApprovedReportsUnavailable so that the reimbursement is different from REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES. Add another condition that the policy must have a VBBA and Lines 1218 to 1221 in 5935c96
so when the workspace has no bank account, the toggle would show like this: We need to adjust the subtitle text style to match with other rules: What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can add an UI test for the rules in workspace rules page. What alternative solutions did you explore? (Optional)None |
Yeah, I like this. |
Job added to Upwork: https://www.upwork.com/jobs/~021925688336725193077 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-05-25 18:46:05 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Rules - "Auto-pay approved reports" feature does not work What is the root cause of that problem?Missing condition here.
Currently we autoPayApprovedReportsUnavailable works as a flag to determine whether the toggle for auto approval should be locked or not. And this does not include any condition about VBBA.
What changes do you think we should make in order to solve the problem?Update const autoPayApprovedReportsUnavailable = policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_YES && policy?.areWorkflowsEnabled; Add additional flag const hasPolicyVBBA = hasVBBA(policyID); Line 1218 in 5935c96
Now use this new flag to conditionally disable the toggle option and pass a new subtitle. so add a new subtitle.(we could make autoPayApprovedReportsMissingVBBASubtitle: 'Please add a bank account to use this feature', The exact line could be suggested by the design team. {
title: translate('workspace.rules.expenseReportRules.autoPayApprovedReportsTitle'),
subtitle: autoPayApprovedReportsUnavailable
? renderFallbackSubtitle({featureName: translate('common.payments').toLowerCase()})
: !hasPolicyVBBA
? translate('workspace.rules.expenseReportRules.autoPayApprovedReportsMissingVBBASubtitle')
: translate('workspace.rules.expenseReportRules.autoPayApprovedReportsSubtitle'),
switchAccessibilityLabel: translate('workspace.rules.expenseReportRules.autoPayApprovedReportsTitle'),
onToggle: (isEnabled: boolean) => {
enablePolicyAutoReimbursementLimit(policyID, isEnabled);
},
disabled: autoPayApprovedReportsUnavailable || !hasPolicyVBBA,
showLockIcon: autoPayApprovedReportsUnavailable || !hasPolicyVBBA,
isActive: policy?.shouldShowAutoReimbursementLimitOption && !autoPayApprovedReportsUnavailable && hasPolicyVBBA,
pendingAction: policy?.pendingFields?.shouldShowAutoReimbursementLimitOption,
onToggle: (isEnabled: boolean) => {
enableAutoApprovalOptions(policyID, isEnabled);
}, App/src/pages/workspace/rules/ExpenseReportRulesSection.tsx Lines 61 to 73 in 409e68e
Note This proposal emphasize on adding an additional subtitle translation to better guide the user about the requirement to enable the feature. Code style could be improved during PR. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?NA What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
@nyomanjyotisa @ahmedGaber93 @Julesssss this is related to your PR I believe #60171 |
Hmm! I think it is not related, Our PR just change some exist translation, but the issue here looks to have a broken flow of "Auto-pay approved reports" |
Update my proposal to follow the above comment #62606 (comment) |
@trjExpensify do you think we need to update the subtitle for the case where
like - "Please add a bank account to enable this feature" |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.1.49-6
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: #60171
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The expense should be auto-paid
Actual Result:
The expense is not auto-paid
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Platforms Tested:
On which of our officially supported platforms was this issue tested:Screenshots/Videos
Add any screenshot/video evidence
Bug6839387_1747932693969.Screen_Recording_2025-05-22_at_1.46.05_PM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @rushatgabhaneThe text was updated successfully, but these errors were encountered: