diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 9cc7d3e861..641a817fe0 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -39,10 +39,11 @@ class PreferencesController extends Controller $budgetMax = Preferences::get('budgetMaximum', 1000); $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; $budgetMaximum = $budgetMax->data; + $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', 'false') == 'true'; - return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'showIncomplete')); + return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'customFiscalYear', 'showIncomplete')); } /** @@ -70,6 +71,10 @@ class PreferencesController extends Controller $budgetMaximum = intval(Input::get('budgetMaximum')); Preferences::set('budgetMaximum', $budgetMaximum); + // custom fiscal year + $customFiscalYear = (int) Input::get('customFiscalYear'); + Preferences::set('customFiscalYear', $customFiscalYear); + // language: $lang = Input::get('language'); if (in_array($lang, array_keys(Config::get('firefly.languages')))) { diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 6143ad0d6d..2aaa1dbe18 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -169,6 +169,9 @@ return [ 'pref_6M' => 'Six months', 'pref_languages' => 'Languages', 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?', + 'pref_custom_fiscal_year' => 'Fiscal year settings', + 'pref_custom_fiscal_year_label' => 'Enabled', + 'pref_custom_fiscal_year_help' => 'In countries that use a financial year other than January 1 to December 31, you can switch this on and specify start / end days of the fiscal year', 'pref_save_settings' => 'Save settings', // profile: diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig index f847fa1f6d..42aaba1292 100644 --- a/resources/views/preferences/index.twig +++ b/resources/views/preferences/index.twig @@ -45,6 +45,18 @@ {{ ExpandedForm.amount('budgetMaximum',budgetMaximum,{'label' : 'Budget maximum'}) }} +
+ {{ 'pref_custom_fiscal_year_help'|_ }} +
+ {% set isCustomFiscalYear = customFiscalYear == 1 ? true : false %} + {{ ExpandedForm.checkbox('customFiscalYear','1',isCustomFiscalYear,{ 'label' : 'pref_custom_fiscal_year_label'|_ }) }} +