Added owner's equity accounts (base code starts with "3") when calculating the change of owner's equity in the specified period.

This commit is contained in:
依瑪貓 2023-03-18 19:16:10 +08:00
parent 4eac10981f
commit fe1c7669b6

View File

@ -213,7 +213,7 @@ class AccountCollector:
:return: The balance. :return: The balance.
""" """
conditions.extend([sa.not_(Account.base_code.startswith(x)) conditions.extend([sa.not_(Account.base_code.startswith(x))
for x in {"1", "2"}]) for x in {"1", "2", "3"}])
balance_func: sa.Function = sa.func.sum(sa.case( balance_func: sa.Function = sa.func.sum(sa.case(
(JournalEntry.is_debit, JournalEntry.amount), (JournalEntry.is_debit, JournalEntry.amount),
else_=-JournalEntry.amount)) else_=-JournalEntry.amount))