Skip to content

Commit

Permalink
fix: expense group creation (#653)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
ruuushhh and GitHub Actions committed Oct 10, 2024
1 parent 4e5f85b commit 0946f65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions apps/fyle/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def get_task_log_and_fund_source(workspace_id: int):
)

configuration = Configuration.objects.get(workspace_id=workspace_id)
fund_source = ['PERSONAL']
if configuration.corporate_credit_card_expenses_object is not None:
fund_source = []

if configuration.reimbursable_expenses_object:
fund_source.append('PERSONAL')
if configuration.corporate_credit_card_expenses_object:
fund_source.append('CCC')

return task_log, fund_source, configuration
Expand Down
8 changes: 6 additions & 2 deletions apps/workspaces/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ def run_sync_schedule(workspace_id):
)

configuration = Configuration.objects.get(workspace_id=workspace_id)
fund_source = ['PERSONAL']
fund_source = []

if configuration.reimbursable_expenses_object:
fund_source.append('PERSONAL')
if configuration.corporate_credit_card_expenses_object:
fund_source.append('CCC')
if configuration.reimbursable_expenses_object:

if configuration.reimbursable_expenses_object or configuration.corporate_credit_card_expenses_object:
create_expense_groups(
workspace_id=workspace_id, configuration=configuration, fund_source=fund_source, task_log=task_log
)
Expand Down

0 comments on commit 0946f65

Please sign in to comment.