Skip to content

Commit

Permalink
Fix bank transaction id in description (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Aug 9, 2024
1 parent 19cc17f commit 8a890cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/quickbooks_online/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def get_category_mapping_and_detail_type(workspace_general_settings: WorkspaceGe
return qbo_account, 'AccountBasedExpenseLineDetail'


def get_credit_card_purchase_number(expense_group, expense, expense_group_settings, map_merchant_to_vendor):
if expense_group_settings.split_expense_grouping == 'MULTIPLE_LINE_ITEM' and 'bank_transaction_id' in expense_group.description:
def get_credit_card_purchase_number(expense_group: ExpenseGroup, expense: Expense, expense_group_settings: ExpenseGroupSettings):
if expense_group.expenses.count() > 1 and expense_group_settings.split_expense_grouping == 'MULTIPLE_LINE_ITEM' and 'bank_transaction_id' in expense_group.description:
return expense_group.description['bank_transaction_id']
else:
return expense.expense_number
Expand Down Expand Up @@ -629,8 +629,7 @@ def create_credit_card_purchase(expense_group: ExpenseGroup, map_merchant_to_ven
'credit_card_purchase_number': get_credit_card_purchase_number(
expense_group,
expense,
expense_group_settings,
map_merchant_to_vendor
expense_group_settings
),
},
)
Expand Down

0 comments on commit 8a890cd

Please sign in to comment.