Removed redundant functions from Service::class

This commit is contained in:
Deon George
2022-04-22 10:36:41 +10:00
parent d53643ef55
commit 8ed9e38290
29 changed files with 307 additions and 514 deletions

View File

@@ -5,14 +5,14 @@ Please order the following...
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user()->id }} |
| Account | {{ $service->account_name }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product_name }} |
@switch($service->product_category)
@case('BROADBAND')
| Product | {{ $service->product->name }} |
@switch($service->category)
@case('Broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('PHONE')
@case('Phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;

View File

@@ -6,9 +6,9 @@
@component('mail::table')
| Service | Details |
| :---------- | :---------------- |
| Account | {{ $service->account_name }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product_name }} |
| Product | {{ $service->product->name }} |
@switch($service->category)
@case('BROADBAND')
| Address | {{ is_object($service->type) ? $service->type->service_address : 'Not Supplied' }} |

View File

@@ -5,14 +5,14 @@ Please cancel the following...
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user()->id }} |
| Account | {{ $service->account_name }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product_name }} |
@switch($service->product_category)
@case('BROADBAND')
| Product | {{ $service->product->name }} |
@switch($service->category)
@case('Broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('PHONE')
@case('Phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;

View File

@@ -5,14 +5,14 @@ Please change the following...
| Service | Details |
| :---------- | :---------------- |
| Logged User | {{ Auth::user()->id }}
| Account | {{ $service->account_name }} |
| Account | {{ $service->account->name }} |
| Service ID | {{ $service->sid }} |
| Product | {{ $service->product_name }} |
@switch($service->product_category)
@case('BROADBAND')
| Product | {{ $service->product->name }} |
@switch($service->category)
@case('Broadband')
| Address | {{ $service->type->service_address }} |
@break;
@case('PHONE')
@case('Phone')
| Number | {{ $service->type->service_number }} |
| Supplier Details | {{ $service->order_info->join(':') }} |
@break;

View File

@@ -5,7 +5,7 @@
<form class="g-0 needs-validation" method="POST" action="{{ url('a/service/edit',[$o->id]) }}">
@csrf
@includeIf('a.service.widgets.'.$o->stype.'.update',['o'=>$o->type])
@includeIf('a.service.widgets.'.$o->type->type.'.update',['o'=>$o->type])
<div class="row">
<div class="col-12">

View File

@@ -1,38 +0,0 @@
<div class="card card-primary card-outline">
<div class="card-header">
<strong>Service Information</strong>
</div>
<div class="card-body">
<table class="table table-borderless">
<tr>
<th>Account</th>
<td>{{ $o->account->name }}</td>
</tr>
<tr>
<th>Active</th>
<td>{!! $o->status_html !!}</td>
</tr>
<tr>
<th>Billing Period</th>
<td>{{ $o->billing_period }}</td>
</tr>
<tr>
<th>Billing Amount</th>
<td>${{ number_format($o->billing_price,2) }}</td>
</tr>
<tr>
<th>Invoiced To</th>
<td>{{ $o->invoice_to ? $o->invoice_to->format('Y-m-d') : '' }}</td>
</tr>
<tr>
<th>Next Invoice</th>
<td>{{ $o->invoice_next ? $o->invoice_next->format('Y-m-d') : '' }}</td>
</tr>
<tr>
<th>Current Invoices Due</th>
<td>${{ number_format($o->invoices_due()->sum('due'),2) }} <small>({{ $o->invoices_due()->count() }})</small></td>
</tr>
</table>
</div>
</div>

View File

@@ -41,7 +41,7 @@
<td><a href="{{ url('u/service',[$oo->service_id]) }}">{{ $oo->service->sid }}</td>
<td>{{ $oo->service->account->name }}</td>
<td>{{ $oo->service->product->name }}</td>
<td>{{ $oo->service_name }}</td>
<td>{{ $oo->service->name }}</td>
<td>{{ $oo->service_expire ? $oo->service_expire->format('Y-m-d') : '-' }}</td>
<td>{{ $oo->registrar->name }}</td>
<td>{{ $oo->registrar_ns }}</td>

View File

@@ -43,7 +43,7 @@
<td><a href="{{ url('u/service',[$oo->service_id]) }}">{{ $oo->service->sid }}</td>
<td>{{ $oo->service->account->name }}</td>
<td>{{ $oo->service->product->name }}</td>
<td>{{ $oo->service_name }}</td>
<td>{{ $oo->service->name }}</td>
<td>{{ $oo->service_expire ? $oo->service_expire->format('Y-m-d') : '-' }}</td>
<td>{{ $oo->service->product->supplier->name }}</td>
<td>{{ $oo->admin_url }}</td>

View File

@@ -40,7 +40,7 @@
<td><a href="{{ url('u/service',[$oo->service_id]) }}">{{ $oo->service->sid }}</td>
<td>{{ $oo->service->account->name }}</td>
<td>{{ $oo->service->product->name }}</td>
<td>{{ $oo->service_name }}</td>
<td>{{ $oo->service->name }}</td>
<td>{{ $oo->service_expire ? $oo->service_expire->format('Y-m-d') : '-' }}</td>
<td>{{ $oo->service->product->supplier->name }}</td>
<td>@if ($oo->service->isBilled()) <span class="@if($oo->service->suspend_billing)strike @endif">{{ $oo->service->invoice_next->format('Y-m-d') }}</span> @else - @endif</td>

View File

@@ -11,7 +11,7 @@
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
@endsection
@section('contentheader_description')
{{ $o->sname }}: {{ $o->sdesc }}
{{ $o->name }}
@endsection
@section('main-content')
@@ -38,7 +38,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->stype.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
<div class="form-group row">
<label for="notes" class="col-sm-2 col-form-label text-right">Notes</label>

View File

@@ -11,7 +11,7 @@
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
@endsection
@section('contentheader_description')
{{ $o->sname }}: {{ $o->sdesc }}
{{ $o->name }}
@endsection
@section('main-content')
@@ -38,7 +38,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->stype.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
<div class="form-group row">
<label for="notes" class="col-sm-2 col-form-label text-right">Notes</label>

View File

@@ -13,7 +13,7 @@
@foreach ($oo->groupBy('service_id') as $ooo)
<tr>
<td class="pt-0 pb-1" style="width: 12em;"><a href="{{ url('u/service',$ooo->first()->service_id) }}">{{ $ooo->first()->service->sid }}</a></td>
<td class="pt-0 pb-1" colspan="3">{{ $ooo->first()->service->sname }}: {{ $ooo->first()->service->sdesc }}</td>
<td class="pt-0 pb-1" colspan="3">{{ $ooo->first()->service->name }}</td>
</tr>
@foreach ($ooo as $io)

View File

@@ -11,7 +11,7 @@
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
@endsection
@section('contentheader_description')
{{ $o->sname }}: {{ $o->sdesc }}
{{ $o->name }}
@endsection
@section('main-content')
@@ -44,7 +44,7 @@
</div>
{{--
@includeIf('u.service.widgets.'.$o->stype.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
--}}
<div class="form-group row">

View File

@@ -11,7 +11,7 @@
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
@endsection
@section('contentheader_description')
{{ $o->sname }}: {{ $o->sdesc }}
{{ $o->name }}
@endsection
@section('main-content')
@@ -43,7 +43,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->stype.'.change',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->type->type.'.change',['o'=>$o->type])
<div class="form-group row">
<label for="notes" class="col-2 col-form-label text-right">Notes</label>

View File

@@ -11,14 +11,15 @@
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
@endsection
@section('contentheader_description')
{{ $o->sname }}: {{ $o->sdesc }}
{{ $o->name }}
@endsection
@section('main-content')
<div class="row">
<!-- Service Details -->
<div class="col-5">
@includeIf('u.service.widgets.'.$o->stype.'.details',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->type->type.'.details',['o'=>$o->type])
@include('u.service.widgets.information')
</div>
@@ -77,7 +78,7 @@
@if ($o->hasUsage())
<div class="tab-pane fade {{ (! $o->isBilled() && (! session()->has('service_update'))) ? 'active show' : '' }}" id="traffic" role="tabpanel">
@if ($o->type->usage(30)->count())
@include('u.service.widgets.'.$o->stype.'.usagegraph',['o'=>$o->type])
@include('u.service.widgets.'.$o->type->type.'.usagegraph',['o'=>$o->type])
@endif
</div>
@endif

View File

@@ -22,10 +22,10 @@
@foreach ($o->services as $oo)
<tr>
<td><a href="{{ url('u/service',[$oo->id]) }}">{{ $oo->sid }}</a></td>
<td>{{ $oo->service_type }}</td>
<td>{{ $oo->category }}</td>
<td>{{ $oo->name_short }}</td>
<td>{{ $oo->product->name }}</td>
<td>{{ $oo->external_billing ? '-' : $oo->next_invoice->format('Y-m-d') }}</td>
<td>{{ $oo->external_billing ? '-' : $oo->invoice_next->format('Y-m-d') }}</td>
</tr>
@endforeach
</tbody>

View File

@@ -16,11 +16,11 @@
<table class="table table-sm">
<tr>
<th>Address</th>
<td>{{ $o->service_description }}</td>
<td>{{ $o->service_address }}</td>
</tr>
<tr>
<th>Service Number</th>
<td>{{ $o->service_name }}</td>
<td>{{ $o->service_number }}</td>
</tr>
<tr>
<th>Service Username</th>

View File

@@ -16,7 +16,7 @@
<table class="table table-sm">
<tr>
<th>Domain Name</th>
<td>{{ $o->service_name }}</td>
<td>{{ $o->service->name }}</td>
</tr>
<tr>
<th>Registrar URL</th>

View File

@@ -16,7 +16,7 @@
<table class="table table-sm">
<tr>
<th>Domain Name</th>
<td>{{ $o->service_name }}</td>
<td>{{ $o->service->name }}</td>
</tr>
@if($o->service_connect_date)
<tr>

View File

@@ -16,7 +16,7 @@
<table class="table table-sm">
<tr>
<th>Domain Name</th>
<td>{{ $o->service_name }}</td>
<td>{{ $o->service->name }}</td>
</tr>
@if($o->provider->whitelabel_url)
<tr>

View File

@@ -67,7 +67,7 @@
</tr>
<tr>
<th>Payment Method</th>
<td>@if ($o->autopay)Direct Debit @else Invoice @endif</td>
<td>@if ($o->billing)Direct Debit @else Invoice @endif</td>
</tr>
@elseif($o->wasCancelled())

View File

@@ -16,11 +16,11 @@
<table class="table table-sm">
<tr>
<th>Address</th>
<td>{{ $o->service_description }}</td>
<td>{{ $o->service_address }}</td>
</tr>
<tr>
<th>Service Number</th>
<td>{{ $o->service_name }}</td>
<td>{{ $o->service_number }}</td>
</tr>
<tr>
<th>Service Username</th>

View File

@@ -15,7 +15,7 @@
<table class="table table-sm">
<tr>
<th>Cert</th>
<td>{{ $o->service_description }}</td>
<td>{{ $o->name_detail }}</td>
</tr>
<tr>
<th>Cancel Notice</th>