diff --git a/src/accounting/models.py b/src/accounting/models.py index e96434c..622a61f 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -588,7 +588,7 @@ class Transaction(db.Model): for currency in self.currencies: if len(currency.debit) > 1: return False - if currency.debit[0].account.code != "1111-001": + if currency.debit[0].account.code != Account.CASH: return False return True @@ -602,7 +602,7 @@ class Transaction(db.Model): for currency in self.currencies: if len(currency.credit) > 1: return False - if currency.credit[0].account.code != "1111-001": + if currency.credit[0].account.code != Account.CASH: return False return True diff --git a/src/accounting/report/reports/utils/report_chooser.py b/src/accounting/report/reports/utils/report_chooser.py index 7998014..4f2352d 100644 --- a/src/accounting/report/reports/utils/report_chooser.py +++ b/src/accounting/report/reports/utils/report_chooser.py @@ -58,8 +58,8 @@ class ReportChooser: Currency, default_currency_code()) \ if currency is None else currency """The currency.""" - self.__account: Account = Account.find_by_code("1111-001") \ - if account is None else account + self.__account: Account = Account.cash() if account is None \ + else account """The currency.""" self.__reports: list[OptionLink] = [] """The links to the reports.""" @@ -110,7 +110,7 @@ class ReportChooser: """ account: Account = self.__account if not re.match(r"[12][12]", account.base_code): - account: Account = Account.find_by_code("1111-001") + account: Account = Account.cash() url: str = url_for("accounting.report.income-expenses-default", currency=self.__currency, account=account) \ if self.__period.is_default \