Moved the utilities that are only for the report generators from the "accounting.report" module to the "accounting.report.reports.utils" module.
This commit is contained in:
parent
edb893ecd3
commit
f838e7f893
@ -28,12 +28,12 @@ from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, BaseAccount, Account, Transaction, \
|
||||
JournalEntry
|
||||
from accounting.report.option_link import OptionLink
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import BalanceSheetPeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from .utils.option_link import OptionLink
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import BalanceSheetPeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class BalanceSheetAccount:
|
||||
|
@ -28,13 +28,13 @@ from flask import url_for, render_template, Response
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, Account, Transaction, JournalEntry
|
||||
from accounting.report.option_link import OptionLink
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import IncomeExpensesPeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from accounting.utils.pagination import Pagination
|
||||
from .utils.option_link import OptionLink
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import IncomeExpensesPeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class Entry:
|
||||
|
@ -28,12 +28,12 @@ from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, BaseAccount, Account, Transaction, \
|
||||
JournalEntry
|
||||
from accounting.report.option_link import OptionLink
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import IncomeStatementPeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from .utils.option_link import OptionLink
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import IncomeStatementPeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class IncomeStatementAccount:
|
||||
|
@ -28,12 +28,12 @@ from flask import render_template, Response
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, Account, Transaction, JournalEntry
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import JournalPeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from accounting.utils.pagination import Pagination
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import JournalPeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class Entry:
|
||||
|
@ -28,13 +28,13 @@ from flask import url_for, render_template, Response
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, Account, Transaction, JournalEntry
|
||||
from accounting.report.option_link import OptionLink
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import LedgerPeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from accounting.utils.pagination import Pagination
|
||||
from .utils.option_link import OptionLink
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import LedgerPeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class Entry:
|
||||
|
@ -27,12 +27,12 @@ from flask import url_for, Response, render_template
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, Account, Transaction, JournalEntry
|
||||
from accounting.report.option_link import OptionLink
|
||||
from accounting.report.page_params import PageParams
|
||||
from accounting.report.period import Period
|
||||
from accounting.report.period_choosers import TrialBalancePeriodChooser
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.report.report_type import ReportType
|
||||
from .utils.option_link import OptionLink
|
||||
from .utils.page_params import PageParams
|
||||
from .utils.period_choosers import TrialBalancePeriodChooser
|
||||
from .utils.report_chooser import ReportChooser
|
||||
from .utils.report_type import ReportType
|
||||
|
||||
|
||||
class TrialBalanceAccount:
|
||||
|
19
src/accounting/report/reports/utils/__init__.py
Normal file
19
src/accounting/report/reports/utils/__init__.py
Normal file
@ -0,0 +1,19 @@
|
||||
# The Mia! Accounting Flask Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
"""The utilities to generate reports.
|
||||
|
||||
"""
|
@ -17,15 +17,15 @@
|
||||
"""The page parameters of a report.
|
||||
|
||||
"""
|
||||
import typing as t
|
||||
from abc import ABC, abstractmethod
|
||||
from urllib.parse import urlparse, ParseResult, parse_qsl, urlencode, \
|
||||
urlunparse
|
||||
|
||||
from flask import request
|
||||
import typing as t
|
||||
|
||||
from accounting.report.report_chooser import ReportChooser
|
||||
from accounting.utils.txn_types import TransactionType
|
||||
from .report_chooser import ReportChooser
|
||||
|
||||
|
||||
class PageParams(ABC):
|
@ -27,8 +27,9 @@ from datetime import date
|
||||
from flask import url_for
|
||||
|
||||
from accounting.models import Currency, Account, Transaction
|
||||
from .period import YearPeriod, Period, ThisMonth, LastMonth, SinceLastMonth, \
|
||||
ThisYear, LastYear, Today, Yesterday, TemplatePeriod
|
||||
from accounting.report.period import YearPeriod, Period, ThisMonth, \
|
||||
LastMonth, SinceLastMonth, ThisYear, LastYear, Today, Yesterday, \
|
||||
TemplatePeriod
|
||||
|
||||
|
||||
class PeriodChooser(ABC):
|
@ -29,9 +29,9 @@ from flask_babel import LazyString
|
||||
from accounting import db
|
||||
from accounting.locale import gettext
|
||||
from accounting.models import Currency, Account
|
||||
from accounting.report.period import Period
|
||||
from accounting.template_globals import default_currency_code
|
||||
from .option_link import OptionLink
|
||||
from .period import Period
|
||||
from .report_type import ReportType
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user