mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Catch bad upgrade command.
This commit is contained in:
@@ -140,7 +140,10 @@ class UpgradeLiabilitiesEight extends Command
|
|||||||
Log::debug(sprintf('Upgrade liability #%d ("%s")', $account->id, $account->name));
|
Log::debug(sprintf('Upgrade liability #%d ("%s")', $account->id, $account->name));
|
||||||
|
|
||||||
$direction = $repository->getMetaValue($account, 'liability_direction');
|
$direction = $repository->getMetaValue($account, 'liability_direction');
|
||||||
if ('debit' === $direction && $this->hasBadOpening($account)) {
|
if ('debit' === $direction) {
|
||||||
|
Log::debug('Direction is debit ("I owe this amount"), so no need to upgrade.');
|
||||||
|
}
|
||||||
|
if ('credit' === $direction && $this->hasBadOpening($account)) {
|
||||||
$this->deleteCreditTransaction($account);
|
$this->deleteCreditTransaction($account);
|
||||||
$this->line(sprintf('Fixed correct bad opening for liability #%d ("%s")', $account->id, $account->name));
|
$this->line(sprintf('Fixed correct bad opening for liability #%d ("%s")', $account->id, $account->name));
|
||||||
}
|
}
|
||||||
@@ -203,6 +206,7 @@ class UpgradeLiabilitiesEight extends Command
|
|||||||
Log::debug('Account has opening/credit not on the same day.');
|
Log::debug('Account has opening/credit not on the same day.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Log::debug('Account has bad opening balance data.');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user