mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Multi year was not visible.
This commit is contained in:
@@ -35,15 +35,17 @@ class ReportGeneratorFactory
|
|||||||
public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface
|
public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface
|
||||||
{
|
{
|
||||||
$period = 'Month';
|
$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.
|
// more than two months date difference means year report.
|
||||||
if ($start->diffInMonths($end) > 1) {
|
if ($start->diffInMonths($end) > 1) {
|
||||||
$period = 'Year';
|
$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);
|
$class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period);
|
||||||
if (class_exists($class)) {
|
if (class_exists($class)) {
|
||||||
/** @var ReportGeneratorInterface $obj */
|
/** @var ReportGeneratorInterface $obj */
|
||||||
|
|||||||
Reference in New Issue
Block a user