Add preference for native amounts.

This commit is contained in:
James Cole
2024-12-22 15:53:59 +01:00
parent f6e642f72e
commit 25b11bd20b
3 changed files with 18 additions and 0 deletions

View File

@@ -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'));