mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Add some missing db integrity checks.
This commit is contained in:
@@ -108,7 +108,11 @@ class FixTransactionTypes extends Command
|
|||||||
}
|
}
|
||||||
$expectedType = (string) config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
$expectedType = (string) config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
||||||
if ($expectedType !== $type) {
|
if ($expectedType !== $type) {
|
||||||
$this->line(sprintf('Transaction journal #%d was of type "%s" but is corrected to "%s"', $journal->id, $type, $expectedType));
|
$this->line(
|
||||||
|
sprintf('Transaction journal #%d was of type "%s" but is corrected to "%s" (%s -> %s)',
|
||||||
|
$journal->id, $type, $expectedType,
|
||||||
|
$source->accountType->type, $destination->accountType->type,
|
||||||
|
));
|
||||||
$this->changeJournal($journal, $expectedType);
|
$this->changeJournal($journal, $expectedType);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -607,6 +607,9 @@ return [
|
|||||||
],
|
],
|
||||||
AccountType::CASH => [
|
AccountType::CASH => [
|
||||||
AccountType::ASSET => TransactionTypeModel::DEPOSIT,
|
AccountType::ASSET => TransactionTypeModel::DEPOSIT,
|
||||||
|
AccountType::LOAN => TransactionTypeModel::DEPOSIT,
|
||||||
|
AccountType::DEBT => TransactionTypeModel::DEPOSIT,
|
||||||
|
AccountType::MORTGAGE => TransactionTypeModel::DEPOSIT,
|
||||||
],
|
],
|
||||||
AccountType::DEBT => [
|
AccountType::DEBT => [
|
||||||
AccountType::ASSET => TransactionTypeModel::DEPOSIT,
|
AccountType::ASSET => TransactionTypeModel::DEPOSIT,
|
||||||
@@ -691,6 +694,7 @@ return [
|
|||||||
AccountType::LOAN => [AccountType::LIABILITY_CREDIT],
|
AccountType::LOAN => [AccountType::LIABILITY_CREDIT],
|
||||||
AccountType::DEBT => [AccountType::LIABILITY_CREDIT],
|
AccountType::DEBT => [AccountType::LIABILITY_CREDIT],
|
||||||
AccountType::MORTGAGE => [AccountType::LIABILITY_CREDIT],
|
AccountType::MORTGAGE => [AccountType::LIABILITY_CREDIT],
|
||||||
|
AccountType::LIABILITY_CREDIT => [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
// if you add fields to this array, dont forget to update the export routine (ExportDataGenerator).
|
// if you add fields to this array, dont forget to update the export routine (ExportDataGenerator).
|
||||||
|
Reference in New Issue
Block a user