diff --git a/apps/qbd/models.py b/apps/qbd/models.py index 927cd5d..59c4711 100644 --- a/apps/qbd/models.py +++ b/apps/qbd/models.py @@ -506,6 +506,7 @@ def create_credit_card_purchase_lineitems( :return: None """ field_mappings: FieldMapping = FieldMapping.objects.get(workspace_id=workspace_id) + export_settings: ExportSettings = ExportSettings.objects.get(workspace_id=workspace_id) lineitems = [] for expense in expenses: @@ -515,7 +516,7 @@ def create_credit_card_purchase_lineitems( lineitem = CreditCardPurchaseLineitem.objects.create( transaction_type='CREDIT CARD' if expense.amount > 0 else 'CCARD REFUND', - date=expense.spent_at, + date=get_transaction_date(expenses, date_preference=export_settings.credit_card_expense_date), account=expense.category, name=project_name, class_name=class_name,