diff --git a/src/accounting/report/converters.py b/src/accounting/report/converters.py index 9fa5dfb..d0733a5 100644 --- a/src/accounting/report/converters.py +++ b/src/accounting/report/converters.py @@ -23,8 +23,8 @@ from flask import abort from werkzeug.routing import BaseConverter from accounting.models import Account -from .income_expense_account import IncomeExpensesAccount -from .period import Period +from .utils.income_expense_account import IncomeExpensesAccount +from .utils.period import Period class PeriodConverter(BaseConverter): diff --git a/src/accounting/report/reports/balance_sheet.py b/src/accounting/report/reports/balance_sheet.py index abcd662..dbc9349 100644 --- a/src/accounting/report/reports/balance_sheet.py +++ b/src/accounting/report/reports/balance_sheet.py @@ -26,12 +26,12 @@ from accounting import db from accounting.locale import gettext from accounting.models import Currency, BaseAccount, Account, Transaction, \ JournalEntry -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/reports/income_expenses.py b/src/accounting/report/reports/income_expenses.py index e0ac3e1..dc35f88 100644 --- a/src/accounting/report/reports/income_expenses.py +++ b/src/accounting/report/reports/income_expenses.py @@ -27,13 +27,14 @@ from sqlalchemy.orm import selectinload from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry -from accounting.report.income_expense_account import IncomeExpensesAccount -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec +from accounting.report.utils.income_expense_account import \ + IncomeExpensesAccount from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/reports/income_statement.py b/src/accounting/report/reports/income_statement.py index 5dc890b..3cfa426 100644 --- a/src/accounting/report/reports/income_statement.py +++ b/src/accounting/report/reports/income_statement.py @@ -26,12 +26,12 @@ from accounting import db from accounting.locale import gettext from accounting.models import Currency, BaseAccount, Account, Transaction, \ JournalEntry -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/reports/journal.py b/src/accounting/report/reports/journal.py index 94ff1b6..856c596 100644 --- a/src/accounting/report/reports/journal.py +++ b/src/accounting/report/reports/journal.py @@ -26,11 +26,11 @@ from sqlalchemy.orm import selectinload from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/reports/ledger.py b/src/accounting/report/reports/ledger.py index b449bd0..01ad719 100644 --- a/src/accounting/report/reports/ledger.py +++ b/src/accounting/report/reports/ledger.py @@ -27,12 +27,12 @@ from sqlalchemy.orm import selectinload from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/reports/trial_balance.py b/src/accounting/report/reports/trial_balance.py index b7adc32..51d29d0 100644 --- a/src/accounting/report/reports/trial_balance.py +++ b/src/accounting/report/reports/trial_balance.py @@ -25,12 +25,12 @@ from flask import Response, render_template from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account, Transaction, JournalEntry -from accounting.report.period import Period from accounting.report.utils.base_page_params import BasePageParams from accounting.report.utils.base_report import BaseReport from accounting.report.utils.csv_export import BaseCSVRow, csv_download, \ period_spec from accounting.report.utils.option_link import OptionLink +from accounting.report.utils.period import Period from accounting.report.utils.period_choosers import PeriodChooser from accounting.report.utils.report_chooser import ReportChooser from accounting.report.utils.report_type import ReportType diff --git a/src/accounting/report/utils/csv_export.py b/src/accounting/report/utils/csv_export.py index ecf3b35..1ab208b 100644 --- a/src/accounting/report/utils/csv_export.py +++ b/src/accounting/report/utils/csv_export.py @@ -25,7 +25,7 @@ from io import StringIO from flask import Response -from accounting.report.period import Period +from .period import Period class BaseCSVRow(ABC): diff --git a/src/accounting/report/income_expense_account.py b/src/accounting/report/utils/income_expense_account.py similarity index 100% rename from src/accounting/report/income_expense_account.py rename to src/accounting/report/utils/income_expense_account.py diff --git a/src/accounting/report/period.py b/src/accounting/report/utils/period.py similarity index 100% rename from src/accounting/report/period.py rename to src/accounting/report/utils/period.py diff --git a/src/accounting/report/utils/period_choosers.py b/src/accounting/report/utils/period_choosers.py index 506a459..f0e1282 100644 --- a/src/accounting/report/utils/period_choosers.py +++ b/src/accounting/report/utils/period_choosers.py @@ -24,9 +24,8 @@ import typing as t from datetime import date from accounting.models import Transaction -from accounting.report.period import Period, ThisMonth, LastMonth, \ - SinceLastMonth, ThisYear, LastYear, Today, Yesterday, AllTime, \ - TemplatePeriod, YearPeriod +from .period import Period, ThisMonth, LastMonth, SinceLastMonth, ThisYear, \ + LastYear, Today, Yesterday, AllTime, TemplatePeriod, YearPeriod class PeriodChooser: diff --git a/src/accounting/report/utils/report_chooser.py b/src/accounting/report/utils/report_chooser.py index 1d52b90..2b818ea 100644 --- a/src/accounting/report/utils/report_chooser.py +++ b/src/accounting/report/utils/report_chooser.py @@ -28,10 +28,10 @@ from flask_babel import LazyString from accounting import db from accounting.locale import gettext from accounting.models import Currency, Account -from accounting.report.income_expense_account import IncomeExpensesAccount -from accounting.report.period import Period from accounting.template_globals import default_currency_code +from .income_expense_account import IncomeExpensesAccount from .option_link import OptionLink +from .period import Period from .report_type import ReportType from .urls import journal_url, ledger_url, income_expenses_url, \ trial_balance_url, income_statement_url, balance_sheet_url diff --git a/src/accounting/report/utils/urls.py b/src/accounting/report/utils/urls.py index 4d22d49..e5945ac 100644 --- a/src/accounting/report/utils/urls.py +++ b/src/accounting/report/utils/urls.py @@ -20,8 +20,8 @@ from flask import url_for from accounting.models import Currency, Account -from accounting.report.income_expense_account import IncomeExpensesAccount -from accounting.report.period import Period +from .income_expense_account import IncomeExpensesAccount +from .period import Period def journal_url(period: Period) \ diff --git a/src/accounting/report/views.py b/src/accounting/report/views.py index 61723a3..7478c64 100644 --- a/src/accounting/report/views.py +++ b/src/accounting/report/views.py @@ -21,11 +21,11 @@ from flask import Blueprint, request, Response from accounting.models import Currency, Account from accounting.utils.permission import has_permission, can_view -from .income_expense_account import IncomeExpensesAccount -from .period import Period from .reports import Journal, Ledger, IncomeExpenses, TrialBalance, \ IncomeStatement, BalanceSheet, Search from .template_filters import format_amount +from .utils.income_expense_account import IncomeExpensesAccount +from .utils.period import Period bp: Blueprint = Blueprint("report", __name__) """The view blueprint for the reports."""