Fix issue with liability upgrades.

This commit is contained in:
James Cole
2023-01-08 07:43:16 +01:00
parent 4917f40abf
commit c976149bf1
6 changed files with 286 additions and 9 deletions

View File

@@ -95,8 +95,8 @@ class AccountUpdateService
// update opening balance.
$this->updateOpeningBalance($account, $data);
// update opening balance.
$this->updateCreditLiability($account, $data);
// Since 5.8.0, delete liability credit transactions, if any:
$this->deleteCreditTransaction($account);
// update note:
if (array_key_exists('notes', $data) && null !== $data['notes']) {
@@ -305,6 +305,10 @@ class AccountUpdateService
$this->deleteOBGroup($account);
}
}
// if cannot have an opening balance, delete it.
if(!in_array($type->type, $this->canHaveOpeningBalance, true)) {
$this->deleteOBGroup($account);
}
}
/**
@@ -312,6 +316,7 @@ class AccountUpdateService
* @param array $data
*
* @throws FireflyException
* @deprecated In Firefly III v5.8.0 and onwards, credit transactions for liabilities are no longer created.
*/
private function updateCreditLiability(Account $account, array $data): void
{