diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index e99744209..d8684fb3f 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -374,7 +374,7 @@ abstract class Report $financial_year = $this->getFinancialYear($this->year); if ($date->greaterThanOrEqualTo($financial_year->getStartDate()) && $date->lessThanOrEqualTo($financial_year->getEndDate())) { - if (setting('localisation.financial_year_denote') == 'begins') { + if (setting('localisation.financial_denote') == 'begins') { $i = $financial_year->getStartDate()->copy()->format($this->getYearlyDateFormat()); } else { $i = $financial_year->getEndDate()->copy()->format($this->getYearlyDateFormat()); diff --git a/app/Http/Controllers/Settings/Localisation.php b/app/Http/Controllers/Settings/Localisation.php index b538d865e..aff8cd058 100644 --- a/app/Http/Controllers/Settings/Localisation.php +++ b/app/Http/Controllers/Settings/Localisation.php @@ -41,9 +41,9 @@ class Localisation extends Controller 'both' => trans('settings.localisation.discount_location.both'), ]; - $financial_year_denote_options = [ - 'begins' => trans('settings.localisation.financial_year_denote.begins'), - 'ends' => trans('settings.localisation.financial_year_denote.ends'), + $financial_denote_options = [ + 'begins' => trans('settings.localisation.financial_denote.begins'), + 'ends' => trans('settings.localisation.financial_denote.ends'), ]; return view('settings.localisation.edit', compact( @@ -52,7 +52,7 @@ class Localisation extends Controller 'date_separators', 'percent_positions', 'discount_locations', - 'financial_year_denote_options' + 'financial_denote_options' )); } } diff --git a/app/Traits/DateTime.php b/app/Traits/DateTime.php index 6bcaa4fe8..79b2b2fae 100644 --- a/app/Traits/DateTime.php +++ b/app/Traits/DateTime.php @@ -110,7 +110,7 @@ trait DateTime $financial_start = Date::create($year, $month, $day); - if (setting('localisation.financial_year_denote') == 'ends' && $financial_start->dayOfYear != 1) { + if ((setting('localisation.financial_denote') == 'ends') && ($financial_start->dayOfYear != 1)) { $financial_start->subYear(); } diff --git a/config/setting.php b/config/setting.php index ef2537a45..c3082d162 100644 --- a/config/setting.php +++ b/config/setting.php @@ -98,12 +98,12 @@ return [ 'fallback' => [ 'localisation' => [ 'financial_start' => env('SETTING_FALLBACK_LOCALISATION_FINANCIAL_START', '01-01'), + 'financial_denote' => env('SETTING_FALLBACK_LOCALISATION_FINANCIAL_DENOTE', 'ends'), 'timezone' => env('SETTING_FALLBACK_LOCALISATION_TIMEZONE', 'Europe/London'), 'date_format' => env('SETTING_FALLBACK_LOCALISATION_DATE_FORMAT', 'd M Y'), 'date_separator' => env('SETTING_FALLBACK_LOCALISATION_DATE_SEPARATOR', 'space'), 'percent_position' => env('SETTING_FALLBACK_LOCALISATION_PERCENT_POSITION', 'after'), 'discount_location' => env('SETTING_FALLBACK_LOCALISATION_DISCOUNT_LOCATION', 'total'), - 'financial_year_denote' => env('SETTING_FALLBACK_LOCALISATION_FINANCIAL_YEAR_DENOTE', 'ends'), ], 'invoice' => [ 'number_prefix' => env('SETTING_FALLBACK_INVOICE_NUMBER_PREFIX', 'INV-'), diff --git a/resources/lang/en-GB/settings.php b/resources/lang/en-GB/settings.php index c5bf423e3..dc1516ed5 100644 --- a/resources/lang/en-GB/settings.php +++ b/resources/lang/en-GB/settings.php @@ -16,6 +16,11 @@ return [ 'description' => 'Set fiscal year, time zone, date format and more locals', 'financial_start' => 'Financial Year Start', 'timezone' => 'Time Zone', + 'financial_denote' => [ + 'title' => 'Financial Year Denote', + 'begins' => 'By the year in which it begins', + 'ends' => 'By the year in which it ends', + ], 'date' => [ 'format' => 'Date Format', 'separator' => 'Date Separator', @@ -36,11 +41,6 @@ return [ 'total' => 'At total', 'both' => 'Both line and total', ], - 'financial_year_denote' => [ - 'title' => 'Financial Year Denote', - 'begins' => 'By the year it begins', - 'ends' => 'By the year it ends', - ], ], 'invoice' => [ diff --git a/resources/views/settings/localisation/edit.blade.php b/resources/views/settings/localisation/edit.blade.php index 29f588924..2018e8346 100644 --- a/resources/views/settings/localisation/edit.blade.php +++ b/resources/views/settings/localisation/edit.blade.php @@ -20,7 +20,7 @@
{{ Form::dateGroup('financial_start', trans('settings.localisation.financial_start'), 'calendar', ['id' => 'financial_start', 'class' => 'form-control datepicker', 'show-date-format' => 'j F', 'date-format' => 'd-m', 'autocomplete' => 'off'], setting('localisation.financial_start')) }} - {{ Form::selectGroup('financial_year_denote', trans('settings.localisation.financial_year_denote.title'), 'calendar', $financial_year_denote_options, setting('localisation.financial_year_denote'), []) }} + {{ Form::selectGroup('financial_denote', trans('settings.localisation.financial_denote.title'), 'calendar', $financial_denote_options, setting('localisation.financial_denote'), []) }} {{ Form::selectGroupGroup('timezone', trans('settings.localisation.timezone'), 'globe', $timezones, setting('localisation.timezone'), []) }}