From 40c4c9f1098ff7e670177d42ba954ae0ec5d62b4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 31 Oct 2025 06:30:56 +0100 Subject: [PATCH] Fix #11132 --- app/Http/Controllers/Account/CreateController.php | 9 ++++----- app/Http/Controllers/Account/EditController.php | 9 ++++----- config/firefly.php | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php index bab54065d9..81ab82b9c8 100644 --- a/app/Http/Controllers/Account/CreateController.php +++ b/app/Http/Controllers/Account/CreateController.php @@ -96,11 +96,10 @@ class CreateController extends Controller ]; // interest calculation periods: - $interestPeriods = [ - 'daily' => (string) trans('firefly.interest_calc_daily'), - 'monthly' => (string) trans('firefly.interest_calc_monthly'), - 'yearly' => (string) trans('firefly.interest_calc_yearly'), - ]; + $interestPeriods = []; + foreach(config('firefly.interest_periods') as $period) { + $interestPeriods[$period] = trans(sprintf('firefly.interest_calc_%s' , $period)); + } // pre fill some data $request->session()->flash( diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php index 8c2d083b13..06ae515db4 100644 --- a/app/Http/Controllers/Account/EditController.php +++ b/app/Http/Controllers/Account/EditController.php @@ -108,11 +108,10 @@ class EditController extends Controller ]; // interest calculation periods: - $interestPeriods = [ - 'daily' => (string) trans('firefly.interest_calc_daily'), - 'monthly' => (string) trans('firefly.interest_calc_monthly'), - 'yearly' => (string) trans('firefly.interest_calc_yearly'), - ]; + $interestPeriods = []; + foreach(config('firefly.interest_periods') as $period) { + $interestPeriods[$period] = trans(sprintf('firefly.interest_calc_%s' , $period)); + } // put previous url in session if not redirect from store (not "return_to_edit"). if (true !== session('accounts.edit.fromUpdate')) { diff --git a/config/firefly.php b/config/firefly.php index 6bbb6b2429..ea0f90e122 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -309,7 +309,7 @@ return [ // "period must be in this list" values 'bill_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], - 'interest_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], + 'interest_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], // settings to translate X to Y 'range_to_repeat_freq' => [