Skip to content

Commit

Permalink
Report show set default financial year filter..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 1, 2021
1 parent a9c4a7d commit 8cc4e32
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
12 changes: 2 additions & 10 deletions app/Traits/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,14 @@ public function getDatePickerShortcuts()

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;
}
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-GB/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
'recurring_and_more' => 'Recurring and more..',
'due_on' => 'Due on',
'amount_due' => 'Amount due',
'financial_year' => 'Financial Year',

'card' => [
'cards' => 'Card|Cards',
Expand Down
12 changes: 11 additions & 1 deletion resources/views/partials/reports/filter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand All @@ -60,10 +64,16 @@
'values' => $filter_values,
];
}
$filtered[] = [
'option' => 'year',
'operator' => '=',
'value' => \Date::now()->year,
];
@endphp

<div class="align-items-center">
<x-search-string :filters="$filters" />
<x-search-string :filters="$filters" :filtered="$filtered" />
</div>
{!! Form::close() !!}
</div>

0 comments on commit 8cc4e32

Please sign in to comment.