And fix sorting.

This commit is contained in:
James Cole 2019-08-17 08:04:41 +02:00
parent 7f887e294a
commit b97d3d3627
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -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;
} }