mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-29 01:13:08 +00:00
Fix budget date.
This commit is contained in:
@@ -160,19 +160,9 @@ class BudgetRepository implements BudgetRepositoryInterface
|
|||||||
$oldest = null;
|
$oldest = null;
|
||||||
$journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first();
|
$journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first();
|
||||||
if (null !== $journal) {
|
if (null !== $journal) {
|
||||||
$oldest = $journal->date < $oldest ? $journal->date : $oldest;
|
return $journal->date;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
$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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user