Add two new “spentInPeriod” methods that use the collector and not big queries.

This commit is contained in:
James Cole
2017-01-05 09:07:04 +01:00
parent 3ef569d280
commit 4241ae035e
6 changed files with 94 additions and 14 deletions

View File

@@ -158,9 +158,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface
foreach ($accounts as $account) {
$balanceEntry = new BalanceEntry;
$balanceEntry->setAccount($account);
$spent = $this->budgetRepository->spentInPeriod(
new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date
);
$spent = $this->budgetRepository->spentInPeriodCollector(new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date);
$balanceEntry->setSpent($spent);
$line->addBalanceEntry($balanceEntry);
}