diff --git a/src/accounting/report/reports/income_expenses.py b/src/accounting/report/reports/income_expenses.py index b6ff367..758476c 100644 --- a/src/accounting/report/reports/income_expenses.py +++ b/src/accounting/report/reports/income_expenses.py @@ -366,10 +366,10 @@ class PageParams(BasePageParams): return options -def _populate_entries(entries: list[Entry]) -> None: - """Populates the income and expenses log entries with relative data. +def populate_entries(entries: list[Entry]) -> None: + """Populates the report entries with relative data. - :param entries: The income and expenses log entries. + :param entries: The report entries. :return: None. """ transactions: dict[int, Transaction] \ @@ -429,7 +429,7 @@ class IncomeExpenses(BaseReport): :return: The CSV rows. """ - _populate_entries(self.__entries) + populate_entries(self.__entries) rows: list[CSVRow] = [CSVRow(gettext("Date"), gettext("Account"), gettext("Summary"), gettext("Income"), gettext("Expense"), gettext("Balance"), @@ -465,7 +465,7 @@ class IncomeExpenses(BaseReport): pagination: Pagination[Entry] = Pagination[Entry](all_entries) page_entries: list[Entry] = pagination.list has_data: bool = len(page_entries) > 0 - _populate_entries(page_entries) + populate_entries(page_entries) brought_forward: Entry | None = None if len(page_entries) > 0 and page_entries[0].is_brought_forward: brought_forward = page_entries[0] diff --git a/src/accounting/report/reports/journal.py b/src/accounting/report/reports/journal.py index f5ae8dc..c11abd3 100644 --- a/src/accounting/report/reports/journal.py +++ b/src/accounting/report/reports/journal.py @@ -152,10 +152,10 @@ class PageParams(BasePageParams): period=self.period) -def _populate_entries(entries: list[Entry]) -> None: - """Populates the journal entries with relative data. +def populate_entries(entries: list[Entry]) -> None: + """Populates the report entries with relative data. - :param entries: The journal entries. + :param entries: The report entries. :return: None. """ transactions: dict[int, Transaction] \ @@ -216,7 +216,7 @@ class Journal(BaseReport): :return: The CSV rows. """ - _populate_entries(self.__entries) + populate_entries(self.__entries) rows: list[CSVRow] = [CSVRow(gettext("Date"), gettext("Currency"), gettext("Account"), gettext("Summary"), gettext("Debit"), gettext("Credit"), @@ -234,7 +234,7 @@ class Journal(BaseReport): """ pagination: Pagination[Entry] = Pagination[Entry](self.__entries) page_entries: list[Entry] = pagination.list - _populate_entries(page_entries) + populate_entries(page_entries) params: PageParams = PageParams(period=self.__period, pagination=pagination, entries=page_entries) diff --git a/src/accounting/report/reports/ledger.py b/src/accounting/report/reports/ledger.py index f6fef16..c2ae22a 100644 --- a/src/accounting/report/reports/ledger.py +++ b/src/accounting/report/reports/ledger.py @@ -326,10 +326,10 @@ class PageParams(BasePageParams): .order_by(Account.base_code, Account.no).all()] -def _populate_entries(entries: list[Entry]) -> None: - """Populates the ledger entries with relative data. +def populate_entries(entries: list[Entry]) -> None: + """Populates the report entries with relative data. - :param entries: The ledger entries. + :param entries: The report entries. :return: None. """ transactions: dict[int, Transaction] \ @@ -383,7 +383,7 @@ class Ledger(BaseReport): :return: The CSV rows. """ - _populate_entries(self.__entries) + populate_entries(self.__entries) rows: list[CSVRow] = [CSVRow(gettext("Date"), gettext("Summary"), gettext("Debit"), gettext("Credit"), gettext("Balance"), gettext("Note"))] @@ -417,7 +417,7 @@ class Ledger(BaseReport): pagination: Pagination[Entry] = Pagination[Entry](all_entries) page_entries: list[Entry] = pagination.list has_data: bool = len(page_entries) > 0 - _populate_entries(page_entries) + populate_entries(page_entries) brought_forward: Entry | None = None if len(page_entries) > 0 and page_entries[0].is_brought_forward: brought_forward = page_entries[0] diff --git a/src/accounting/report/reports/search.py b/src/accounting/report/reports/search.py index c046fcb..99f9e33 100644 --- a/src/accounting/report/reports/search.py +++ b/src/accounting/report/reports/search.py @@ -143,10 +143,10 @@ class PageParams(BasePageParams): return ReportChooser(ReportType.SEARCH) -def _populate_entries(entries: list[Entry]) -> None: - """Populates the search result entries with relative data. +def populate_entries(entries: list[Entry]) -> None: + """Populates the report entries with relative data. - :param entries: The search result entries. + :param entries: The report entries. :return: None. """ transactions: dict[int, Transaction] \ @@ -278,7 +278,7 @@ class Search(BaseReport): :return: The CSV rows. """ - _populate_entries(self.__entries) + populate_entries(self.__entries) rows: list[CSVRow] = [CSVRow(gettext("Date"), gettext("Currency"), gettext("Account"), gettext("Summary"), gettext("Debit"), gettext("Credit"), @@ -296,7 +296,7 @@ class Search(BaseReport): """ pagination: Pagination[Entry] = Pagination[Entry](self.__entries) page_entries: list[Entry] = pagination.list - _populate_entries(page_entries) + populate_entries(page_entries) params: PageParams = PageParams(pagination=pagination, entries=page_entries) return render_template("accounting/report/search.html",