James Cole 2024-11-06 11:12:04 +01:00
parent 899c72d068
commit 43a4fd2ecb
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -151,6 +151,7 @@ class CategoryController extends Controller
*/ */
private function reportPeriodChart(Collection $accounts, Carbon $start, Carbon $end, ?Category $category): array private function reportPeriodChart(Collection $accounts, Carbon $start, Carbon $end, ?Category $category): array
{ {
$income = []; $income = [];
$expenses = []; $expenses = [];
$categoryId = 0; $categoryId = 0;
@ -169,8 +170,8 @@ class CategoryController extends Controller
$categoryId = $category->id; $categoryId = $category->id;
// this gives us all currencies // this gives us all currencies
$collection = new Collection([$category]); $collection = new Collection([$category]);
$expenses = $opsRepository->listExpenses($start, $end, null, $collection); $expenses = $opsRepository->listExpenses($start, $end, $accounts, $collection);
$income = $opsRepository->listIncome($start, $end, null, $collection); $income = $opsRepository->listIncome($start, $end, $accounts, $collection);
} }
$currencies = array_unique(array_merge(array_keys($income), array_keys($expenses))); $currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
$periods = app('navigation')->listOfPeriods($start, $end); $periods = app('navigation')->listOfPeriods($start, $end);