Replace absolute imports with relative imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/2/19
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -22,9 +22,9 @@ import datetime as dt
|
||||
from flask import abort
|
||||
from werkzeug.routing import BaseConverter
|
||||
|
||||
from accounting import db
|
||||
from accounting.models import JournalEntry
|
||||
from accounting.utils.journal_entry_types import JournalEntryType
|
||||
from .. import db
|
||||
from ..models import JournalEntry
|
||||
from ..utils.journal_entry_types import JournalEntryType
|
||||
|
||||
|
||||
class JournalEntryConverter(BaseConverter):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -26,13 +26,13 @@ from wtforms import StringField, ValidationError, FieldList, IntegerField, \
|
||||
BooleanField, FormField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
from accounting import db
|
||||
from accounting.forms import CurrencyExists
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import JournalEntryLineItem
|
||||
from accounting.utils.offset_alias import offset_alias
|
||||
from accounting.utils.strip_text import strip_text
|
||||
from .line_item import LineItemForm, CreditLineItemForm, DebitLineItemForm
|
||||
from ... import db
|
||||
from ...forms import CurrencyExists
|
||||
from ...locale import lazy_gettext
|
||||
from ...models import JournalEntryLineItem
|
||||
from ...utils.offset_alias import offset_alias
|
||||
from ...utils.strip_text import strip_text
|
||||
|
||||
CURRENCY_REQUIRED: DataRequired = DataRequired(
|
||||
lazy_gettext("Please select the currency."))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/2/18
|
||||
|
||||
# Copyright (c) 2023-2024 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -28,21 +28,20 @@ from wtforms import DateField, FieldList, FormField, TextAreaField, \
|
||||
BooleanField
|
||||
from wtforms.validators import DataRequired, ValidationError
|
||||
|
||||
from accounting import db
|
||||
from accounting.journal_entry.utils.account_option import AccountOption
|
||||
from accounting.journal_entry.utils.description_editor import DescriptionEditor
|
||||
from accounting.journal_entry.utils.original_line_items import \
|
||||
get_selectable_original_line_items
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import JournalEntry, Account, JournalEntryLineItem, \
|
||||
JournalEntryCurrency
|
||||
from accounting.utils.random_id import new_id
|
||||
from accounting.utils.strip_text import strip_multiline_text
|
||||
from accounting.utils.user import get_current_user_pk
|
||||
from .currency import CurrencyForm, CashReceiptCurrencyForm, \
|
||||
CashDisbursementCurrencyForm, TransferCurrencyForm
|
||||
from .line_item import LineItemForm, DebitLineItemForm, CreditLineItemForm
|
||||
from .reorder import sort_journal_entries_in
|
||||
from ..utils.account_option import AccountOption
|
||||
from ..utils.description_editor import DescriptionEditor
|
||||
from ..utils.original_line_items import get_selectable_original_line_items
|
||||
from ... import db
|
||||
from ...locale import lazy_gettext
|
||||
from ...models import JournalEntry, Account, JournalEntryLineItem, \
|
||||
JournalEntryCurrency
|
||||
from ...utils.random_id import new_id
|
||||
from ...utils.strip_text import strip_multiline_text
|
||||
from ...utils.user import get_current_user_pk
|
||||
|
||||
DATE_REQUIRED: DataRequired = DataRequired(
|
||||
lazy_gettext("Please fill in the date."))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -27,15 +27,15 @@ from sqlalchemy.orm import selectinload
|
||||
from wtforms import StringField, ValidationError, DecimalField, IntegerField
|
||||
from wtforms.validators import Optional
|
||||
|
||||
from accounting import db
|
||||
from accounting.forms import ACCOUNT_REQUIRED, AccountExists, IsDebitAccount, \
|
||||
from ... import db
|
||||
from ...forms import ACCOUNT_REQUIRED, AccountExists, IsDebitAccount, \
|
||||
IsCreditAccount
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import Account, JournalEntry, JournalEntryLineItem
|
||||
from accounting.template_filters import format_amount
|
||||
from accounting.utils.random_id import new_id
|
||||
from accounting.utils.strip_text import strip_text
|
||||
from accounting.utils.user import get_current_user_pk
|
||||
from ...locale import lazy_gettext
|
||||
from ...models import Account, JournalEntry, JournalEntryLineItem
|
||||
from ...template_filters import format_amount
|
||||
from ...utils.random_id import new_id
|
||||
from ...utils.strip_text import strip_text
|
||||
from ...utils.user import get_current_user_pk
|
||||
|
||||
|
||||
class OriginalLineItemExists:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -22,8 +22,8 @@ import datetime as dt
|
||||
import sqlalchemy as sa
|
||||
from flask import request
|
||||
|
||||
from accounting import db
|
||||
from accounting.models import JournalEntry
|
||||
from ... import db
|
||||
from ...models import JournalEntry
|
||||
|
||||
|
||||
def sort_journal_entries_in(date: dt.date, exclude: int | None = None) -> None:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,7 @@
|
||||
"""The account option for the journal entry management.
|
||||
|
||||
"""
|
||||
from accounting.models import Account
|
||||
from ...models import Account
|
||||
|
||||
|
||||
class AccountOption:
|
||||
|
||||
@@ -22,9 +22,9 @@ from typing import Literal
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from accounting import db
|
||||
from accounting.models import Account, JournalEntryLineItem
|
||||
from accounting.utils.options import options, Recurring
|
||||
from ... import db
|
||||
from ...models import Account, JournalEntryLineItem
|
||||
from ...utils.options import options, Recurring
|
||||
|
||||
|
||||
class DescriptionAccount:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/2/19
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -23,13 +23,12 @@ from typing import Type
|
||||
from flask import render_template, request, abort
|
||||
from flask_wtf import FlaskForm
|
||||
|
||||
from accounting.journal_entry.forms import JournalEntryForm, \
|
||||
CashReceiptJournalEntryForm, CashDisbursementJournalEntryForm, \
|
||||
TransferJournalEntryForm
|
||||
from accounting.journal_entry.forms.line_item import LineItemForm
|
||||
from accounting.models import JournalEntry
|
||||
from accounting.template_globals import default_currency_code
|
||||
from accounting.utils.journal_entry_types import JournalEntryType
|
||||
from ..forms import JournalEntryForm, CashReceiptJournalEntryForm, \
|
||||
CashDisbursementJournalEntryForm, TransferJournalEntryForm
|
||||
from ..forms.line_item import LineItemForm
|
||||
from ...models import JournalEntry
|
||||
from ...template_globals import default_currency_code
|
||||
from ...utils.journal_entry_types import JournalEntryType
|
||||
|
||||
|
||||
class JournalEntryOperator(ABC):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# The Mia! Accounting Project.
|
||||
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/10
|
||||
|
||||
# Copyright (c) 2023 imacat.
|
||||
# Copyright (c) 2023-2026 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -22,9 +22,9 @@ from decimal import Decimal
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.orm import selectinload
|
||||
|
||||
from accounting import db
|
||||
from accounting.models import Account, JournalEntry, JournalEntryLineItem
|
||||
from accounting.utils.offset_alias import offset_alias
|
||||
from ... import db
|
||||
from ...models import Account, JournalEntry, JournalEntryLineItem
|
||||
from ...utils.offset_alias import offset_alias
|
||||
|
||||
|
||||
def get_selectable_original_line_items(
|
||||
|
||||
@@ -25,21 +25,21 @@ from flask import Blueprint, render_template, session, redirect, request, \
|
||||
flash, url_for, Response
|
||||
from werkzeug.datastructures import ImmutableMultiDict
|
||||
|
||||
from accounting import db
|
||||
from accounting.locale import lazy_gettext
|
||||
from accounting.models import JournalEntry
|
||||
from accounting.utils.cast import s
|
||||
from accounting.utils.flash_errors import flash_form_errors
|
||||
from accounting.utils.journal_entry_types import JournalEntryType
|
||||
from accounting.utils.next_uri import inherit_next, or_next
|
||||
from accounting.utils.permission import has_permission, can_view, can_edit
|
||||
from accounting.utils.timezone import get_tz_today
|
||||
from accounting.utils.user import get_current_user_pk
|
||||
from .forms import sort_journal_entries_in, JournalEntryReorderForm
|
||||
from .template_filters import with_type, to_transfer, format_amount_input, \
|
||||
text2html
|
||||
from .utils.operators import JournalEntryOperator, JOURNAL_ENTRY_TYPE_TO_OP, \
|
||||
get_journal_entry_op
|
||||
from .. import db
|
||||
from ..locale import lazy_gettext
|
||||
from ..models import JournalEntry
|
||||
from ..utils.cast import s
|
||||
from ..utils.flash_errors import flash_form_errors
|
||||
from ..utils.journal_entry_types import JournalEntryType
|
||||
from ..utils.next_uri import inherit_next, or_next
|
||||
from ..utils.permission import has_permission, can_view, can_edit
|
||||
from ..utils.timezone import get_tz_today
|
||||
from ..utils.user import get_current_user_pk
|
||||
|
||||
bp: Blueprint = Blueprint("journal-entry", __name__)
|
||||
"""The view blueprint for the journal entry management."""
|
||||
|
||||
Reference in New Issue
Block a user