From c445d73765652b0fa122b0985d604b80a83dff85 Mon Sep 17 00:00:00 2001 From: Sevan Nerse Date: Fri, 5 Feb 2021 21:00:15 +0300 Subject: [PATCH] code refactoring --- app/Abstracts/Report.php | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index e2fedbbae..57f4758de 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -278,44 +278,28 @@ abstract class Report case 'yearly': $start->addYear(); - $date = $this->getFormattedDate($start); - - $this->dates[$j] = $date; - - foreach ($this->tables as $table) { - $this->footer_totals[$table][$date] = 0; - } - $j += 11; break; case 'quarterly': $start->addQuarter(); - $date = $this->getFormattedDate($start); - - $this->dates[$j] = $date; - - foreach ($this->tables as $table) { - $this->footer_totals[$table][$date] = 0; - } - $j += 2; break; default: $start->addMonth(); - $date = $this->getFormattedDate($start); - - $this->dates[$j] = $date; - - foreach ($this->tables as $table) { - $this->footer_totals[$table][$date] = 0; - } - break; } + + $date = $this->getFormattedDate($start); + + $this->dates[] = $date; + + foreach ($this->tables as $table) { + $this->footer_totals[$table][$date] = 0; + } } }