diff --git a/src/accounting/report/reports.py b/src/accounting/report/reports.py index 8ba07c3..1359f3a 100644 --- a/src/accounting/report/reports.py +++ b/src/accounting/report/reports.py @@ -27,13 +27,14 @@ from flask_sqlalchemy.query import Query from accounting import db from accounting.models import JournalEntry, Transaction, Account, Currency -from accounting.transaction.dispatcher import TXN_TYPE_OBJ, TransactionTypes from accounting.utils.pagination import Pagination +from accounting.utils.txn_types import TransactionTypeEnum from .period import Period from .period_choosers import PeriodChooser, \ JournalPeriodChooser from .report_chooser import ReportChooser, ReportType from .report_rows import ReportRow, JournalRow +import typing as t class JournalEntryReport(ABC): @@ -104,12 +105,12 @@ class JournalEntryReport(ABC): """ @property - def txn_types(self) -> TransactionTypes: + def txn_types(self) -> t.Type[TransactionTypeEnum]: """Returns the transaction types. :return: The transaction types. """ - return TXN_TYPE_OBJ + return TransactionTypeEnum def as_csv_download(self) -> Response: """Returns the journal entries as CSV download. diff --git a/src/accounting/templates/accounting/include/add-txn-material-fab.html b/src/accounting/templates/accounting/include/add-txn-material-fab.html index 8816eb2..80b3cb5 100644 --- a/src/accounting/templates/accounting/include/add-txn-material-fab.html +++ b/src/accounting/templates/accounting/include/add-txn-material-fab.html @@ -22,13 +22,13 @@ First written: 2023/2/25 {% if accounting_can_edit() %}
- + {{ A_("Cash expense") }} - + {{ A_("Cash income") }} - + {{ A_("Transfer") }}
diff --git a/src/accounting/templates/accounting/report/journal.html b/src/accounting/templates/accounting/report/journal.html index fb506d1..2c62dfe 100644 --- a/src/accounting/templates/accounting/report/journal.html +++ b/src/accounting/templates/accounting/report/journal.html @@ -40,16 +40,16 @@ First written: 2023/3/4
-{% with types = report.txn_types %} +{% with txn_types = report.txn_types %} {% include "accounting/include/add-txn-material-fab.html" %} {% endwith %} diff --git a/src/accounting/templates/accounting/transaction/list.html b/src/accounting/templates/accounting/transaction/list.html index e212287..61d3e60 100644 --- a/src/accounting/templates/accounting/transaction/list.html +++ b/src/accounting/templates/accounting/transaction/list.html @@ -38,16 +38,16 @@ First written: 2023/2/18