diff --git a/src/accounting/report/reports/income_expenses.py b/src/accounting/report/reports/income_expenses.py index f5ba3b0..04586fe 100644 --- a/src/accounting/report/reports/income_expenses.py +++ b/src/accounting/report/reports/income_expenses.py @@ -47,8 +47,6 @@ class ReportEntry: :param entry: The journal entry. """ - self.transaction: Transaction | None = None - """The transaction.""" self.is_brought_forward: bool = False """Whether this is the brought-forward entry.""" self.is_total: bool = False @@ -67,14 +65,17 @@ class ReportEntry: """The balance.""" self.note: str | None = None """The note.""" + self.url: str | None = None + """The URL to the journal entry.""" if entry is not None: - self.transaction = entry.transaction self.date = entry.transaction.date self.account = entry.account self.summary = entry.summary self.income = None if entry.is_debit else entry.amount self.expense = entry.amount if entry.is_debit else None self.note = entry.transaction.note + self.url = url_for("accounting.transaction.detail", + txn=entry.transaction) class EntryCollector: diff --git a/src/accounting/templates/accounting/report/income-expenses.html b/src/accounting/templates/accounting/report/income-expenses.html index 1ff85b1..6e5a1f9 100644 --- a/src/accounting/templates/accounting/report/income-expenses.html +++ b/src/accounting/templates/accounting/report/income-expenses.html @@ -80,7 +80,7 @@ First written: 2023/3/5 {% endwith %} {% endif %} {% for entry in report.entries %} - + {% include "accounting/report/include/income-expenses-row-desktop.html" %} {% endfor %} @@ -108,7 +108,7 @@ First written: 2023/3/5 {% endwith %} {% endif %} {% for entry in report.entries %} - + {% include "accounting/report/include/income-expenses-row-mobile.html" %} {% endfor %}