Debug message for #797

This commit is contained in:
James Cole 2017-09-03 13:02:19 +02:00
parent 693c6fb71b
commit 0444ad5221
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -296,12 +296,15 @@ trait ImportSupport
*/
private function hashAlreadyImported(string $hash): bool
{
$json = json_encode($hash);
$json = json_encode($hash);
/** @var TransactionJournalMeta $entry */
$entry = TransactionJournalMeta::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
->where('data', $json)
->where('name', 'importHash')
->first();
if (!is_null($entry)) {
Log::debug(sprintf('A journal with hash %s has already been imported (spoiler: it\'s journal #%d)', $hash, $entry->transaction_journal_id));
return true;
}