Added the pseudo account for the income and expenses log to query the income and expenses log of the current assets and liabilities.

This commit is contained in:
2023-03-08 00:27:40 +08:00
parent ede1160943
commit 1eed16b732
6 changed files with 158 additions and 25 deletions

View File

@ -27,6 +27,7 @@ from datetime import date
from flask import url_for
from accounting.models import Currency, Account, Transaction
from accounting.report.income_expense_account import IncomeExpensesAccount
from accounting.report.period import YearPeriod, Period, ThisMonth, \
LastMonth, SinceLastMonth, ThisYear, LastYear, Today, Yesterday, \
TemplatePeriod
@ -143,11 +144,11 @@ class LedgerPeriodChooser(PeriodChooser):
class IncomeExpensesPeriodChooser(PeriodChooser):
"""The income and expenses period chooser."""
def __init__(self, currency: Currency, account: Account):
def __init__(self, currency: Currency, account: IncomeExpensesAccount):
"""Constructs the income and expenses period chooser."""
self.currency: Currency = currency
"""The currency."""
self.account: Account = account
self.account: IncomeExpensesAccount = account
"""The account."""
first: Transaction | None \
= Transaction.query.order_by(Transaction.date).first()