These budget charts are the worst, I'm telling you.

This commit is contained in:
James Cole
2016-05-05 21:25:20 +02:00
parent 4e1ff8c4a3
commit dd8b500efd
11 changed files with 379 additions and 312 deletions

View File

@@ -81,9 +81,13 @@ class JournalRepository implements JournalRepositoryInterface
public function first(): TransactionJournal
{
$entry = $this->user->transactionjournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
if (is_null($entry)) {
Log::debug('Could not find first transaction journal.');
return new TransactionJournal;
}
Log::debug('Found first journal: ', ['date' => $entry->date->format('Y-m-d')]);
return $entry;
}