Renamed the configuration DEFAULT_CURRENCY, DEFAULT_IE_ACCOUNT, and RECURRING to "ACCOUNTING_DEFAULT_CURRENCY", "ACCOUNTING_DEFAULT_IE_ACCOUNT", and "ACCOUNTING_RECURRING", respectively.
This commit is contained in:
parent
a82f5091f1
commit
a42e7d13a2
@ -280,11 +280,11 @@ class DescriptionEditor:
|
|||||||
|
|
||||||
:return: None.
|
:return: None.
|
||||||
"""
|
"""
|
||||||
if "RECURRING" not in current_app.config:
|
if "ACCOUNTING_RECURRING" not in current_app.config:
|
||||||
return
|
return
|
||||||
data: list[tuple[t.Literal["debit", "credit"], str, str, str]] \
|
data: list[tuple[t.Literal["debit", "credit"], str, str, str]] \
|
||||||
= [x.split("|")
|
= [x.split("|")
|
||||||
for x in current_app.config["RECURRING"].split(",")]
|
for x in current_app.config["ACCOUNTING_RECURRING"].split(",")]
|
||||||
debit_credit_dict: dict[t.Literal["debit", "credit"],
|
debit_credit_dict: dict[t.Literal["debit", "credit"],
|
||||||
DescriptionDebitCredit] \
|
DescriptionDebitCredit] \
|
||||||
= {x.debit_credit: x for x in {self.debit, self.credit}}
|
= {x.debit_credit: x for x in {self.debit, self.credit}}
|
||||||
|
@ -72,7 +72,8 @@ def default_ie_account_code() -> str:
|
|||||||
:return: The default account code for the income and expenses log.
|
:return: The default account code for the income and expenses log.
|
||||||
"""
|
"""
|
||||||
with current_app.app_context():
|
with current_app.app_context():
|
||||||
return current_app.config.get("DEFAULT_IE_ACCOUNT", Account.CASH_CODE)
|
return current_app.config.get("ACCOUNTING_DEFAULT_IE_ACCOUNT",
|
||||||
|
Account.CASH_CODE)
|
||||||
|
|
||||||
|
|
||||||
def default_ie_account() -> IncomeExpensesAccount:
|
def default_ie_account() -> IncomeExpensesAccount:
|
||||||
|
@ -36,4 +36,4 @@ def default_currency_code() -> str:
|
|||||||
:return: The default currency code.
|
:return: The default currency code.
|
||||||
"""
|
"""
|
||||||
with current_app.app_context():
|
with current_app.app_context():
|
||||||
return current_app.config.get("DEFAULT_CURRENCY", "USD")
|
return current_app.config.get("ACCOUNTING_DEFAULT_CURRENCY", "USD")
|
||||||
|
@ -50,7 +50,7 @@ def create_app(is_testing: bool = False) -> Flask:
|
|||||||
"SQLALCHEMY_DATABASE_URI": db_uri,
|
"SQLALCHEMY_DATABASE_URI": db_uri,
|
||||||
"BABEL_DEFAULT_LOCALE": "en",
|
"BABEL_DEFAULT_LOCALE": "en",
|
||||||
"ALL_LINGUAS": "zh_Hant|正體中文,en|English,zh_Hans|简体中文",
|
"ALL_LINGUAS": "zh_Hant|正體中文,en|English,zh_Hans|简体中文",
|
||||||
"RECURRING": (
|
"ACCOUNTING_RECURRING": (
|
||||||
"debit|1314-001|Pension|Pension for {last_month_name},"
|
"debit|1314-001|Pension|Pension for {last_month_name},"
|
||||||
"debit|6262-001|Health insurance"
|
"debit|6262-001|Health insurance"
|
||||||
"|Health insurance for {last_month_name},"
|
"|Health insurance for {last_month_name},"
|
||||||
|
Loading…
Reference in New Issue
Block a user