diff --git a/app/Traits/DateTime.php b/app/Traits/DateTime.php index 5012ae4d9..abf0fc3fc 100644 --- a/app/Traits/DateTime.php +++ b/app/Traits/DateTime.php @@ -190,22 +190,14 @@ trait DateTime public function getMonthlyDateFormat($year = null) { - $format = 'M'; - - if ($this->getFinancialStart($year)->month != 1) { - $format = 'M Y'; - } + $format = 'M Y'; return $format; } public function getQuarterlyDateFormat($year = null) { - $format = 'M'; - - if ($this->getFinancialStart($year)->month != 1) { - $format = 'M Y'; - } + $format = 'M Y'; return $format; } diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index dd4dc25fe..b65eb7077 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -160,6 +160,7 @@ return [ 'recurring_and_more' => 'Recurring and more..', 'due_on' => 'Due on', 'amount_due' => 'Amount due', + 'financial_year' => 'Financial Year', 'card' => [ 'cards' => 'Card|Cards', diff --git a/resources/views/partials/reports/filter.blade.php b/resources/views/partials/reports/filter.blade.php index 2a4afc095..02c1ee41c 100644 --- a/resources/views/partials/reports/filter.blade.php +++ b/resources/views/partials/reports/filter.blade.php @@ -38,6 +38,10 @@ $value = (strpos(trans('general.' . $filter_name), '|') !== false) ? trans_choice('general.' . $filter_name, 1) : trans('general.' . $filter_name); } + if ($key == 'year') { + $value = trans('general.financial_year'); + } + $type = 'select'; if (isset($class->filters['types']) && !empty($class->filters['types'][$filter_name])) { @@ -60,10 +64,16 @@ 'values' => $filter_values, ]; } + + $filtered[] = [ + 'option' => 'year', + 'operator' => '=', + 'value' => \Date::now()->year, + ]; @endphp