Skip to content

Commit

Permalink
bug fix: multiple expenses (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
NileshPant1999 authored Mar 7, 2024
1 parent 83aac7f commit 4b30d53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/orgs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def async_update_fyle_credentials(fyle_org_id: str, refresh_token: str):
fyle_credentials = FyleCredential.objects.filter(workspace__org_id=fyle_org_id).first()
fyle_credentials = FyleCredential.objects.filter(org__fyle_org_id=fyle_org_id).first()
if fyle_credentials:
fyle_credentials.refresh_token = refresh_token
fyle_credentials.save()
6 changes: 3 additions & 3 deletions apps/travelperk/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ def create_invoice_lineitems(org_id, invoice, expense, user_role, amount):
if employee_email:
assign_payload = {
'data': {
'id': created_expense['data']['id'],
'assignee_user_email': employee_email
'id': created_expense['data']['id'],
'assignee_user_email': employee_email
}
}

Expand Down Expand Up @@ -269,7 +269,7 @@ def create_expense_against_employee(org_id, invoice, invoice_lineitems, user_rol
expense = invoice_lineitems[0]

# Create the expense against the employee with the total amount
created_expense = create_invoice_lineitems(org_id, expense, user_role, total_amount)
created_expense = create_invoice_lineitems(org_id, invoice, expense, user_role, total_amount)

return created_expense

Expand Down

0 comments on commit 4b30d53

Please sign in to comment.