Added the base report class to ensure that the reports can both be shown on the page and downloaded as CSV.

This commit is contained in:
2023-03-08 00:41:34 +08:00
parent 1eed16b732
commit 2f7b9932a0
7 changed files with 52 additions and 6 deletions

View File

@ -28,6 +28,7 @@ from accounting.locale import gettext
from accounting.models import Currency, Account, Transaction, JournalEntry
from accounting.report.period import Period
from accounting.utils.pagination import Pagination
from .utils.base_report import BaseReport
from .utils.csv_export import BaseCSVRow, csv_download
from .utils.option_link import OptionLink
from .utils.page_params import PageParams
@ -342,7 +343,7 @@ def _populate_entries(entries: list[Entry]) -> None:
entry.note = entry.transaction.note
class Ledger:
class Ledger(BaseReport):
"""The ledger."""
def __init__(self, currency: Currency, account: Account, period: Period):