Work on Service rendering

This commit is contained in:
Deon George
2020-02-05 13:47:24 +09:00
parent 01a7d73c17
commit 5f5d114f42
12 changed files with 412 additions and 313 deletions

View File

@@ -3,11 +3,11 @@
@section('htmlheader_title')
Reseller Home
@endsection
@section('contentheader_title')
@section('page_title')
{{ $o->full_name }}
@endsection
@section('page_title')
@section('contentheader_title')
{{ $o->full_name }}
@endsection
@section('contentheader_description')
@@ -59,9 +59,6 @@
<div class="col-xs-6">
@include('r.agents')
</div>
<div class="col-xs-6">
@include('r.service_inactive')
</div>
<div class="col-xs-6">
@include('r.clients')
</div>

View File

@@ -1,87 +0,0 @@
<div class="box box-warning">
<div class="box-header">
<h3 class="box-title">Services Inactive</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->all_client_service_inactive()->count())
<table class="table table-bordered table-striped table-hover" id="service_inactive" style="width: 100%;">
<thead>
<tr>
<th>ID</th>
<th>Account</th>
<th>Name</th>
<th>Status</th>
<th>Product</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Count {{ $user->all_client_service_inactive()->count() }}</th>
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
</table>
@else
<p>No Inactive Services</p>
@endif
</div>
</div>
@section('page-scripts')
@css('https://cdn.datatables.net/responsive/2.2.1/css/responsive.dataTables.min.css')
@css('https://cdn.datatables.net/rowgroup/1.0.2/css/rowGroup.dataTables.min.css')
@js('https://cdn.datatables.net/responsive/2.2.1/js/dataTables.responsive.min.js')
@js('https://cdn.datatables.net/rowgroup/1.0.2/js/dataTables.rowGroup.min.js')
<style>
table.dataTable td {
outline: none;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#service_inactive').DataTable( {
responsive: true,
ajax: {
url: "/api/r/service_inactive"
},
columns: [
{ data:
@if($user->isWholesaler())
"admin_service_id_url"
@else
"service_id_url"
@endif
},
{ data: "account_name" },
{ data: "name_full" },
{ data: "status" },
{ data: "product_name" }
],
language: {
emptyTable: "No InActive Services"
},
order: [3, 'asc'],
rowGroup: {
dataSrc: 'account_name',
startRender: null,
endRender: function ( rows, group ) {
return rows.count()+' x ' + group;
},
},
orderFixed: [1, 'asc']
});
$('#service_movements tbody').on('click','tr', function () {
$(this).toggleClass('selected');
});
});
</script>
@append

View File

@@ -3,11 +3,11 @@
@section('htmlheader_title')
Client Home
@endsection
@section('contentheader_title')
@section('page_title')
{{ $o->full_name }}
@endsection
@section('page_title')
@section('contentheader_title')
{{ $o->full_name }}
@endsection
@section('contentheader_description')

View File

