mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 09:21:04 -06:00
And fix sorting.
This commit is contained in:
parent
7f887e294a
commit
b97d3d3627
@ -146,15 +146,14 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
|
|
||||||
$report = $this->groupExpenseByDestination($journals);
|
$report = $this->groupExpenseByDestination($journals);
|
||||||
|
|
||||||
// TODO sorting
|
// sort the result
|
||||||
// // sort the result
|
// Obtain a list of columns
|
||||||
// // Obtain a list of columns
|
$sum = [];
|
||||||
// $sum = [];
|
foreach ($report['accounts'] as $accountId => $row) {
|
||||||
// foreach ($expenses as $accountId => $row) {
|
$sum[$accountId] = (float)$row['sum'];
|
||||||
// $sum[$accountId] = (float)$row['sum'];
|
}
|
||||||
// }
|
|
||||||
//
|
array_multisort($sum, SORT_ASC, $report['accounts']);
|
||||||
// array_multisort($sum, SORT_ASC, $expenses);
|
|
||||||
|
|
||||||
return $report;
|
return $report;
|
||||||
}
|
}
|
||||||
@ -181,13 +180,12 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
|
|
||||||
// sort the result
|
// sort the result
|
||||||
// Obtain a list of columns
|
// Obtain a list of columns
|
||||||
// $sum = [];
|
$sum = [];
|
||||||
// foreach ($report['income'] as $accountId => $row) {
|
foreach ($report['accounts'] as $accountId => $row) {
|
||||||
// $sum[$accountId] = (float)$row['sum'];
|
$sum[$accountId] = (float)$row['sum'];
|
||||||
// }
|
}
|
||||||
// TODO proper sorting.
|
|
||||||
//array_multisort($sum, SORT_DESC, $report);
|
array_multisort($sum, SORT_DESC, $report['accounts']);
|
||||||
// var_dump($report);exit;
|
|
||||||
|
|
||||||
return $report;
|
return $report;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user