Renamed the "accounting.report.reports.utils.get_url" module to "accounting.report.reports.utils.urls", and shortened the names of the utilities, for readability.

This commit is contained in:
2023-03-09 11:50:02 +08:00
parent 140d3c6010
commit df53f06094
8 changed files with 51 additions and 61 deletions

View File

@ -30,7 +30,7 @@ from accounting.report.period import Period
from .utils.base_page_params import BasePageParams
from .utils.base_report import BaseReport
from .utils.csv_export import BaseCSVRow, csv_download, period_spec
from .utils.get_url import get_ledger_url, get_income_statement_url
from .utils.urls import ledger_url, income_statement_url
from .utils.option_link import OptionLink
from .utils.period_choosers import IncomeStatementPeriodChooser
from .utils.report_chooser import ReportChooser
@ -188,8 +188,7 @@ class PageParams(BasePageParams):
:return: The currency options.
"""
return self._get_currency_options(
lambda x: get_income_statement_url(x, self.period),
self.currency)
lambda x: income_statement_url(x, self.period), self.currency)
class IncomeStatement(BaseReport):
@ -276,9 +275,9 @@ class IncomeStatement(BaseReport):
.filter(Account.id.in_([x.id for x in balances])).all()}
return [ReportAccount(account=accounts[x.id],
amount=x.balance,
url=get_ledger_url(self.__currency,
accounts[x.id],
self.__period))
url=ledger_url(self.__currency,
accounts[x.id],
self.__period))
for x in balances]
def csv(self) -> Response: