Skip to content
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

Bug fix in Process reimburse handle #380

Merged
merged 12 commits into from
Jun 26, 2024
3 changes: 2 additions & 1 deletion apps/xero/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ def process_reimbursements(workspace_id):
def mark_paid_on_fyle(platform, payloads:dict, reports_to_be_marked, workspace_id, retry_num=10):
try:
logger.info('Marking reports paid on fyle for report ids - %s', reports_to_be_marked)
logger.info('Payloads- %s', payloads)
platform.reports.bulk_mark_as_paid(payloads)
Expense.objects.filter(report_id__in=list(reports_to_be_marked), workspace_id=workspace_id, paid_on_fyle=False).update(paid_on_fyle=True)
except Exception as e:
Expand All @@ -829,7 +830,7 @@ def mark_paid_on_fyle(platform, payloads:dict, reports_to_be_marked, workspace_i
if retry_num > 0 and payloads:
retry_num -= 1
logger.info('Retrying to mark reports paid on fyle, retry_num=%d', retry_num)
mark_paid_on_fyle(platform, payloads, reports_to_be_marked, retry_num)
mark_paid_on_fyle(platform, payloads, reports_to_be_marked, workspace_id, retry_num)

else:
logger.info('Retry limit reached or no payloads left. Failed to process payloads - %s:', reports_to_be_marked)
Expand Down
Loading