mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Remove category chart from report controller.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user