Skip to content

Commit

Permalink
Bug fix in Process reimburse handle (#605)
Browse files Browse the repository at this point in the history
* Handle already Approved and Permission denied condition

* bug fix
  • Loading branch information
Ashutosh619-sudo authored Jun 26, 2024
1 parent 37ceefb commit 0ac7028
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/netsuite/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,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 @@ -1381,7 +1382,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

0 comments on commit 0ac7028

Please sign in to comment.