Correctly order account names.

This commit is contained in:
James Cole
2015-03-10 17:26:31 +01:00
parent 43ac541cb8
commit 0b028a8923
24 changed files with 303 additions and 190 deletions

View File

@@ -137,7 +137,7 @@ class ReportHelper implements ReportHelperInterface
$sharedAccounts[] = $account->id;
}
$accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])->filter(
$accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name','ASC')->get(['accounts.*'])->filter(
function (Account $account) use ($sharedAccounts) {
if (!in_array($account->id, $sharedAccounts)) {
return $account;

View File

@@ -129,6 +129,7 @@ class ReportQuery implements ReportQueryInterface
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
}
)
->orderBy('accounts.name','ASC')
->where(
function (Builder $query) {
$query->where('account_meta.data', '!=', '"sharedAsset"');