Moved the "accounting.transaction.operators", "accounting.transaction.summary_editor" and "accounting.transaction.form.account_option" modules into the "accounting.transaction.utils" module.
This commit is contained in:
parent
3dda6531b5
commit
6ad4fba9cd
@ -33,11 +33,11 @@ from accounting import db
|
|||||||
from accounting.locale import lazy_gettext
|
from accounting.locale import lazy_gettext
|
||||||
from accounting.models import Transaction, Account, JournalEntry, \
|
from accounting.models import Transaction, Account, JournalEntry, \
|
||||||
TransactionCurrency
|
TransactionCurrency
|
||||||
from accounting.transaction.summary_editor import SummaryEditor
|
from accounting.transaction.utils.account_option import AccountOption
|
||||||
|
from accounting.transaction.utils.summary_editor import SummaryEditor
|
||||||
from accounting.utils.random_id import new_id
|
from accounting.utils.random_id import new_id
|
||||||
from accounting.utils.strip_text import strip_multiline_text
|
from accounting.utils.strip_text import strip_multiline_text
|
||||||
from accounting.utils.user import get_current_user_pk
|
from accounting.utils.user import get_current_user_pk
|
||||||
from .account_option import AccountOption
|
|
||||||
from .currency import CurrencyForm, IncomeCurrencyForm, ExpenseCurrencyForm, \
|
from .currency import CurrencyForm, IncomeCurrencyForm, ExpenseCurrencyForm, \
|
||||||
TransferCurrencyForm
|
TransferCurrencyForm
|
||||||
from .journal_entry import JournalEntryForm, DebitEntryForm, CreditEntryForm
|
from .journal_entry import JournalEntryForm, DebitEntryForm, CreditEntryForm
|
||||||
|
19
src/accounting/transaction/utils/__init__.py
Normal file
19
src/accounting/transaction/utils/__init__.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# The Mia! Accounting Flask Project.
|
||||||
|
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||||
|
|
||||||
|
# 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 for the transaction management.
|
||||||
|
|
||||||
|
"""
|
@ -26,7 +26,7 @@ from flask_wtf import FlaskForm
|
|||||||
from accounting.models import Transaction
|
from accounting.models import Transaction
|
||||||
from accounting.template_globals import default_currency_code
|
from accounting.template_globals import default_currency_code
|
||||||
from accounting.utils.txn_types import TransactionType
|
from accounting.utils.txn_types import TransactionType
|
||||||
from .form import TransactionForm, IncomeTransactionForm, \
|
from accounting.transaction.form import TransactionForm, IncomeTransactionForm, \
|
||||||
ExpenseTransactionForm, TransferTransactionForm
|
ExpenseTransactionForm, TransferTransactionForm
|
||||||
|
|
||||||
|
|
@ -34,9 +34,9 @@ from accounting.utils.permission import has_permission, can_view, can_edit
|
|||||||
from accounting.utils.txn_types import TransactionType
|
from accounting.utils.txn_types import TransactionType
|
||||||
from accounting.utils.user import get_current_user_pk
|
from accounting.utils.user import get_current_user_pk
|
||||||
from .form import sort_transactions_in, TransactionReorderForm
|
from .form import sort_transactions_in, TransactionReorderForm
|
||||||
from .operators import TransactionOperator, TXN_TYPE_TO_OP, get_txn_op
|
|
||||||
from .template_filters import with_type, to_transfer, format_amount_input, \
|
from .template_filters import with_type, to_transfer, format_amount_input, \
|
||||||
text2html
|
text2html
|
||||||
|
from .utils.operators import TransactionOperator, TXN_TYPE_TO_OP, get_txn_op
|
||||||
|
|
||||||
bp: Blueprint = Blueprint("transaction", __name__)
|
bp: Blueprint = Blueprint("transaction", __name__)
|
||||||
"""The view blueprint for the transaction management."""
|
"""The view blueprint for the transaction management."""
|
||||||
|
@ -66,7 +66,7 @@ class SummeryEditorTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
:return: None.
|
:return: None.
|
||||||
"""
|
"""
|
||||||
from accounting.transaction.summary_editor import SummaryEditor
|
from accounting.transaction.utils.summary_editor import SummaryEditor
|
||||||
for form in get_form_data(self.csrf_token):
|
for form in get_form_data(self.csrf_token):
|
||||||
add_txn(self.client, form)
|
add_txn(self.client, form)
|
||||||
with self.app.app_context():
|
with self.app.app_context():
|
||||||
|
Loading…
Reference in New Issue
Block a user