Replace absolute imports with relative imports

This commit is contained in:
2026-04-05 21:20:37 +08:00
parent 674b0de3b2
commit cca3f89bf1
64 changed files with 366 additions and 389 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/3
# 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 re
from flask import abort
from werkzeug.routing import BaseConverter
from accounting.models import Account
from accounting.utils.current_account import CurrentAccount
from .period import Period, get_period
from ..models import Account
from ..utils.current_account import CurrentAccount
class PeriodConverter(BaseConverter):
+3 -3
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/4
# 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.
@@ -23,11 +23,11 @@ This file is largely taken from the NanoParma ERP project, first written in
import datetime as dt
from collections.abc import Callable
from accounting.models import JournalEntry
from accounting.utils.timezone import get_tz_today
from .period import Period
from .shortcuts import ThisMonth, LastMonth, SinceLastMonth, ThisYear, \
LastYear, Today, Yesterday, AllTime, TemplatePeriod, YearPeriod
from ...models import JournalEntry
from ...utils.timezone import get_tz_today
class PeriodChooser:
+2 -2
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/4
# 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.
@@ -19,7 +19,7 @@
"""
import datetime as dt
from accounting.locale import gettext
from ...locale import gettext
def get_desc(start: dt.date | None, end: dt.date | None) -> str:
+3 -3
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/4
# 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.
@@ -19,10 +19,10 @@
"""
import datetime as dt
from accounting.locale import gettext
from accounting.utils.timezone import get_tz_today
from .month_end import month_end
from .period import Period
from ...locale import gettext
from ...utils.timezone import get_tz_today
class ThisMonth(Period):
+12 -14
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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,20 +22,18 @@ from decimal import Decimal
import sqlalchemy as sa
from flask import render_template, Response
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, BaseAccount, Account, JournalEntry, \
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import ledger_url, balance_sheet_url, income_statement_url
from ... import db
from ...locale import gettext
from ...models import Currency, BaseAccount, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import ledger_url, balance_sheet_url, \
income_statement_url
class ReportAccount:
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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.
@@ -24,21 +24,19 @@ import sqlalchemy as sa
from flask import url_for, render_template, Response
from sqlalchemy.orm import selectinload
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import income_expenses_url
from accounting.utils.current_account import CurrentAccount
from accounting.utils.pagination import Pagination
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import income_expenses_url
from ... import db
from ...locale import gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
from ...utils.current_account import CurrentAccount
from ...utils.pagination import Pagination
class ReportLineItem:
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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,19 +22,18 @@ from decimal import Decimal
import sqlalchemy as sa
from flask import render_template, Response
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, BaseAccount, Account, JournalEntry, \
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import ledger_url, income_statement_url
from ... import db
from ...locale import gettext
from ...models import Currency, BaseAccount, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import ledger_url, income_statement_url
class ReportAccount:
+11 -13
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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.
@@ -24,18 +24,16 @@ import sqlalchemy as sa
from flask import render_template, Response
from sqlalchemy.orm import selectinload
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import journal_url
from accounting.utils.pagination import Pagination
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import journal_url
from ...locale import gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
from ...utils.pagination import Pagination
class ReportLineItem:
+13 -15
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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.
@@ -24,20 +24,18 @@ import sqlalchemy as sa
from flask import url_for, render_template, Response
from sqlalchemy.orm import selectinload
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import ledger_url
from accounting.utils.pagination import Pagination
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import ledger_url
from ... import db
from ...locale import gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
from ...utils.pagination import Pagination
class ReportLineItem:
+11 -11
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/8
# 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.
@@ -24,17 +24,17 @@ import sqlalchemy as sa
from flask import Response, render_template, request
from sqlalchemy.orm import selectinload
from accounting.locale import gettext
from accounting.models import Currency, CurrencyL10n, Account, AccountL10n, \
JournalEntry, JournalEntryLineItem
from accounting.report.utils.base_page_params import BasePageParams
from accounting.report.utils.base_report import BaseReport
from accounting.report.utils.csv_export import csv_download
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.utils.pagination import Pagination
from accounting.utils.query import parse_query_keywords
from .journal import get_csv_rows
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import csv_download
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ...locale import gettext
from ...models import Currency, CurrencyL10n, Account, AccountL10n, \
JournalEntry, JournalEntryLineItem
from ...utils.pagination import Pagination
from ...utils.query import parse_query_keywords
class LineItemCollector:
+12 -14
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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,19 +22,17 @@ from decimal import Decimal
import sqlalchemy as sa
from flask import Response, render_template
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.period import Period, PeriodChooser
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.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.urls import ledger_url, trial_balance_url
from ..period import Period, PeriodChooser
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download, period_spec
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.urls import ledger_url, trial_balance_url
from ... import db
from ...locale import gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
class ReportAccount:
+12 -14
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/7
# 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,19 +23,17 @@ from decimal import Decimal
from flask import render_template, Response
from sqlalchemy.orm import selectinload
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
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
from accounting.report.utils.option_link import OptionLink
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.unapplied import get_accounts_with_unapplied, \
get_net_balances
from accounting.report.utils.urls import unapplied_url
from accounting.utils.pagination import Pagination
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.unapplied import get_accounts_with_unapplied, get_net_balances
from ..utils.urls import unapplied_url
from ...locale import gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
from ...utils.pagination import Pagination
class CSVRow(BaseCSVRow):
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/7
# 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,16 +22,16 @@ from decimal import Decimal
from flask import render_template, Response
from accounting.locale import gettext
from accounting.models import Currency, Account
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
from accounting.report.utils.option_link import OptionLink
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.unapplied import get_accounts_with_unapplied
from accounting.report.utils.urls import unapplied_url
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.unapplied import get_accounts_with_unapplied
from ..utils.urls import unapplied_url
from ...locale import gettext
from ...models import Currency, Account
class CSVRow(BaseCSVRow):
+13 -13
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/17
# 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,18 +23,18 @@ from decimal import Decimal
from flask import render_template, Response
from flask_babel import LazyString
from accounting.locale import gettext
from accounting.models import Currency, Account, JournalEntryLineItem
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
from accounting.report.utils.offset_matcher import OffsetMatcher, OffsetPair
from accounting.report.utils.option_link import OptionLink
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.unmatched import get_accounts_with_unmatched
from accounting.report.utils.urls import unmatched_url
from accounting.utils.pagination import Pagination
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download
from ..utils.offset_matcher import OffsetMatcher, OffsetPair
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.unmatched import get_accounts_with_unmatched
from ..utils.urls import unmatched_url
from ...locale import gettext
from ...models import Currency, Account, JournalEntryLineItem
from ...utils.pagination import Pagination
class CSVRow(BaseCSVRow):
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/17
# 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,16 +22,16 @@ from decimal import Decimal
from flask import render_template, Response
from accounting.locale import gettext
from accounting.models import Currency, Account
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
from accounting.report.utils.option_link import OptionLink
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.report.utils.unmatched import get_accounts_with_unmatched
from accounting.report.utils.urls import unmatched_url
from ..utils.base_page_params import BasePageParams
from ..utils.base_report import BaseReport
from ..utils.csv_export import BaseCSVRow, csv_download
from ..utils.option_link import OptionLink
from ..utils.report_chooser import ReportChooser
from ..utils.report_type import ReportType
from ..utils.unmatched import get_accounts_with_unmatched
from ..utils.urls import unmatched_url
from ...locale import gettext
from ...models import Currency, Account
class CSVRow(BaseCSVRow):
+2 -2
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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.
@@ -19,7 +19,7 @@
"""
from decimal import Decimal
from accounting.template_filters import format_amount as core_format_amount
from ..template_filters import format_amount as core_format_amount
def format_amount(value: Decimal | None) -> str | None:
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/6
# 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,11 +26,11 @@ from urllib.parse import urlparse, ParseResult, parse_qsl, urlencode, \
import sqlalchemy as sa
from flask import request
from accounting import db
from accounting.models import Currency, JournalEntryLineItem
from accounting.utils.journal_entry_types import JournalEntryType
from .option_link import OptionLink
from .report_chooser import ReportChooser
from ... import db
from ...models import Currency, JournalEntryLineItem
from ...utils.journal_entry_types import JournalEntryType
class BasePageParams(ABC):
+2 -2
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/7
# 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,7 +26,7 @@ from urllib.parse import quote
from flask import Response
from accounting.report.period import Period
from ..period import Period
class BaseCSVRow(ABC):
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/8
# 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,10 +23,9 @@ import sqlalchemy as sa
from flask_babel import LazyString
from sqlalchemy.orm import selectinload
from accounting.locale import lazy_gettext
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.report.utils.unapplied import get_net_balances
from ..utils.unapplied import get_net_balances
from ...locale import lazy_gettext
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
class OffsetPair:
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/4
# 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.
@@ -25,18 +25,18 @@ from collections.abc import Iterator
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, get_period
from accounting.template_globals import default_currency_code
from accounting.utils.current_account import CurrentAccount
from accounting.utils.permission import can_edit
from .option_link import OptionLink
from .report_type import ReportType
from .urls import journal_url, ledger_url, income_expenses_url, \
trial_balance_url, income_statement_url, balance_sheet_url, \
unapplied_url, unmatched_url
from ..period import Period, get_period
from ... import db
from ...locale import gettext
from ...models import Currency, Account
from ...template_globals import default_currency_code
from ...utils.current_account import CurrentAccount
from ...utils.permission import can_edit
class ReportChooser:
+4 -5
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/7
# 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.
@@ -21,10 +21,9 @@ from decimal import Decimal
import sqlalchemy as sa
from accounting import db
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from accounting.utils.offset_alias import offset_alias
from ... import db
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
from ...utils.offset_alias import offset_alias
def get_accounts_with_unapplied(currency: Currency) -> list[Account]:
+3 -4
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/4/8
# 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.
@@ -19,9 +19,8 @@
"""
import sqlalchemy as sa
from accounting import db
from accounting.models import Currency, Account, JournalEntry, \
JournalEntryLineItem
from ... import db
from ...models import Currency, Account, JournalEntry, JournalEntryLineItem
def get_accounts_with_unmatched(currency: Currency) -> list[Account]:
+6 -6
View File
@@ -1,7 +1,7 @@
# The Mia! Accounting Project.
# Author: imacat@mail.imacat.idv.tw (imacat), 2023/3/9
# 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.
@@ -19,11 +19,11 @@
"""
from flask import url_for
from accounting.models import Currency, Account
from accounting.report.period import Period
from accounting.template_globals import default_currency_code
from accounting.utils.current_account import CurrentAccount
from accounting.utils.options import options
from ...models import Currency, Account
from ...report.period import Period
from ...template_globals import default_currency_code
from ...utils.current_account import CurrentAccount
from ...utils.options import options
def journal_url(period: Period) \
+9 -9
View File
@@ -19,15 +19,6 @@
"""
from flask import Blueprint, request, Response, redirect, flash
from accounting import db
from accounting.locale import lazy_gettext
from accounting.models import Currency, Account
from accounting.template_globals import default_currency_code
from accounting.utils.cast import s
from accounting.utils.current_account import CurrentAccount
from accounting.utils.next_uri import or_next
from accounting.utils.options import options
from accounting.utils.permission import has_permission, can_view, can_edit
from .period import Period, get_period
from .reports import Journal, Ledger, IncomeExpenses, TrialBalance, \
IncomeStatement, BalanceSheet, Search
@@ -38,6 +29,15 @@ from .reports.unmatched_accounts import AccountsWithUnmatchedOffsets
from .template_filters import format_amount
from .utils.offset_matcher import OffsetMatcher
from .utils.urls import unmatched_url
from .. import db
from ..locale import lazy_gettext
from ..models import Currency, Account
from ..template_globals import default_currency_code
from ..utils.cast import s
from ..utils.current_account import CurrentAccount
from ..utils.next_uri import or_next
from ..utils.options import options
from ..utils.permission import has_permission, can_view, can_edit
bp: Blueprint = Blueprint("accounting-report", __name__)
"""The view blueprint for the reports."""