From 08d1e602384a86e7ad18faedea298664b2e7c749 Mon Sep 17 00:00:00 2001 From: imacat Date: Fri, 17 Mar 2023 22:39:29 +0800 Subject: [PATCH] Fixed the journal, the ledger, the income ane expenses log, and the search result to respect the transaction number before the debit/credit and the journal entry nuber. --- src/accounting/report/reports/income_expenses.py | 1 + src/accounting/report/reports/journal.py | 1 + src/accounting/report/reports/ledger.py | 1 + src/accounting/report/reports/search.py | 1 + 4 files changed, 4 insertions(+) diff --git a/src/accounting/report/reports/income_expenses.py b/src/accounting/report/reports/income_expenses.py index 1571ecf..5ddca46 100644 --- a/src/accounting/report/reports/income_expenses.py +++ b/src/accounting/report/reports/income_expenses.py @@ -160,6 +160,7 @@ class EntryCollector: JournalEntry.currency_code == self.__currency.code, sa.not_(self.__account_condition)) .order_by(Transaction.date, + Transaction.no, JournalEntry.is_debit, JournalEntry.no) .options(selectinload(JournalEntry.account), diff --git a/src/accounting/report/reports/journal.py b/src/accounting/report/reports/journal.py index 45243d7..4dab479 100644 --- a/src/accounting/report/reports/journal.py +++ b/src/accounting/report/reports/journal.py @@ -188,6 +188,7 @@ class Journal(BaseReport): return JournalEntry.query.join(Transaction)\ .filter(*conditions)\ .order_by(Transaction.date, + Transaction.no, JournalEntry.is_debit.desc(), JournalEntry.no)\ .options(selectinload(JournalEntry.account), diff --git a/src/accounting/report/reports/ledger.py b/src/accounting/report/reports/ledger.py index 70cb03e..abec6f9 100644 --- a/src/accounting/report/reports/ledger.py +++ b/src/accounting/report/reports/ledger.py @@ -149,6 +149,7 @@ class EntryCollector: return [ReportEntry(x) for x in JournalEntry.query.join(Transaction) .filter(*conditions) .order_by(Transaction.date, + Transaction.no, JournalEntry.is_debit.desc(), JournalEntry.no) .options(selectinload(JournalEntry.transaction)).all()] diff --git a/src/accounting/report/reports/search.py b/src/accounting/report/reports/search.py index e5ac29d..bc39912 100644 --- a/src/accounting/report/reports/search.py +++ b/src/accounting/report/reports/search.py @@ -71,6 +71,7 @@ class EntryCollector: conditions.append(sa.or_(*sub_conditions)) return JournalEntry.query.join(Transaction).filter(*conditions)\ .order_by(Transaction.date, + Transaction.no, JournalEntry.is_debit, JournalEntry.no)\ .options(selectinload(JournalEntry.account),