First code for multi year budget chart.

This commit is contained in:
James Cole 2015-12-15 12:37:55 +01:00
parent ba722e8ed5
commit 0303b45707

View File

@ -35,6 +35,35 @@ class BudgetController extends Controller
$this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator'); $this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator');
} }
/**
* @param BudgetRepositoryInterface $repository
* @param $report_type
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
* @param Collection $budgets
*/
public function multiYear(BudgetRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts, Collection $budgets)
{
$currentStart = clone $start;
while($currentStart < $end) {
$currentEnd = clone $currentStart;
$currentEnd->endOfYear();
//echo 'now for '.$currentStart->format('Ymd').' to '.$currentEnd->format('Ymd').'<br>';
//epository->balanceInPeriod()
// do something for all budgets.
// jump to next year.
$currentStart = clone $currentEnd;
$currentStart->addDay();
}
}
/** /**
* @param BudgetRepositoryInterface $repository * @param BudgetRepositoryInterface $repository
* @param Budget $budget * @param Budget $budget