osb/resources/views/theme/backend/adminlte/common/account/widget/summary.blade.php
2022-08-19 20:12:08 +10:00

62 lines
2.2 KiB
PHP

@if($o->my_accounts->count() <= 2 && $o->my_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>
@foreach ($o->my_accounts as $ao)
@foreach($ao->providers 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
@endforeach
</div>
</div>
</div>
@endif
@if ($o->accounts->count() > 1)
<div class="col-12 col-sm-4 col-md-2">
<div class="info-box">
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-user"></i></span>
<div class="info-box-content">
<span class="info-box-text">Linked Accounts</span>
<span class="info-box-number">{{ number_format($o->my_accounts->count()) }}</span>
</div>
</div>
</div>
@endif
<div class="col-12 col-sm-4 col-md-2">
<div class="info-box">
<span class="info-box-icon bg-info"><i class="fas fa-clone"></i></span>
<div class="info-box-content">
<span class="info-box-text">Active Services</span>
<!-- @todo This should count of inactive services too -->
<span class="info-box-number">{{ $o->services->count() }} <small>/{{ $o->services->count() }}</small></span>
</div>
</div>
</div>
<div class="col-12 col-sm-4 col-md-2">
<div class="info-box">
<span class="info-box-icon bg-danger"><i class="fas fa-dollar-sign"></i></span>
<div class="info-box-content">
<span class="info-box-text">Account Balance</span>
<span class="info-box-number"><small>$</small> {{ number_format(($x=$o->invoices()->with(['items.taxes','paymentitems.payment','account'])->get()->where('due','>',0))->sum('due'),2) }}</span>
</div>
</div>
</div>
<div class="col-12 col-sm-4 col-md-2">
<div class="info-box">
<span class="info-box-icon bg-dark"><i class="fas fa-hashtag"></i></span>
<div class="info-box-content">
<span class="info-box-text">Invoices Due</span>
<span class="info-box-number">{{ $x->count() }}</span>
</div>
</div>
</div>