mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Updated methods to make budget charts multi-currency
This commit is contained in:
@@ -120,7 +120,9 @@ trait AugumentData
|
|||||||
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::CASH]);
|
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::CASH]);
|
||||||
$grouped = $accounts->groupBy('id')->toArray();
|
$grouped = $accounts->groupBy('id')->toArray();
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($accountIds as $accountId) {
|
foreach ($accountIds as $combinedId) {
|
||||||
|
$parts = explode('-', $combinedId);
|
||||||
|
$accountId = (int)$parts[0];
|
||||||
if (isset($grouped[$accountId])) {
|
if (isset($grouped[$accountId])) {
|
||||||
$return[$accountId] = $grouped[$accountId][0]['name'];
|
$return[$accountId] = $grouped[$accountId][0]['name'];
|
||||||
}
|
}
|
||||||
@@ -168,7 +170,9 @@ trait AugumentData
|
|||||||
$categories = $repository->getCategories();
|
$categories = $repository->getCategories();
|
||||||
$grouped = $categories->groupBy('id')->toArray();
|
$grouped = $categories->groupBy('id')->toArray();
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($categoryIds as $categoryId) {
|
foreach ($categoryIds as $combinedId) {
|
||||||
|
$parts = explode('-', $combinedId);
|
||||||
|
$categoryId = (int)$parts[0];
|
||||||
if (isset($grouped[$categoryId])) {
|
if (isset($grouped[$categoryId])) {
|
||||||
$return[$categoryId] = $grouped[$categoryId][0]['name'];
|
$return[$categoryId] = $grouped[$categoryId][0]['name'];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user