Optimising product category and category names

This commit is contained in:
Deon George
2022-06-12 11:21:20 +10:00
parent 360c1e46a1
commit cc94426902
36 changed files with 269 additions and 156 deletions

View File

@@ -26,11 +26,7 @@
<div class="card-header bg-dark d-flex p-0">
<ul class="nav nav-pills w-100 p-2">
<li class="nav-item"><a class="nav-link active" href="#details" data-toggle="tab">Detail</a></li>
{{--
<li class="nav-item"><a class="nav-link" href="#products" data-toggle="tab">Products</a></li>
<li class="nav-item"><a class="nav-link" href="#offerings" data-toggle="tab">Offerings</a></li>
<li class="nav-item"><a class="nav-link" href="#connections" data-toggle="tab">Connections</a></li>
--}}
<li class="nav-item"><a class="nav-link" href="#services" data-toggle="tab">Services</a></li>
</ul>
</div>
@@ -40,19 +36,9 @@
@include('a.product.widgets.detail')
</div>
{{--
<div class="tab-pane fade" id="products" role="tabpanel">
@include('a.product.widgets.products')
<div class="tab-pane fade" id="services" role="tabpanel">
@include('a.product.widgets.services')
</div>
<div class="tab-pane fade" id="offerings" role="tabpanel">
@include('a.product.widgets.offerings')
</div>
<div class="tab-pane fade" id="connections" role="tabpanel">
@include('a.product.widgets.connections')
</div>
--}}
</div>
</div>
</div>

View File

@@ -41,7 +41,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<input type="date" class="form-control" name="broadband[service_connect_date]" value="{{ $o->service_connect_date ? $o->service_connect_date->format('Y-m-d') : '' }}">
<input type="date" class="form-control" name="broadband[connect_at]" value="{{ $o->connect_at ? $o->connect_at->format('Y-m-d') : '' }}">
</div>
</div>
</div>
@@ -53,7 +53,10 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
</div>
<!-- @todo We changed contract_date in the DB, what happened to it and how do we work it out now -->
<!--
<input type="date" class="form-control" name="broadband[service_contract_date]" value="{{ $o->service_contract_date ? $o->service_contract_date->format('Y-m-d') : '' }}">
-->
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<!-- o = App\Models\Service\Email::class -->
<!-- o = App\Models\Service\Host::class -->
<div class="row">
<!-- DOMAIN NAME -->
<div class="col-6">

View File

@@ -3,54 +3,86 @@
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ ($s=$o->supplied)->supplier_detail->supplier->name }}</th>
@if (($s=$o->supplied) && $s->exists)
<th>{{ $s->supplier_detail->supplier->name }}</th>
@endif
<th>Us</th>
<th>&nbsp;</th>
@if ($s->exists)
<th>&nbsp;</th>
@endif
</tr>
</thead>
<tbody>
<tr>
<th>Product</th>
<td>#{{ $s->id }}: {{ $s->name }}</td>
@if ($s->exists)
<td>#{{ $s->id }}: {{ $s->name }}</td>
@endif
<td>#{{ $o->product->id }}: {{ $o->product->name }}</td>
<td>{{ $s->type }}</td>
@if ($s->exists)
<td>{{ $o->product->category_name }}</td>
@endif
</tr>
<tr>
<th>Setup</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->setup_cost,$o->account->taxes),2) }}</td>
<td>${{ number_format($b=\App\Models\Tax::tax_calc($o->product->setup_charge,$o->account->taxes),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@else
<td>-</td>
@endif
</tr>
<tr>
<th>Billed</th>
<td>{{ $s->billing_interval_string }}</td>
@if ($s->exists)
<td>{{ $s->billing_interval_string }}</td>
@endif
<td>{{ $o->billing_interval_string }}</td>
<td>&nbsp;</td>
@if ($s->exists)
<td>&nbsp;</td>
@endif
</tr>
<tr>
<th>Billing Price</th>
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,$o->product->billing_interval),$o->account->taxes),2) }}</td>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,$o->product->billing_interval),$o->account->taxes),2) }}</td>
@endif
<td>${{ number_format($b=$o->billing_charge,2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if ($s->exists)
<td>{!! markup($a,$b) !!}</td>
@endif
</tr>
<tr>
<th>Monthly Price</th>
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,1),$o->account->taxes),2) }}</td>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,1),$o->account->taxes),2) }}</td>
@endif
<td>${{ number_format($b=$o->billing_monthly_price,2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if ($s->exists)
<td>{!! markup($a,$b) !!}</td>
@endif
</tr>
<tr>
<th>Contract</th>
<td>{{ $s->contract_term }} months</td>
@if ($s->exists)
<td>{{ $s->contract_term }} months</td>
@endif
<td>{{ $o->contract_term }} months</td>
<td>&nbsp;</td>
@if ($s->exists)
<td>&nbsp;</td>
@endif
</tr>
<tr>
<th>Min Price</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->min_cost,$o->account->taxes),2) }}</td>
<td>${{ number_format($b=\App\Models\Tax::tax_calc($o->product->getMinChargeAttribute($o->billing_interval),$o->account->taxes),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@else
<td>-</td>
@endif
</tr>
</tbody>
</table>

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->type->type.'.update',['o'=>$o->type])
@includeIf('a.service.widgets.'.$o->product->category.'.update',['o'=>$o->type])
<div class="row">
<div class="col-12">

View File

@@ -38,7 +38,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->product->category.'.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

@@ -38,7 +38,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->product->category.'.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

@@ -44,7 +44,7 @@
</div>
{{--
@includeIf('u.service.widgets.'.$o->type->type.'.order',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->product->category.'.order',['o'=>$o->type])
--}}
<div class="form-group row">

View File

@@ -43,7 +43,7 @@
</div>
</div>
@includeIf('u.service.widgets.'.$o->type->type.'.change',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->product->category.'.change',['o'=>$o->type])
<div class="form-group row">
<label for="notes" class="col-2 col-form-label text-right">Notes</label>

View File

@@ -19,7 +19,7 @@
<!-- Service Details -->
<div class="col-5">
@includeIf('u.service.widgets.'.$o->type->type.'.details',['o'=>$o->type])
@includeIf('u.service.widgets.'.$o->product->category.'.details',['o'=>$o->type])
@include('u.service.widgets.information')
</div>
@@ -78,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->type->type.'.usagegraph',['o'=>$o->type])
@include('u.service.widgets.'.$o->product->category.'.usagegraph',['o'=>$o->type])
@endif
</div>
@endif

View File

@@ -11,7 +11,7 @@
<thead>
<tr>
<th>ID</th>
<th>Type</th>
<th>Category</th>
<th>Service</th>
<th>Product</th>
<th>Next Invoice</th>
@@ -22,7 +22,7 @@
@foreach ($o->services as $oo)
<tr>
<td><a href="{{ url('u/service',[$oo->id]) }}">{{ $oo->sid }}</a></td>
<td>{{ $oo->category }}</td>
<td>{{ $oo->product->category_name }}</td>
<td>{{ $oo->name_short }}</td>
<td>{{ $oo->product->name }}</td>
<td>{{ $oo->external_billing ? '-' : $oo->invoice_next->format('Y-m-d') }}</td>