@@ -1,38 +1,95 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Service #{{ $o->id }}
{{ $o->sid }}
@endsection
@section('page_title')
{{ $o->sid }}
@endsection
@section('contentheader_title')
Service #{{ $o->id }}
Service: {{ $o->sid }} <strong>NBN-50/20-100</strong>
@endsection
@section('contentheader_description')
{{ $o->service_id }}
{{ $o->sname }}: {{ $o->sdesc }}
@endsection
@section('main-content')
<div class="col-md-12">
<div class="box box-primary">
<div class="card-header with-border">
<h3 class="card-title">Service Information</h3>
</div>
<div class="row">
<!-- Service Details -->
<div class="col-5">
@include('u.service.widgets.'.$o->stype.'.details',['o'=>$o->type])
@include('u.service.widgets.information')
</div>
<div class="card-body">
<div class="col-md-3">
@switch($o->order_status)
@case('ORDER-SUBMIT')
@case('ORDER-SENT')
@case('ORDER-HOLD')
@case('ORDERED')
@include('u.widgets.service.order.sent')
@break
<div class="col-7">
<div class="card">
<div class="card-header bg-dark d-flex p-0">
<span class="p-3"><i class="fa fa-bars"></i></span>
<ul class="nav nav-pills p-2">
<li class="nav-item"><a class="nav-link active" href="#product" data-toggle="tab">Product</a></li>
<li class="nav-item"><a class="nav-link" href="#traffic" data-toggle="tab">Traffic</a></li>
<li class="nav-item"><a class="nav-link" href="#invoice_next" data-toggle="tab">Next Invoice</a></li>
<li class="nav-item"><a class="nav-link" href="#invoices" data-toggle="tab">Invoices</a></li>
<li class="nav-item"><a class="nav-link" href="#emails" data-toggle="tab">Emails</a></li>
</ul>
@default
@include('u.widgets.service.info')
@endswitch
<ul class="nav nav-pills ml-auto p-2">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" tabindex="-1" href="#tab_3">Action</a>
<a class="dropdown-item" tabindex="-1" href="#">Another action</a>
<a class="dropdown-item" tabindex="-1" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" tabindex="-1" href="#">Separated link</a>
</div>
</li>
</ul>
</div><!-- /.card-header -->
<div class="card-body">
<div class="tab-content">
<div class="tab-pane fade" id="traffic" role="tabpanel">
Traffic.
</div>
<div class="tab-pane fade show active" id="product" role="tabpanel">
Product.
</div>
<div class="tab-pane fade" id="invoice_next" role="tabpanel">
Invoice Next.
</div>
<div class="tab-pane fade" id="invoices" role="tabpanel">
Invoices.
</div>
<div class="tab-pane fade" id="emails" role="tabpanel">
Email.
</div>
</div>
</div>
<!-- /.card -->
</div>
</div>
</div>
@endsection
@endsection
@section('page-scripts')
<style>
.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
background-color: #ffffff;
color: #343a40;
}
.nav-pills .nav-link:hover {
background-color: #6c757d;
color: #ffffff;
}
.nav-pills .nav-link:not(.active):hover {
background-color: #6c757d;
color: #ffffff;
}
</style>
@append

View File

