mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
First code for multi year budget chart.
This commit is contained in:
parent
ba722e8ed5
commit
0303b45707
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user