mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Make sure sorting doesnt break opening balance.
This commit is contained in:
@@ -115,12 +115,14 @@ class AccountUpdateService
|
||||
// if it can have a virtual balance, it can also have an opening balance.
|
||||
|
||||
if (in_array($type->type, $this->canHaveVirtual, true)) {
|
||||
// check if is submitted as empty, that makes it valid:
|
||||
|
||||
if ($this->validOBData($data)) {
|
||||
|
||||
if ($this->validOBData($data) && !$this->isEmptyOBData($data)) {
|
||||
$this->updateOBGroup($account, $data);
|
||||
}
|
||||
|
||||
if (!$this->validOBData($data)) {
|
||||
if (!$this->validOBData($data) && $this->isEmptyOBData($data)) {
|
||||
$this->deleteOBGroup($account);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user