Multi year was not visible.

This commit is contained in:
James Cole 2016-11-09 21:46:32 +01:00
parent 3600e1b5e7
commit 8583b574ac
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -35,15 +35,17 @@ class ReportGeneratorFactory
public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface
{
$period = 'Month';
// more than one year date difference means multi year report.
if ($start->diffInMonths($end) > 12) {
$period = 'MultiYear';
}
// more than two months date difference means year report.
if ($start->diffInMonths($end) > 1) {
$period = 'Year';
}
// more than one year date difference means multi year report.
if ($start->diffInMonths($end) > 12) {
$period = 'MultiYear';
}
$class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period);
if (class_exists($class)) {
/** @var ReportGeneratorInterface $obj */