diff --git a/app/Http/Controllers/PaymentBalancesController.php b/app/Http/Controllers/PaymentBalancesController.php
index 9e789606..9e5f1a18 100644
--- a/app/Http/Controllers/PaymentBalancesController.php
+++ b/app/Http/Controllers/PaymentBalancesController.php
@@ -19,7 +19,8 @@ public function index()
$inactiveUsersInDebtQty = User::where('active', false)->where('cash_balance', '<', 0)->count();
$inactiveUsersInDebtSum = User::where('active', false)->where('cash_balance', '<', 0)->sum('cash_balance') / 100;
- $users = User::where('cash_balance', '!=', 0)->get();
+ $activeUsers = User::where('active', true)->where('cash_balance', '!=', 0)->orderBy('cash_balance', 'desc')->get();
+ $inactiveUsers = User::where('active', false)->where('cash_balance', '!=', 0)->orderBy('cash_balance', 'desc')->get();
return \View::make('payment_balances.index')->with([
'activeUsersInCreditQty' => $activeUsersInCreditQty,
@@ -30,7 +31,8 @@ public function index()
'inactiveUsersInCreditSum' => $inactiveUsersInCreditSum,
'inactiveUsersInDebtQty' => $inactiveUsersInDebtQty,
'inactiveUsersInDebtSum' => $inactiveUsersInDebtSum,
- 'users' => $users,
+ 'activeUsers' => $activeUsers,
+ 'inactiveUsers' => $inactiveUsers,
]);
}
}
diff --git a/resources/views/payment_balances/index.blade.php b/resources/views/payment_balances/index.blade.php
index 3ed09a96..064a82bc 100644
--- a/resources/views/payment_balances/index.blade.php
+++ b/resources/views/payment_balances/index.blade.php
@@ -46,32 +46,71 @@
-
-
-
- Member name |
- Member Status |
- Balance status (in debt or in credit) |
- Balance amount |
-
-
-
- @foreach ($users as $user)
-
-
- {{ $user->name }}
- |
- {!! HTML::statusLabel($user->status) !!} |
-
- @if ($user->cash_balance < 0)
- In debt
- @else
- In credit
- @endif
- |
- {{ $user->present()->cashBalance }} |
-
- @endforeach
-
-
+
+
+
+
+
+
+
+ Member name |
+ Member Status |
+ Balance status (in debt or in credit) |
+ Balance amount |
+
+
+
+ @foreach ($activeUsers as $user)
+
+
+ {{ $user->name }}
+ |
+ {!! HTML::statusLabel($user->status) !!} |
+
+ @if ($user->cash_balance < 0)
+ In debt
+ @else
+ In credit
+ @endif
+ |
+ {{ $user->present()->cashBalance }} |
+
+ @endforeach
+
+
+
+
+
+
+
+ Member name |
+ Member Status |
+ Balance status (in debt or in credit) |
+ Balance amount |
+
+
+
+ @foreach ($inactiveUsers as $user)
+
+
+ {{ $user->name }}
+ |
+ {!! HTML::statusLabel($user->status) !!} |
+
+ @if ($user->cash_balance < 0)
+ In debt
+ @else
+ In credit
+ @endif
+ |
+ {{ $user->present()->cashBalance }} |
+
+ @endforeach
+
+
+
+
@stop