code refactoring

This commit is contained in:
Sevan Nerse 2021-02-05 21:00:15 +03:00
parent db11b0cf83
commit c445d73765

View File

@ -278,44 +278,28 @@ abstract class Report
case 'yearly': case 'yearly':
$start->addYear(); $start->addYear();
$date = $this->getFormattedDate($start);
$this->dates[$j] = $date;
foreach ($this->tables as $table) {
$this->footer_totals[$table][$date] = 0;
}
$j += 11; $j += 11;
break; break;
case 'quarterly': case 'quarterly':
$start->addQuarter(); $start->addQuarter();
$date = $this->getFormattedDate($start);
$this->dates[$j] = $date;
foreach ($this->tables as $table) {
$this->footer_totals[$table][$date] = 0;
}
$j += 2; $j += 2;
break; break;
default: default:
$start->addMonth(); $start->addMonth();
$date = $this->getFormattedDate($start);
$this->dates[$j] = $date;
foreach ($this->tables as $table) {
$this->footer_totals[$table][$date] = 0;
}
break; break;
} }
$date = $this->getFormattedDate($start);
$this->dates[] = $date;
foreach ($this->tables as $table) {
$this->footer_totals[$table][$date] = 0;
}
} }
} }