mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 10:53:31 +00:00
Make sure sorting doesnt break opening balance.
This commit is contained in:
@@ -697,4 +697,20 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
return TransactionCurrency::whereIn('id', $currencyIds)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function resetAccountOrder(array $types): void
|
||||
{
|
||||
$list = $this->getAccountsByType($types);
|
||||
/**
|
||||
* @var int $index
|
||||
* @var Account $account
|
||||
*/
|
||||
foreach ($list as $index => $account) {
|
||||
$account->order = $index + 1;
|
||||
$account->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user