mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-26 19:00:22 -06:00
Fix budget date.
This commit is contained in:
parent
73c1452aa9
commit
be0f2f0b9f
@ -160,19 +160,9 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
$oldest = null;
|
||||
$journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first();
|
||||
if (null !== $journal) {
|
||||
$oldest = $journal->date < $oldest ? $journal->date : $oldest;
|
||||
return $journal->date;
|
||||
}
|
||||
|
||||
$transaction = $budget
|
||||
->transactions()
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.id')
|
||||
->orderBy('transaction_journals.date', 'ASC')->first(['transactions.*', 'transaction_journals.date']);
|
||||
if (null !== $transaction) {
|
||||
$carbon = new Carbon($transaction->date);
|
||||
$oldest = $carbon < $oldest ? $carbon : $oldest;
|
||||
}
|
||||
|
||||
return $oldest;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user