Expanded new report a bit. Mainly copy/paste work. Will have to see how it pans out.

This commit is contained in:
James Cole
2015-12-11 09:39:17 +01:00
parent 0a54caf202
commit 7f19b6957a
5 changed files with 126 additions and 5 deletions

View File

@@ -452,4 +452,25 @@ class ReportHelper implements ReportHelperInterface
return $object;
}
/**
* Get a full report on the users incomes during the period for the given accounts.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return Income
*/
public function getIncomeReportForList($start, $end, Collection $accounts)
{
$object = new Income;
$set = $this->query->incomeInPeriodCorrectedForList($start, $end, $accounts);
foreach ($set as $entry) {
$object->addToTotal($entry->amount_positive);
$object->addOrCreateIncome($entry);
}
return $object;
}
}