osb/resources/views/theme/backend/adminlte/account/widget/summary_boxes.blade.php

65 lines
2.3 KiB
PHP
Raw Normal View History

<!-- $o=User::class -->
@php($acts=$o->accounts_all->pluck('id'))
@use(App\Models\Account)
@use(App\Models\Service)
2024-07-09 11:09:34 +00:00
2024-07-05 12:56:02 +00:00
@if($user->isReseller() && ($o->accounts->count() <= 2) && ($x=$o->accounts->pluck('providers')->flatten())->count())
<div class="col-12 col-sm-4 col-md-2">
<div class="info-box">
<span class="info-box-icon bg-dark elevation-1"><i class="fas fa-file-invoice"></i></span>
<div class="info-box-content">
<span class="info-box-text">Accounting</span>
2024-07-05 12:56:02 +00:00
@foreach($x as $po)
<span class="info-box-number"><a href="{{ url(($po->api_class())::url().'/customerdetail?nameId='.$po->pivot->ref) }}" target="{{ $po->name }}">{{ ucfirst($po->name) }}</a></span>
@endforeach
</div>
</div>
</div>
@endif
@if($o->accounts_all->count() > 1)
<div class="col-12 col-sm-4 col-md-2">
2018-08-11 05:09:41 +00:00
<div class="info-box">
2021-06-29 06:36:34 +00:00
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-user"></i></span>
2019-06-02 05:35:48 +00:00
2018-08-11 05:09:41 +00:00
<div class="info-box-content">
2019-06-02 05:35:48 +00:00
<span class="info-box-text">Linked Accounts</span>
2024-07-05 12:56:02 +00:00
<span class="info-box-number">{{ number_format($o->accounts_all->count()) }}</span>
2018-08-11 05:09:41 +00:00
</div>
</div>
</div>
@endif
2018-08-20 12:15:28 +00:00
<div class="col-12 col-sm-4 col-md-2">
2018-08-11 05:09:41 +00:00
<div class="info-box">
2021-06-29 06:36:34 +00:00
<span class="info-box-icon bg-info"><i class="fas fa-clone"></i></span>
2019-06-02 05:35:48 +00:00
2018-08-11 05:09:41 +00:00
<div class="info-box-content">
2019-06-02 05:35:48 +00:00
<span class="info-box-text">Active Services</span>
2024-07-09 11:09:34 +00:00
<span class="info-box-number">{{ Service::active()->whereIn('account_id',$acts)->count() }} <small>/{{ Service::whereIn('account_id',$acts)->count() }}</small></span>
2018-08-11 05:09:41 +00:00
</div>
</div>
</div>
2018-08-20 12:15:28 +00:00
<div class="col-12 col-sm-4 col-md-2">
2018-08-11 05:09:41 +00:00
<div class="info-box">
2021-06-29 06:36:34 +00:00
<span class="info-box-icon bg-danger"><i class="fas fa-dollar-sign"></i></span>
2019-06-02 05:35:48 +00:00
2018-08-11 05:09:41 +00:00
<div class="info-box-content">
2019-06-02 05:35:48 +00:00
<span class="info-box-text">Account Balance</span>
2024-07-09 11:09:34 +00:00
<span class="info-box-number"><small>$</small> {{ number_format(($x=Account::InvoicesDue()->filter(fn($item)=>$acts->contains($item->account_id)))->sum('_balance'),2) }}</span>
2018-08-11 05:09:41 +00:00
</div>
</div>
</div>
2018-08-20 12:15:28 +00:00
<div class="col-12 col-sm-4 col-md-2">
2018-08-11 05:09:41 +00:00
<div class="info-box">
2021-06-29 06:36:34 +00:00
<span class="info-box-icon bg-dark"><i class="fas fa-hashtag"></i></span>
2019-06-02 05:35:48 +00:00
2018-08-11 05:09:41 +00:00
<div class="info-box-content">
<span class="info-box-text">Invoices Due</span>
<span class="info-box-number">{{ $x->count() }}</span>
2018-08-11 05:09:41 +00:00
</div>
</div>
</div>