mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix issue with liability upgrades.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user