diff --git a/apps/fyle/tasks.py b/apps/fyle/tasks.py index b60c600d..b957be4d 100644 --- a/apps/fyle/tasks.py +++ b/apps/fyle/tasks.py @@ -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 diff --git a/apps/workspaces/tasks.py b/apps/workspaces/tasks.py index 83f963cd..c891fea9 100644 --- a/apps/workspaces/tasks.py +++ b/apps/workspaces/tasks.py @@ -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 )