mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
All kinds of new stuff. Started with perfecting the account controller. [skip ci]
This commit is contained in:
@@ -264,25 +264,6 @@ class EloquentAccountRepository implements AccountRepositoryInterface
|
||||
return \Auth::user()->accounts()->where('id', $accountId)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
*
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function findOpeningBalanceTransaction(\Account $account)
|
||||
{
|
||||
$transactionType = \TransactionType::where('type', 'Opening balance')->first();
|
||||
$journal = \TransactionJournal::
|
||||
with(
|
||||
['transactions' => function ($q) {
|
||||
$q->orderBy('amount', 'ASC');
|
||||
}]
|
||||
)->where('transaction_type_id', $transactionType->id)
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transactions.account_id', $account->id)->first(['transaction_journals.*']);
|
||||
return $journal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
Reference in New Issue
Block a user