From b705795b4431189ca14f191d313cd93135120242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 4 Mar 2023 19:56:07 +0800 Subject: [PATCH] Moved the ReportType enumeration from the "accounting.report.report_chooser" module to the new "accounting.report.report_type" module. --- src/accounting/report/report_chooser.py | 8 +------- src/accounting/report/report_type.py | 26 +++++++++++++++++++++++++ src/accounting/report/reports.py | 3 ++- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 src/accounting/report/report_type.py diff --git a/src/accounting/report/report_chooser.py b/src/accounting/report/report_chooser.py index 473f6ca..925d587 100644 --- a/src/accounting/report/report_chooser.py +++ b/src/accounting/report/report_chooser.py @@ -21,7 +21,6 @@ This file is largely taken from the NanoParma ERP project, first written in """ import typing as t -from enum import Enum from flask import url_for from flask_babel import LazyString @@ -31,12 +30,7 @@ from accounting.locale import gettext from accounting.models import Currency from accounting.template_globals import default_currency_code from .period import Period - - -class ReportType(Enum): - """The report types.""" - JOURNAL: str = "journal" - """The journal.""" +from .report_type import ReportType class ReportLink: diff --git a/src/accounting/report/report_type.py b/src/accounting/report/report_type.py new file mode 100644 index 0000000..a3bafdc --- /dev/null +++ b/src/accounting/report/report_type.py @@ -0,0 +1,26 @@ +# The Mia! Accounting Flask Project. +# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/4 + +# 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 report types. + +""" +from enum import Enum + + +class ReportType(Enum): + """The report types.""" + JOURNAL: str = "journal" + """The journal.""" diff --git a/src/accounting/report/reports.py b/src/accounting/report/reports.py index b70b251..f3eb715 100644 --- a/src/accounting/report/reports.py +++ b/src/accounting/report/reports.py @@ -32,8 +32,9 @@ from accounting.utils.pagination import Pagination from accounting.utils.txn_types import TransactionType from .period import Period from .period_choosers import PeriodChooser, JournalPeriodChooser -from .report_chooser import ReportChooser, ReportType +from .report_chooser import ReportChooser from .report_rows import ReportRow, JournalRow +from .report_type import ReportType class JournalEntryReport(ABC):