Remove category chart from report controller.

This commit is contained in:
James Cole
2016-05-15 16:13:05 +02:00
parent bd818b2dea
commit 6a750a998f
48 changed files with 30 additions and 434 deletions

View File

@@ -100,38 +100,6 @@ class ReportHelper implements ReportHelperInterface
return $collection;
}
/**
* Find all transactions and IF we have spent money in them
* with either transactions or journals.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return Collection
*/
public function getCategoriesWithTransactions(Carbon $start, Carbon $end, Collection $accounts): Collection
{
/** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class);
$categories = $repository->getCategories();
$return = new Collection;
foreach ($categories as $category) {
$lastUseDate = $repository->lastUseDate($category, $accounts);
if ($lastUseDate >= $start && $lastUseDate <= $end) {
$return->push($category);
}
}
$return = $return->sortBy(
function (Category $category) {
return $category->name;
}
);
return $return;
}
/**
* @param Carbon $start
* @param Carbon $end