All kinds of new stuff. Started with perfecting the account controller. [skip ci]

This commit is contained in:
James Cole
2014-07-26 18:53:41 +02:00
parent d088b2c558
commit b782bb8d93
75 changed files with 1075 additions and 8362 deletions

View File

@@ -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
*/