mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
Create new account and transaction types.
This commit is contained in:
@@ -81,6 +81,7 @@ class UpgradeDatabase extends Command
|
|||||||
$this->setTransactionIdentifier();
|
$this->setTransactionIdentifier();
|
||||||
$this->migrateRepetitions();
|
$this->migrateRepetitions();
|
||||||
$this->updateAccountCurrencies();
|
$this->updateAccountCurrencies();
|
||||||
|
$this->createNewTypes();
|
||||||
$this->line('Updating currency information..');
|
$this->line('Updating currency information..');
|
||||||
$this->updateTransferCurrencies();
|
$this->updateTransferCurrencies();
|
||||||
$this->updateOtherCurrencies();
|
$this->updateOtherCurrencies();
|
||||||
@@ -289,6 +290,19 @@ class UpgradeDatabase extends Command
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function createNewTypes(): void
|
||||||
|
{
|
||||||
|
// create transaction type "Reconciliation".
|
||||||
|
$type = TransactionType::where('type', TransactionType::RECONCILIATION)->first();
|
||||||
|
if (is_null($type)) {
|
||||||
|
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
|
||||||
|
}
|
||||||
|
$account = AccountType::where('type', AccountType::RECONCILIATION)->first();
|
||||||
|
if (is_null($account)) {
|
||||||
|
AccountType::create(['type' => AccountType::RECONCILIATION]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move all the journal_meta notes to their note object counter parts.
|
* Move all the journal_meta notes to their note object counter parts.
|
||||||
*/
|
*/
|
||||||
@@ -300,7 +314,7 @@ class UpgradeDatabase extends Command
|
|||||||
$journal = $meta->transactionJournal;
|
$journal = $meta->transactionJournal;
|
||||||
$note = $journal->notes()->first();
|
$note = $journal->notes()->first();
|
||||||
if (null === $note) {
|
if (null === $note) {
|
||||||
$note = new Note;
|
$note = new Note();
|
||||||
$note->noteable()->associate($journal);
|
$note->noteable()->associate($journal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user