This commit is contained in:
Denis Duliçi 2021-02-12 23:05:50 +03:00
parent a64fe6f779
commit 8cdb9a2a21
6 changed files with 13 additions and 13 deletions

View File

@ -374,7 +374,7 @@ abstract class Report
$financial_year = $this->getFinancialYear($this->year); $financial_year = $this->getFinancialYear($this->year);
if ($date->greaterThanOrEqualTo($financial_year->getStartDate()) && $date->lessThanOrEqualTo($financial_year->getEndDate())) { 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()); $i = $financial_year->getStartDate()->copy()->format($this->getYearlyDateFormat());
} else { } else {
$i = $financial_year->getEndDate()->copy()->format($this->getYearlyDateFormat()); $i = $financial_year->getEndDate()->copy()->format($this->getYearlyDateFormat());

View File

@ -41,9 +41,9 @@ class Localisation extends Controller
'both' => trans('settings.localisation.discount_location.both'), 'both' => trans('settings.localisation.discount_location.both'),
]; ];
$financial_year_denote_options = [ $financial_denote_options = [
'begins' => trans('settings.localisation.financial_year_denote.begins'), 'begins' => trans('settings.localisation.financial_denote.begins'),
'ends' => trans('settings.localisation.financial_year_denote.ends'), 'ends' => trans('settings.localisation.financial_denote.ends'),
]; ];
return view('settings.localisation.edit', compact( return view('settings.localisation.edit', compact(
@ -52,7 +52,7 @@ class Localisation extends Controller
'date_separators', 'date_separators',
'percent_positions', 'percent_positions',
'discount_locations', 'discount_locations',
'financial_year_denote_options' 'financial_denote_options'
)); ));
} }
} }

View File

@ -110,7 +110,7 @@ trait DateTime
$financial_start = Date::create($year, $month, $day); $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(); $financial_start->subYear();
} }

View File

@ -98,12 +98,12 @@ return [
'fallback' => [ 'fallback' => [
'localisation' => [ 'localisation' => [
'financial_start' => env('SETTING_FALLBACK_LOCALISATION_FINANCIAL_START', '01-01'), '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'), 'timezone' => env('SETTING_FALLBACK_LOCALISATION_TIMEZONE', 'Europe/London'),
'date_format' => env('SETTING_FALLBACK_LOCALISATION_DATE_FORMAT', 'd M Y'), 'date_format' => env('SETTING_FALLBACK_LOCALISATION_DATE_FORMAT', 'd M Y'),
'date_separator' => env('SETTING_FALLBACK_LOCALISATION_DATE_SEPARATOR', 'space'), 'date_separator' => env('SETTING_FALLBACK_LOCALISATION_DATE_SEPARATOR', 'space'),
'percent_position' => env('SETTING_FALLBACK_LOCALISATION_PERCENT_POSITION', 'after'), 'percent_position' => env('SETTING_FALLBACK_LOCALISATION_PERCENT_POSITION', 'after'),
'discount_location' => env('SETTING_FALLBACK_LOCALISATION_DISCOUNT_LOCATION', 'total'), 'discount_location' => env('SETTING_FALLBACK_LOCALISATION_DISCOUNT_LOCATION', 'total'),
'financial_year_denote' => env('SETTING_FALLBACK_LOCALISATION_FINANCIAL_YEAR_DENOTE', 'ends'),
], ],
'invoice' => [ 'invoice' => [
'number_prefix' => env('SETTING_FALLBACK_INVOICE_NUMBER_PREFIX', 'INV-'), 'number_prefix' => env('SETTING_FALLBACK_INVOICE_NUMBER_PREFIX', 'INV-'),

View File

@ -16,6 +16,11 @@ return [
'description' => 'Set fiscal year, time zone, date format and more locals', 'description' => 'Set fiscal year, time zone, date format and more locals',
'financial_start' => 'Financial Year Start', 'financial_start' => 'Financial Year Start',
'timezone' => 'Time Zone', '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' => [ 'date' => [
'format' => 'Date Format', 'format' => 'Date Format',
'separator' => 'Date Separator', 'separator' => 'Date Separator',
@ -36,11 +41,6 @@ return [
'total' => 'At total', 'total' => 'At total',
'both' => 'Both line and 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' => [ 'invoice' => [

View File

@ -20,7 +20,7 @@
<div class="row"> <div class="row">
{{ 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::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'), []) }} {{ Form::selectGroupGroup('timezone', trans('settings.localisation.timezone'), 'globe', $timezones, setting('localisation.timezone'), []) }}