Added the ability to see cash accounts. [skip ci]

This commit is contained in:
James Cole
2014-12-28 09:00:22 +01:00
parent 4944b233b6
commit 87fbf9c1a5
3 changed files with 10 additions and 2 deletions

View File

@@ -31,6 +31,9 @@ Breadcrumbs::register(
case 'Asset account':
$what = 'asset';
break;
case 'Cash account':
$what = 'cash';
break;
case 'Expense account':
case 'Beneficiary account':
$what = 'expense';

View File

@@ -28,6 +28,7 @@ class AccountController extends BaseController
'Expense account' => 'expense',
'Beneficiary account' => 'expense',
'Revenue account' => 'revenue',
'Cash account' => 'cash',
];
/** @var array */
@@ -36,6 +37,7 @@ class AccountController extends BaseController
'asset' => 'fa-money',
'Asset account' => 'fa-money',
'Default account' => 'fa-money',
'Cash account' => 'fa-money',
'expense' => 'fa-shopping-cart',
'Expense account' => 'fa-shopping-cart',
'Beneficiary account' => 'fa-shopping-cart',

View File

@@ -6,8 +6,11 @@ Route::bind(
function ($value, $route) {
if (Auth::check()) {
$account = Account::
leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')->where('account_types.editable', 1)->where('accounts.id', $value)
->where('user_id', Auth::user()->id)->first(['accounts.*']);
leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
->where('account_types.editable', 1)
->where('accounts.id', $value)
->where('user_id', Auth::user()->id)
->first(['accounts.*']);
if ($account) {
return $account;
}