@@ -1,152 +0,0 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ $o->SID }}
@endsection
@section('contentheader_title')
Service: {{ $o->SID }}
@endsection
@section('page_title')
{{ $o->SID }}
@endsection
@section('contentheader_description')
{{ $o->type->name_full }}
@endsection
@section('main-content')
<div class="content">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header p-2">
<ul class="nav nav-pills">
<li class="nav-item"><a class="nav-link active" href="#tab-service" data-toggle="tab">Service</a></li>
<li class="nav-item"><a class="nav-link" href="#tab-invoice" data-toggle="tab">Invoices</a></li>
<li class="nav-item"><a class="nav-link" href="#tab-email" data-toggle="tab">Emails</a></li>
<li class="nav-item"><a class="nav-link" href="#tab-traffic" data-toggle="tab">Traffic</a></li>
</ul>
</div>
<div class="card-body">
<div class="tab-content">
<div class="active tab-pane" id="tab-service">
<div class="row">
<div class="card-group w-100">
@include('common.service.widget.info')
<div class="card card-primary card-outline">
<div class="card-header">
<strong>Service Details</strong>
</div>
<div class="card-body">
<table class="table table-borderless">
<tr>
<th>Number</th>
<td>{{ $o->type->service_number }}</td>
</tr>
<tr>
<th>Address</th>
<td>{{ $o->type->service_address }}</td>
</tr>
<tr>
<th>Connected</th>
<td>{{ $o->type->service_connect_date->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Contract</th>
<td>{{ $o->type->contract_term }} mths <small>(until {{ $o->type->service_contract_date ? $o->type->service_contract_date->addMonths($o->type->contract_term)->format('Y-m-d') : 'N/A' }})</small></td>
</tr>
<tr>
<th>Username</th>
<td>{{ $o->type->service_username }}</td>
</tr>
<tr>
<th>Password</th>
<td>{{ $o->type->service_password }}</td>
</tr>
<tr>
<th>IP Address</th>
<td>{{ $o->type->ipaddress ? $o->type->ipaddress : 'Dynamic' }}</td>
</tr>
</table>
</div>
</div>
<div class="card card-primary card-outline">
<div class="card-header">
<strong>DSL Details</strong>
</div>
<div class="card-body">
<table class="table table-borderless">
<tr>
<th>Speed</th>
<td>{{ $o->product->type->speed }}</td>
</tr>
@if ($o->product->type->base_down_peak)
<tr>
<th>Peak Included Downloads</th>
<td>{{ number_format($o->product->type->base_down_peak,0) }}GB</td>
</tr>
@endif
@if ($o->product->type->base_down_offpeak)
<tr>
<th>Peak Included Downloads</th>
<td>{{ number_format($o->product->type->base_down_offpeak,0) }}MB</td>
</tr>
@endif
<tr>
<th>Traffic Last Month</th>
<td>TBA</td>
</tr>
<tr>
<th>Traffic This Month</th>
<td>TBA</td>
</tr>
<tr>
<th>Excess Traffic Charges to Bill</th>
<td>TBA</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab-invoice">
<div class="row">
<div class="col-4">
@include('common.service.widget.invoice')
{{-- @todo show list of outstanding invoices --}}
</div>
{{-- Workaround since col-offset-x is not in our CSS? --}}
<div class="col-2">
&nbsp;
</div>
<div class="col-6">
@include('common.invoice.widget.list')
</div>
</div>
</div>
<div class="tab-pane" id="tab-email">
</div>
<div class="tab-pane" id="tab-traffic">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,70 @@
<div class="card">
<!-- @todo -->
@if($o->service->isPending())
<div class="ribbon-wrapper ribbon-lg">
<div class="ribbon bg-warning">
Pending
</div>
</div>
@endif
<div class="card-header bg-gray-dark">
<h3 class="card-title">Broadband Details</h3>
</div>
<div class="card-body bg-gray-dark">
<table class="table table-sm">
<tr>
<th>Address</th>
<td class="text-uppercase">{{ $o->service_description }}</td>
</tr>
<tr>
<th>Service Number</th>
<td>{{ $o->service_name }}</td>
</tr>
<tr>
<th>Service Username</th>
<td>{{ $o->service_username }}</td>
</tr>
<tr>
<th>Service Password</th>
<td>{{ $o->service_password }}</td>
</tr>
@if($o->service_connect_date)
<tr>
<th>Connected</th>
<td>{{ $o->service_connect_date->format('Y-m-d') }}</td>
</tr>
@endif
<!-- @todo -->
@if(FALSE)
<tr>
<th>Speed</th>
<td>{{ 'xxx/YY' }} Mbps</td>
</tr>
<tr>
<th>Traffic</th>
<td>{{ 'xxx' }} GB (YY GB used month)</td>
</tr>
@endif
<tr>
<th>IP Address</th>
<td>{{ $o->ipaddress ?: 'Dynamic' }}</td>
</tr>
@if ($o->inContract())
<tr>
<th>Contract</th>
<td>{{ $o->contract_term }} months <small>({{ ($x=$o->service_contract_date->addMonths($o->contract_term))->diffForHumans() }})</small></td>
</tr>
<tr>
<th>Contract End</th>
<td>{{ $x->format('Y-m-d') }}</td>
</tr>
@endif
<tr>
<th>Cancel Notice</th>
<td>1 month @if($o->inContract())<small>(after {{ $o->service_contract_date->addMonths($o->contract_term-1)->format('Y-m-d') }})</small>@endif</td>
</tr>
</table>
</div>
</div>

View File

@@ -0,0 +1,39 @@
<div class="card">
<div class="card-header bg-light">
<h3 class="card-title">Service Information</h3>
</div>
<div class="card-body bg-light">
<table class="table table-sm">
<tr>
<th>Status</th>
<td>{{ $o->status }}</td>
</tr>
@if ($o->active)
<tr>
<th>Billed</th>
<td>{{ $o->billing_period }}</td>
</tr>
<tr>
<th>Invoiced To</th>
<td>{{ $o->invoice_to->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Paid Until</th>
<td>{{ $o->paid_to->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Next Invoice</th>
<td>{{ $o->invoice_next->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Estimated Invoice</th>
<td>${{ number_format($o->billing_price,2) }}</td>
</tr>
@endif
<tr>
<th>Payment Method</th>
<td>@if ($o->autopay)Direct Debit @else Invoice @endif</td>
</tr>
</table>
</div>
</div>