Optimising Supplier Layout and source code placement
This commit is contained in:
165
resources/views/theme/backend/adminlte/supplier/cost.blade.php
Normal file
165
resources/views/theme/backend/adminlte/supplier/cost.blade.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<!-- $o = Cost::class -->
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Cost #{{ $o->id }}
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Cost #{{ $o->id }}
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
|
||||
@endsection
|
||||
|
||||
<!-- $o = App\Models\Costs -->
|
||||
@php($cost = 0)
|
||||
@php($charge = 0)
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<table class="table table-striped" id="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Category</th>
|
||||
<th>Service</th>
|
||||
<th>Active</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
<th class="text-right">Base</th>
|
||||
<th class="text-right">Excess</th>
|
||||
<th class="text-right">Cost</th>
|
||||
<th class="text-right">Charge</th>
|
||||
<th class="text-right">Profit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<!-- Broadband -->
|
||||
<tr>
|
||||
<td>Broadband</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>{{ $o->broadbands->min('start_at')->format('Y-m-d') }}</td>
|
||||
<td>{{ $o->broadbands->max('end_at')->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($a=$o->broadbands->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($o->broadbands->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($x=$o->broadbands->sum('cost'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($b=$o->broadbands->sum('service.billing_monthly_price'),2) }}</td>
|
||||
<td class="text-right {{ $b-$a < 0 ? 'text-danger' : '' }}">${{ number_format($b-$a,2) }}</td>
|
||||
</tr>
|
||||
@php($cost += $x)
|
||||
@php($charge += $b)
|
||||
|
||||
@foreach ($o->broadbands->groupBy('service_broadband_id') as $oo)
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{{ $oo->first()->service->name }}</td>
|
||||
<td>{{ $oo->first()->service->active ? 'YES' : 'NO' }}</td>
|
||||
<td>{{ $oo->min('start_at')->format('Y-m-d') }}</td>
|
||||
<td>{{ $oo->max('end_at')->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($a=$oo->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('cost'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($b=$oo->first()->service->billing_monthly_price,2) }}</td>
|
||||
<td class="text-right {{ $b-$a < 0 ? 'text-danger' : '' }}">${{ number_format($b-$a,2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<!-- Phone -->
|
||||
<tr>
|
||||
<td>Phone</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>{{ $o->phones->min('start_at')->format('Y-m-d') }}</td>
|
||||
<td>{{ $o->phones->max('end_at')->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($a=$o->phones->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($o->phones->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($x=$o->phones->sum('cost'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($b=$o->phones->sum('service.billing_monthly_price'),2) }}</td>
|
||||
<td class="text-right {{ $b-$a < 0 ? 'text-danger' : '' }}">${{ number_format($b-$a,2) }}</td>
|
||||
</tr>
|
||||
@php($cost += $x)
|
||||
@php($charge += $b)
|
||||
|
||||
@foreach ($o->phones->groupBy('service_phone_id') as $oo)
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{{ $oo->first()->service->name }}</td>
|
||||
<td>{{ $oo->first()->service->active ? 'YES' : 'NO' }}</td>
|
||||
<td>{{ $oo->min('start_at')->format('Y-m-d') }}</td>
|
||||
<td>{{ $oo->max('end_at')->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($a=$oo->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('cost'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($b=$oo->first()->service->billing_monthly_price,2) }}</td>
|
||||
<td class="text-right {{ $b-$a < 0 ? 'text-danger' : '' }}">${{ number_format($b-$a,2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<!-- Generic -->
|
||||
<tr>
|
||||
<td>Generic</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>{{ ($x=$o->generics)->count() ? $x->min('start_at')->format('Y-m-d') : '-' }}</td>
|
||||
<td>{{ $x->count() ? $x->max('end_at')->format('Y-m-d') : '-' }}</td>
|
||||
<td class="text-right">${{ number_format($a=$o->generics->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($o->generics->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($x=$o->generics->sum('cost'),2) }}</td>
|
||||
<td class="text-right">$0.00</td>
|
||||
<td class="text-right {{ 0-$a < 0 ? 'text-danger' : '' }}">${{ number_format(0-$a,2) }}</td>
|
||||
</tr>
|
||||
|
||||
@php($cost += $x)
|
||||
|
||||
@foreach ($o->generics->groupBy('service_generic_id') as $oo)
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{{ ($x=$oo->first()->service) ? $x->name : '-' }}</td>
|
||||
<td>{{ $x ? ($x->active ? 'YES' : 'NO') : '-' }}</td>
|
||||
<td>{{ $oo->min('start_at')->format('Y-m-d') }}</td>
|
||||
<td>{{ $oo->max('end_at')->format('Y-m-d') }}</td>
|
||||
<td class="text-right">${{ number_format($a=$oo->sum('base'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('excess'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($oo->sum('cost'),2) }}</td>
|
||||
<td class="text-right">${{ number_format($b=$x ? $x->billing_monthly_price : 0,2) }}</td>
|
||||
<td class="text-right {{ $b-$a < 0 ? 'text-danger' : '' }}">${{ number_format($b-$a,2) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="7">TOTAL</th>
|
||||
<th class="text-right">${{ number_format($cost,2) }}</th>
|
||||
<th class="text-right">${{ number_format($charge,2) }}</th>
|
||||
<td class="text-right {{ $charge-$cost < 0 ? 'text-danger' : '' }}">${{ number_format($charge-$cost,2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
@css(datatables,bootstrap4|rowgroup)
|
||||
@js(datatables,bootstrap4|rowgroup)
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#table').DataTable({
|
||||
order: [[0,'asc'],[1,'desc']],
|
||||
});
|
||||
|
||||
$('tbody').on('click','tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
@@ -0,0 +1,61 @@
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
{{ $o->name ?: 'New Supplier' }}
|
||||
@endsection
|
||||
@section('page_title')
|
||||
{{ $o->name ?: 'New Supplier' }}
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
{{ $o->name ?: 'New Supplier' }}
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
@include('adminlte::widget.status')
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<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>
|
||||
@if($o->exists)
|
||||
<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="#costs" data-toggle="tab">Costs</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active show" id="details" role="tabpanel">
|
||||
@include('supplier.widget.detail')
|
||||
</div>
|
||||
|
||||
@if($o->exists)
|
||||
<div class="tab-pane fade" id="products" role="tabpanel">
|
||||
@include('supplier.widget.products')
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="offerings" role="tabpanel">
|
||||
@include('supplier.widget.offerings')
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="connections" role="tabpanel">
|
||||
@include('supplier.widget.connections')
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="costs" role="tabpanel">
|
||||
@include('supplier.widget.costs')
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@@ -0,0 +1,73 @@
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Supplier
|
||||
@endsection
|
||||
@section('page_title')
|
||||
Supplier
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Supplier
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h1 class="card-title">Supplier Configuration</h1>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="form-group has-validation">
|
||||
<label for="name">Supplier Name</label>
|
||||
<select class="form-control form-control-border" id="name" name="supplier_id">
|
||||
<option value=""></option>
|
||||
<option value="">Add New</option>
|
||||
@foreach(\App\Models\Supplier::orderBy('active','DESC')->orderBy('name')->get()->groupBy('active') as $o)
|
||||
<optgroup label="{{ $o->first()->active ? 'Active' : 'Not Active' }}">
|
||||
@foreach($o as $oo)
|
||||
<option value="{{ $oo->id }}">{{ $oo->name }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('name')
|
||||
{{ $message }}
|
||||
@else
|
||||
Supplier Name is required.
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Suppliers Name</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
@css(select2)
|
||||
@js(select2,autofocus)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#name').select2()
|
||||
.on('change',function(item) {
|
||||
window.location.href = '{{ url('a/supplier/details') }}'+(item.target.value ? '/'+item.target.value : '');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
@@ -0,0 +1,34 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Service Type</th>
|
||||
<th>User Name</th>
|
||||
<th>Password</th>
|
||||
<th>URL</th>
|
||||
<th>Last Connect</th>
|
||||
<th class="text-right">Offerings</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->offeringTypes() as $key => $offering)
|
||||
<tr>
|
||||
<th>{{ $offering->type }}</th>
|
||||
@if(Arr::get($o->detail->connections,$key))
|
||||
<td>{{ Arr::get($o->detail->connections,$key.'.user') }}</td>
|
||||
<td>{{ Arr::get($o->detail->connections,$key.'.pass') }}</td>
|
||||
<td>{{ Arr::get($o->detail->connections,$key.'.url') }}</td>
|
||||
<td>{{ \Carbon\Carbon::createFromFormat('Y-m-d',Arr::get($o->detail->connections,$key.'.last'))->format('Y-m-d') }}</td>
|
||||
<td class="text-right">{{ number_format($offering->items->count()) }}</td>
|
||||
@else
|
||||
<td colspan="5"> </td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,34 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="form-group has-validation">
|
||||
<label for="cost_id">Supplier Invoice</label>
|
||||
<select class="form-control form-control-border" id="cost_id" name="cost_id">
|
||||
<option value=""></option>
|
||||
<option value="">Add New</option>
|
||||
@foreach(\App\Models\Cost::orderBy('billed_at','DESC')->get() as $oo)
|
||||
<option value="{{ $oo->id }}">{{ $oo->billed_at->format('Y-m-d') }}: ${{ number_format($oo->total,2) }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('name')
|
||||
{{ $message }}
|
||||
@else
|
||||
Date is required.
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Suppliers Invoice</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#cost_id')
|
||||
.on('change',function(item) {
|
||||
window.location.href = '{{ url('a/supplier/cost') }}'+(item.target.value ? '/'+item.target.value : '');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
@@ -0,0 +1,185 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3>Supplier Details</h3>
|
||||
<hr>
|
||||
@if(session()->has('success'))
|
||||
<span class="ml-3 pt-0 pb-0 pr-1 pl-1 btn btn-outline-success"><small>{{ session()->get('success') }}</small></span>
|
||||
@endif
|
||||
|
||||
<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="row">
|
||||
<!-- Supplier Name -->
|
||||
<div class="col-9">
|
||||
<div class="form-group has-validation">
|
||||
<label for="name">Supplier Name</label>
|
||||
<input type="text" class="form-control form-control-border @error('name') is-invalid @enderror" id="name" name="name" placeholder="Supplier Name" value="{{ old('name',$o->name) }}" required>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('name')
|
||||
{{ $message }}
|
||||
@else
|
||||
Supplier Name required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Supplier Active -->
|
||||
<div class="col-3">
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
|
||||
<input type="checkbox" class="custom-control-input" id="active" name="active" {{ old('active',$o->active) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="active">Active</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Address Lines -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="address1">Address Lines</label>
|
||||
<input type="text" class="form-control form-control-border @error('address1') is-invalid @enderror" id="address1" name="address1" placeholder="Address1" value="{{ old('address1',$o->address1) }}" required>
|
||||
<input type="text" class="form-control form-control-border" id="address2" name="address2" placeholder="Address2" value="{{ old('address2',$o->address2) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('address1')
|
||||
{{ $message }}
|
||||
@else
|
||||
Atleast 1 address line required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- City -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="city">City</label>
|
||||
<input type="text" class="form-control form-control-border @error('city') is-invalid @enderror" id="city" name="city" placeholder="City" value="{{ old('city',$o->city) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('city')
|
||||
{{ $message }}
|
||||
@else
|
||||
City is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- State -->
|
||||
<div class="col-9">
|
||||
<div class="form-group has-validation">
|
||||
<label for="state">State</label>
|
||||
<input type="text" class="form-control form-control-border @error('state') is-invalid @enderror" id="state" name="state" placeholder="State" value="{{ old('state',$o->state) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('state')
|
||||
{{ $message }}
|
||||
@else
|
||||
State is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Postal Code -->
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="postcode">Postal Code</label>
|
||||
<input type="text" class="form-control form-control-border @error('postcode') is-invalid @enderror" id="postcode" name="postcode" placeholder="Postal Code" value="{{ old('postcode',$o->postcode) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('postcode')
|
||||
{{ $message }}
|
||||
@else
|
||||
Postcode is required.
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-1 col-4">
|
||||
<div class="row">
|
||||
<!-- Accounts Email -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="accounts">Accounts Email</label>
|
||||
<input type="text" class="form-control form-control-border @error('supplier_details.accounts') is-invalid @enderror" id="accounts" name="supplier_details[accounts]" placeholder="Accounts Email" value="{{ old('supplier_details.accounts',($o->detail ? $o->detail->accounts : '')) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('supplier_details.accounts')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Support Email -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="support">Support Email</label>
|
||||
<input type="text" class="form-control form-control-border @error('supplier_details.support') is-invalid @enderror" id="support" name="supplier_details[support]" placeholder="Support Email" value="{{ old('supplier_details.support',($o->detail ? $o->detail->support : '')) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('supplier_details.support')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Payment Details -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="payments">Payment Details</label>
|
||||
<input type="text" class="form-control form-control-border @error('supplier_details.payments') is-invalid @enderror" id="payments" name="supplier_details[payments]" placeholder="Payment Details" value="{{ old('supplier_details.payments',($o->detail ? $o->detail->payments : '')) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('supplier_details.payments')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Notes -->
|
||||
<div class="col-12">
|
||||
<div class="form-group has-validation">
|
||||
<label for="notes">Notes</label>
|
||||
<textarea class="form-control @error('supplier_details.notes') is-invalid @enderror" id="notes" name="supplier_details[notes]" placeholder="Notes...">{{ old('supplier_details.notes',($o->detail ? $o->detail->notes : '')) }}</textarea>
|
||||
<span class="input-helper">Notes.</span>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('supplier_details.notes')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Buttons -->
|
||||
<div class="col-12">
|
||||
<a href="{{ url('/home') }}" class="btn btn-danger">Cancel</a>
|
||||
@can('wholesaler')
|
||||
<button type="submit" name="submit" class="btn btn-success mr-0 float-right">@if ($o->exists)Save @else Add @endif</button>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,84 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<div class="row">
|
||||
<div class="col-5 col-sm-2">
|
||||
<div class="nav flex-column nav-tabs h-100" role="tablist" aria-orientation="vertical">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
<a class="nav-link @if($loop->first)active @endif" id="offering-{{ $key }}-tab" data-toggle="pill" href="#offering-{{ $key }}-profile" role="tab" aria-controls="offering-{{ $key }}-tab" aria-selected="true">{{ $offering->type }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-7 col-sm-10">
|
||||
<div class="tab-content">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
<div class="tab-pane text-left fade show @if($loop->first)active @endif" id="offering-{{ $key }}-profile" role="tabpanel" aria-labelledby="offering-{{ $key }}-tab">
|
||||
<table class="table table-sm table-bordered w-100" id="offering-{{ $key }}-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="8">Product</th>
|
||||
<th colspan="2">Services</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Product ID</th>
|
||||
<th>Product Name</th>
|
||||
<th>Active</th>
|
||||
<th class="text-right">Setup Cost</th>
|
||||
<th class="text-right">Base Cost</th>
|
||||
<th class="text-right">Types</th>
|
||||
<th class="text-right">Products</th>
|
||||
<th class="text-right">Sold</th>
|
||||
<th class="text-right">Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($xx=$offering->items->with(['types.product.services'])->get() as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->id }}</td>
|
||||
<td>{{ $oo->name }}</td>
|
||||
<td>{{ $oo->name_long }}</td>
|
||||
<td class="text-right">{{ $oo->active ? 'YES' : 'NO' }}</td>
|
||||
<td class="text-right">{{ number_format($oo->setup_cost_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($oo->base_cost_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($oo->types->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($oo->types->pluck('product')->filter()->count()) }}</td>
|
||||
<td class="text-right">{{ number_format(($x=$oo->types->pluck('product.services')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($x->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3">TOTALS</th>
|
||||
<td class="text-right" colspan="3">{{ $xx->where('active',TRUE)->count() }}</td>
|
||||
<td class="text-right">{{ number_format(($x=$xx->pluck('types')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($x->pluck('product')->filter()->count()) }}</td>
|
||||
<td class="text-right">{{ number_format(($xxx=$x->pluck('product.services')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($xxx->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
@css(datatables,bootstrap4)
|
||||
@js(datatables,bootstrap4)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
$('#offering-{{ $key }}-table').DataTable();
|
||||
|
||||
$('#offering-{{ $key }}-table tbody').on('click','tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
@endforeach
|
||||
});
|
||||
</script>
|
||||
@append
|
@@ -0,0 +1,88 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<div class="row">
|
||||
<div class="col-5 col-sm-2">
|
||||
<div class="nav flex-column nav-tabs h-100" role="tablist" aria-orientation="vertical">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
<a class="nav-link @if($loop->first)active @endif" id="products-{{ $key }}-tab" data-toggle="pill" href="#products-{{ $key }}-profile" role="tab" aria-controls="products-{{ $key }}-tab" aria-selected="true">{{ $offering->type }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-7 col-sm-10">
|
||||
<div class="tab-content">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
<div class="tab-pane text-left fade show @if($loop->first)active @endif" id="products-{{ $key }}-profile" role="tabpanel" aria-labelledby="products-{{ $key }}-tab">
|
||||
<table class="table table-sm table-bordered w-100" id="products-{{ $key }}-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">Product</th>
|
||||
<th colspan="4">Services</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Product ID</th>
|
||||
<th>Product Name</th>
|
||||
<th>Active</th>
|
||||
<th>Default Billing</th>
|
||||
<th class="text-right">Setup Cost</th>
|
||||
<th class="text-right">Base Cost</th>
|
||||
<th class="text-right">Setup Charge</th>
|
||||
<th class="text-right">Base Charge</th>
|
||||
<th class="text-right">Sold</th>
|
||||
<th class="text-right">Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($xx=$offering->items->with(['types.product.services','types.product.type.supplied','types.product.description'])->get() as $oo)
|
||||
@foreach($oo->types->pluck('product')->filter() as $po)
|
||||
|
||||
<tr>
|
||||
<td>{{ $po->lid }}</td>
|
||||
<td>{{ $po->name_short }}</td>
|
||||
<td>{{ $po->name }}</td>
|
||||
<td class="text-right">{{ $po->active ? 'YES' : 'NO' }}</td>
|
||||
<td class="text-right">{{ $po->billing_interval_string }}</td>
|
||||
<td class="text-right">{{ number_format($po->setup_cost_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($po->base_cost_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($po->setup_charge_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($po->base_charge_taxable,2) }}</td>
|
||||
<td class="text-right">{{ number_format($po->services->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($po->services->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3">TOTALS</th>
|
||||
<td class="text-right">{{ $xx->where('active',TRUE)->count() }}</td>
|
||||
<th colspan="5"> </th>
|
||||
<td class="text-right">{{ number_format(($xxx=$xx->pluck('types')->flatten()->pluck('product.services')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($xxx->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
@css(datatables,bootstrap4)
|
||||
@js(datatables,bootstrap4)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
$('#products-{{ $key }}-table').DataTable();
|
||||
|
||||
$('#products-{{ $key }}-table tbody').on('click','tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
@endforeach
|
||||
});
|
||||
</script>
|
||||
@append
|
Reference in New Issue
Block a user