Verify deposits with budget.

This commit is contained in:
James Cole
2017-10-13 17:32:14 +02:00
parent 27d533dd5b
commit 7bf691e2bd

View File

@@ -401,15 +401,15 @@ class VerifyDatabase extends Command
$set = TransactionJournal::distinct() $set = TransactionJournal::distinct()
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
->leftJoin('budget_transaction_journal', 'transaction_journals.id', '=', 'budget_transaction_journal.transaction_journal_id') ->leftJoin('budget_transaction_journal', 'transaction_journals.id', '=', 'budget_transaction_journal.transaction_journal_id')
->where('transaction_types.type', TransactionType::TRANSFER) ->whereIn('transaction_types.type', [TransactionType::TRANSFER, TransactionType::DEPOSIT])
->whereNotNull('budget_transaction_journal.budget_id')->get(['transaction_journals.id']); ->whereNotNull('budget_transaction_journal.budget_id')->get(['transaction_journals.id']);
/** @var TransactionJournal $entry */ /** @var TransactionJournal $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
$this->error( $this->error(
sprintf( sprintf(
'Error: Transaction journal #%d is a transfer, but has a budget. Edit it without changing anything, so the budget will be removed.', 'Error: Transaction journal #%d is a %s, but has a budget. Edit it without changing anything, so the budget will be removed.',
$entry->id $entry->id, $entry->transactionType->type
) )
); );
} }