Previous Quarter issue fixed

This commit is contained in:
EnesSacid-Buker
2023-02-22 10:20:41 +03:00
parent 28348ac8e5
commit 02412c642a
2 changed files with 29 additions and 52 deletions

View File

@@ -137,14 +137,10 @@ trait DateTime
break;
}
if (!isset($this_quarter)) {
if (! isset($this_quarter)) {
$this_quarter = $financial_quarters[0];
}
if (!isset($previous_quarter)) {
$previous_quarter = $financial_quarters[0];
}
$date_picker_shortcuts = [
trans('reports.this_year') => [
'start' => $financial_year->getStartDate()->format('Y-m-d'),
@@ -158,16 +154,19 @@ trait DateTime
'start' => $this_quarter->getStartDate()->format('Y-m-d'),
'end' => $this_quarter->getEndDate()->format('Y-m-d'),
],
trans('reports.previous_quarter') => [
'start' => $previous_quarter->getStartDate()->format('Y-m-d'),
'end' => $previous_quarter->getEndDate()->format('Y-m-d'),
],
trans('reports.last_12_months') => [
'start' => $today->copy()->subYear()->startOfDay()->format('Y-m-d'),
'end' => $today->copy()->subDay()->endOfDay()->format('Y-m-d'),
],
];
if (isset($previous_quarter)) {
$date_picker_shortcuts[trans('reports.previous_quarter')] = [
'start' => $previous_quarter->getStartDate()->format('Y-m-d'),
'end' => $previous_quarter->getEndDate()->format('Y-m-d'),
];
}
return $date_picker_shortcuts;
}