Fixed the sign of the amount in income statement.
This commit is contained in:
parent
9f1e724875
commit
3c200d0dc6
@ -272,8 +272,8 @@ class IncomeStatement:
|
||||
if self.__period.end is not None:
|
||||
conditions.append(Transaction.date <= self.__period.end)
|
||||
balance_func: sa.Function = sa.func.sum(sa.case(
|
||||
(JournalEntry.is_debit, JournalEntry.amount),
|
||||
else_=-JournalEntry.amount)).label("balance")
|
||||
(JournalEntry.is_debit, -JournalEntry.amount),
|
||||
else_=JournalEntry.amount)).label("balance")
|
||||
select_balance: sa.Select \
|
||||
= sa.select(JournalEntry.account_id, balance_func)\
|
||||
.join(Transaction).join(Account)\
|
||||
|
Loading…
Reference in New Issue
Block a user