Move the start and end date for the fiscal date ranges to fiscal-start and fiscal-end respectively.

This commit is contained in:
James Cole
2016-01-29 17:09:23 +01:00
parent 27b8b4b35a
commit ce9445168c

View File

@@ -174,18 +174,20 @@ class ReportHelper implements ReportHelperInterface
{
/** @var FiscalHelperInterface $fiscalHelper */
$fiscalHelper = app('FireflyIII\Helpers\FiscalHelperInterface');
$start = clone $date;
$end = Carbon::now();
$months = [];
$start = clone $date;
$end = Carbon::now();
$months = [];
while ($start <= $end) {
$year = $fiscalHelper->endOfFiscalYear($start)->year;
if (!isset($months[$year])) {
$months[$year] = [
'start' => $fiscalHelper->startOfFiscalYear($start)->format('Y-m-d'),
'end' => $fiscalHelper->endOfFiscalYear($start)->format('Y-m-d'),
'months' => [],
'start-fiscal' => $fiscalHelper->startOfFiscalYear($start)->format('Y-m-d'),
'end-fiscal' => $fiscalHelper->endOfFiscalYear($start)->format('Y-m-d'),
'start' => Carbon::createFromDate($year, 1, 1)->format('Y-m-d'),
'end' => Carbon::createFromDate($year, 12, 31)->format('Y-m-d'),
'months' => [],
];
}