Skip to content

Commit

Permalink
Fix: Last exported at
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuushhh committed Jun 5, 2024
1 parent daaf60c commit c3584c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apps/workspaces/tasks.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import List
import logging
from datetime import datetime, timedelta
from typing import List

from django_q.models import Schedule

from apps.workspaces.models import ExportSetting, AdvancedSetting, FyleCredential
from apps.accounting_exports.models import AccountingExport, AccountingExportSummary
from apps.sage300.exports.purchase_invoice.tasks import ExportPurchaseInvoice
from apps.fyle.queue import queue_import_credit_card_expenses, queue_import_reimbursable_expenses
from apps.sage300.exports.direct_cost.tasks import ExportDirectCost
from apps.fyle.queue import queue_import_reimbursable_expenses, queue_import_credit_card_expenses

from apps.sage300.exports.purchase_invoice.tasks import ExportPurchaseInvoice
from apps.workspaces.models import AdvancedSetting, ExportSetting, FyleCredential

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -51,7 +51,7 @@ def run_import_export(workspace_id: int, export_mode = None):

if accounting_export.status == 'COMPLETE':
accounting_export_ids = AccountingExport.objects.filter(
fund_source='PERSONAL', exported_at__isnull=True).values_list('id', flat=True)
fund_source='PERSONAL', exported_at__isnull=True, workspace_id=workspace_id).values_list('id', flat=True)

if len(accounting_export_ids):
is_expenses_exported = True
Expand All @@ -67,7 +67,7 @@ def run_import_export(workspace_id: int, export_mode = None):
)
if accounting_export.status == 'COMPLETE':
accounting_export_ids = AccountingExport.objects.filter(
fund_source='CCC', exported_at__isnull=True).values_list('id', flat=True)
fund_source='CCC', exported_at__isnull=True, workspace_id=workspace_id).values_list('id', flat=True)

if len(accounting_export_ids):
is_expenses_exported = True
Expand Down

0 comments on commit c3584c2

Please sign in to comment.