From c9166fda4de4e25c7f58ceec4a080c3cefe085b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 4 Apr 2023 10:54:43 +0800 Subject: [PATCH] Fixed the order in the get_selectable_original_line_items function in the "accounting.journal_entry.utils.original_line_item" module. --- src/accounting/journal_entry/utils/original_line_items.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounting/journal_entry/utils/original_line_items.py b/src/accounting/journal_entry/utils/original_line_items.py index c5def19..54de205 100644 --- a/src/accounting/journal_entry/utils/original_line_items.py +++ b/src/accounting/journal_entry/utils/original_line_items.py @@ -72,8 +72,8 @@ def get_selectable_original_line_items( line_items: list[JournalEntryLineItem] = JournalEntryLineItem.query\ .filter(JournalEntryLineItem.id.in_({x for x in net_balances}))\ .join(JournalEntry)\ - .order_by(JournalEntry.date, JournalEntryLineItem.is_debit, - JournalEntryLineItem.no)\ + .order_by(JournalEntry.date, JournalEntry.no, + JournalEntryLineItem.is_debit, JournalEntryLineItem.no)\ .options(selectinload(JournalEntryLineItem.currency), selectinload(JournalEntryLineItem.account), selectinload(JournalEntryLineItem.journal_entry)).all()