diff --git a/apps/quickbooks_online/models.py b/apps/quickbooks_online/models.py index 567921b5..cfbf250a 100644 --- a/apps/quickbooks_online/models.py +++ b/apps/quickbooks_online/models.py @@ -192,7 +192,7 @@ def get_bill_number(expense_group: ExpenseGroup): bill_number = expense_group.expenses.first().__getattribute__(bill_number_field) - count = Bill.objects.filter(bill_number=bill_number, expense_group__workspace_id=expense_group.workspace.id).count() + count = Bill.objects.filter(bill_number__icontains=bill_number, expense_group__workspace_id=expense_group.workspace.id).count() if count > 0: bill_number = '{} - {}'.format(bill_number, count) return bill_number