mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 14:58:40 +00:00
Add preference for native amounts.
This commit is contained in:
@@ -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 Controller
|
||||
app('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'));
|
||||
|
@@ -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',
|
||||
|
@@ -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 #}
|
||||
|
Reference in New Issue
Block a user