mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Fix old category chart
This commit is contained in:
@@ -185,15 +185,18 @@ class CategoryController extends Controller
|
|||||||
/** @var Category $category */
|
/** @var Category $category */
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
$spentArray = $repository->spentInPeriodPerCurrency(new Collection([$category]), $accounts, $start, $end);
|
$spentArray = $repository->spentInPeriodPerCurrency(new Collection([$category]), $accounts, $start, $end);
|
||||||
foreach ($spentArray as $currencyId => $spent) {
|
foreach ($spentArray as $categoryId => $spentInfo) {
|
||||||
if (bccomp($spent, '0') === -1) {
|
foreach($spentInfo['spent'] as $currencyId => $row) {
|
||||||
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepository->findNull((int)$currencyId);
|
$spent= $row['spent'];
|
||||||
$tempData[] = [
|
if (bccomp($spent, '0') === -1) {
|
||||||
'name' => $category->name,
|
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepository->findNull((int)$currencyId);
|
||||||
'spent' => bcmul($spent, '-1'),
|
$tempData[] = [
|
||||||
'spent_float' => (float)bcmul($spent, '-1'),
|
'name' => $category->name,
|
||||||
'currency_id' => $currencyId,
|
'spent' => bcmul($spent, '-1'),
|
||||||
];
|
'spent_float' => (float)bcmul($spent, '-1'),
|
||||||
|
'currency_id' => $currencyId,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user