Added the option management, and moved the configuration of the default currency, the default account for the income and expenses log, and the recurring expenses and incomes to the options.

This commit is contained in:
2023-03-22 15:34:28 +08:00
parent fa3cdace7f
commit 761d5a5824
24 changed files with 1919 additions and 79 deletions

View File

@ -20,8 +20,8 @@
from flask import url_for
from accounting.models import Currency, Account
from accounting.option.options import options
from accounting.report.period import Period
from accounting.report.utils.ie_account import default_ie_account_code
from accounting.template_globals import default_currency_code
from accounting.utils.ie_account import IncomeExpensesAccount
@ -65,7 +65,7 @@ def income_expenses_url(currency: Currency, account: IncomeExpensesAccount,
:return: The URL of the income and expenses log.
"""
if currency.code == default_currency_code() \
and account.code == default_ie_account_code() \
and account.code == options.default_ie_account_code \
and period.is_default:
return url_for("accounting.report.default")
if period.is_default: