Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Add preference for native amounts.
James Cole25b11bd20b3d
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.phpindex 7c35414b8b..6de7ce95eb 100644--- a/app/Http/Controllers/PreferencesController.php+++ b/app/Http/Controllers/PreferencesController.php@@ -103,6 +103,7 @@ class PreferencesController extends Controller$darkMode = app('preferences')->get('darkMode', 'browser')->data;$customFiscalYear = app('preferences')->get('customFiscalYear', 0)->data;$fiscalYearStartStr = app('preferences')->get('fiscalYearStart', '01-01')->data;+ $convertToNative =app('preferences')->get('convert_to_native', false)->data;if (is_array($fiscalYearStartStr)) {$fiscalYearStartStr = '01-01';}@@ -188,6 +189,7 @@ class PreferencesController extends Controller'darkMode','availableDarkModes','notifications',+ 'convertToNative','slackUrl','locales','locale',@@ -254,6 +256,10 @@ class PreferencesController extends Controllerapp('preferences')->set('ntfy_auth', $all['ntfy_auth'] ?? false);}+ // convert native+ $convertToNative = 1 === (int) $request->get('convertToNative');+ app('preferences')->set('convert_to_native', $convertToNative);+// custom fiscal year$customFiscalYear = 1 === (int) $request->get('customFiscalYear');$string = strtotime((string) $request->get('fiscalYearStart'));diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex b07159e4cc..95aae7de60 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -1320,6 +1320,9 @@ return ['pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?','pref_locale_help' => 'Firefly III allows you to set other local settings, like how currencies, numbers and dates are formatted. Entries in this list may not be supported by your system. Firefly III doesn\'t have the correct date settings for every locale; contact me for improvements.','pref_locale_no_demo' => 'This feature won\'t work for the demo user.',+ 'pref_convert_to_native' => 'Display amounts in your native currency',+ 'pref_convert_to_native_help' => 'This option will make Firefly III try to display and show your native currency in as many places as possible, converting amounts where necessary. This sacrifices accuracy for ease of use, because conversion is not always exact. Please verify that Firefly III has the necessary conversion rates on the "exchange rates"-page.',+ 'pref_convert_native_help' => 'Display native amounts','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',diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twigindex 57cc77e50f..e8f16f4c32 100644--- a/resources/views/preferences/index.twig+++ b/resources/views/preferences/index.twig@@ -99,6 +99,15 @@{{ ExpandedForm.checkbox('customFiscalYear','1',isCustomFiscalYear,{ 'label' : 'pref_custom_fiscal_year_label'|_ }) }}{{ ExpandedForm.date('fiscalYearStart',fiscalYearStart,{ 'label' : 'pref_fiscal_year_start_label'|_ }) }}</div>++ {# conversion back to natiev #}+ <div class="preferences-box">+ <h3>{{ 'pref_convert_to_native'|_ }}</h3>+ <p class="text-info">+ {{ 'pref_convert_to_native_help'|_ }}+ </p>+ {{ ExpandedForm.checkbox('convertToNative','1',convertToNative,{ 'label' : 'pref_convert_native_help'|_ }) }}+ </div></div>{# general settings column B #}