Initial refactoring work
This commit is contained in:
@@ -1,32 +1,52 @@
|
||||
@extends('layouts.app')
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Page Title
|
||||
Home
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Home Page
|
||||
{{ $user->full_name }}
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
Home
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="col-sm-2 col-md-offset-0">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Content</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
<div class="content">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green"><i class="fa fa-clone"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Active Services</span>
|
||||
<span class="info-box-number">{{ $user->services_active->count() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
Content Here
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-red"><i class="fa fa-dollar"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Invoices Due</span>
|
||||
<span class="info-box-number"><small>$</small>{{ number_format($user->invoices_due->sum('due'),2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-7">
|
||||
@include('widgets.services_active')
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
@include('widgets.invoices_due')
|
||||
</div>
|
||||
{{--
|
||||
<div class="col-xs-5">
|
||||
@include('widgets.payment_history',['limit'=>10])
|
||||
</div>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@@ -0,0 +1,44 @@
|
||||
<div class="box box-danger small">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Invoices Due</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
@if ($user->invoices_due->count())
|
||||
<table class="table table-bordered table-striped table-hover" id="table">
|
||||
<tr>
|
||||
<th>Invoice</th>
|
||||
<th>Total</th>
|
||||
<th>Due</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
@foreach ($user->invoices_due as $o)
|
||||
@php
|
||||
$co = $o->currency();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $o->invoice_number }}</td>
|
||||
<td class="right">{{ number_format($o->total,$co->rounding) }}</td>
|
||||
<td class="right">{{ number_format($o->due,$co->rounding) }}</td>
|
||||
<td>{{ $o->date_due }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<th>Count {{ $user->invoices_due->count() }}</th>
|
||||
{{-- @todo Number format should configured by currency --}}
|
||||
<th class="right">{{ number_format($user->invoices_due->sum('total'),2) }}</th>
|
||||
<th class="right">{{ number_format($user->invoices_due->sum('due'),2) }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</table>
|
||||
@else
|
||||
<p>No invoices due</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,37 @@
|
||||
<div class="box box-danger small">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Payment History</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
@if ($user->payment_history->count())
|
||||
<table class="table table-bordered table-striped table-hover" id="table">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
@php
|
||||
$c=0;
|
||||
@endphp
|
||||
@foreach ($user->payment_history as $o)
|
||||
@if(! isset($limit) OR $c++ > $limit)
|
||||
@break;
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{ $o->payment_date }}</td>
|
||||
{{-- @todo Number format should configured by currency --}}
|
||||
<td class="right">{{ number_format($o->total_amt,2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>No payments recorded</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,45 @@
|
||||
<div class="box box-success small">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Services</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
@if ($user->services_active->count())
|
||||
<table class="table table-bordered table-striped table-hover" id="table">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Service</th>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Next Invoice</th>
|
||||
</tr>
|
||||
@foreach ($user->services_active as $o)
|
||||
<tr>
|
||||
<td>{{ $o->category }}</td>
|
||||
<td>{{ $o->service_number }}</td>
|
||||
<td>{{ $o->service_name }}</td>
|
||||
<td><span class="label
|
||||
@switch($o->active)
|
||||
@case(1) label-success">Active @break
|
||||
@default label-warning">Unknown
|
||||
@endswitch
|
||||
</span></td>
|
||||
<td>{{ $o->next_invoice }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<th>Count {{ $user->services_active->count() }}</th>
|
||||
<th colspan="4"> </th>
|
||||
</tr>
|
||||
</table>
|
||||
@else
|
||||
<p>No services active</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user