diff --git a/resources/views/theme/backend/adminlte/account/widget/admin/list.blade.php b/resources/views/theme/backend/adminlte/account/widget/admin/list.blade.php
index 9b5e514..76f1237 100644
--- a/resources/views/theme/backend/adminlte/account/widget/admin/list.blade.php
+++ b/resources/views/theme/backend/adminlte/account/widget/admin/list.blade.php
@@ -4,7 +4,7 @@
- @if ($x=$user->accounts_all->count())
+ @if($x=$o->accounts_all->count())
@@ -14,7 +14,10 @@
- @foreach ($user->accounts_all as $ao)
+ @foreach($o->accounts_all as $ao)
+ @php
+ $ao->load(['services:id,active,account_id']);
+ @endphp
|
{{ $ao->name }} |
diff --git a/resources/views/theme/backend/adminlte/account/widget/summary_boxes.blade.php b/resources/views/theme/backend/adminlte/account/widget/summary_boxes.blade.php
index 6c4111d..83b18e0 100644
--- a/resources/views/theme/backend/adminlte/account/widget/summary_boxes.blade.php
+++ b/resources/views/theme/backend/adminlte/account/widget/summary_boxes.blade.php
@@ -1,3 +1,8 @@
+@php
+ use App\Models\{Account,Service};
+ $acts = $o->accounts_all->pluck('id');
+@endphp
+
@if($user->isReseller() && ($o->accounts->count() <= 2) && ($x=$o->accounts->pluck('providers')->flatten())->count())
@@ -31,7 +36,7 @@
Active Services
- {{ $o->accounts_all->map(fn($item)=>$item->services->where('active',TRUE)->count())->sum() }} /{{ $o->accounts_all->map(fn($item)=>$item->services->count())->sum() }}
+ {{ Service::active()->whereIn('account_id',$acts)->count() }} /{{ Service::whereIn('account_id',$acts)->count() }}
@@ -42,7 +47,7 @@
Account Balance
- $ {{ number_format(($x=$o->accounts_all->map(fn($item)=>$item->invoiceSummaryDue()->get()->pluck('_balance'))->flatten())->sum(),2) }}
+ $ {{ number_format(($x=Account::InvoicesDue()->filter(fn($item)=>$acts->contains($item->account_id)))->sum('_balance'),2) }}