mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Fix sorting and order for account lists.
This commit is contained in:
@@ -63,6 +63,10 @@ class AccountTransformer extends AbstractTransformer
|
||||
$this->convertedBalances = [];
|
||||
$this->balanceDifferences = [];
|
||||
|
||||
// first collect all the "heavy" stuff that relies on ALL data to be present.
|
||||
// get last activity:
|
||||
$this->getLastActivity($objects);
|
||||
|
||||
// get balances of all accounts
|
||||
$this->getMetaBalances($objects);
|
||||
|
||||
@@ -75,17 +79,21 @@ class AccountTransformer extends AbstractTransformer
|
||||
// get account types:
|
||||
$this->collectAccountTypes($objects);
|
||||
|
||||
// get last activity:
|
||||
$this->getLastActivity($objects);
|
||||
|
||||
// add balance difference
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$this->getBalanceDifference($objects, $this->parameters->get('start'), $this->parameters->get('end'));
|
||||
}
|
||||
|
||||
// get object groups"
|
||||
// get object groups
|
||||
$this->getObjectGroups($objects);
|
||||
|
||||
// if pagination is disabled, do it now:
|
||||
if(true === $this->parameters->get('disablePagination')) {
|
||||
$page = (int) $this->parameters->get('page');
|
||||
$size = (int) $this->parameters->get('pageSize');
|
||||
$objects = $objects->slice(($page-1) * $size, $size);
|
||||
}
|
||||
|
||||
return $this->sortAccounts($objects);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user