Enable editing of supplier products and listing services connected to them
This commit is contained in:
@@ -0,0 +1,219 @@
|
||||
<!-- $o = Supplier::class -->
|
||||
<!-- $oo = Supplier/{type}::class -->
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Supplier - @if ($oo && $oo->exists)Edit @else New @endif Product
|
||||
@endsection
|
||||
@section('page_title')
|
||||
@if ($oo && $oo->exists)Edit @else New @endif Product
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Supplier - @if ($oo && $oo->exists)Edit @else New @endif Product
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h1 class="card-title">Supplier Product</h1>
|
||||
@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
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{ $oo?->id }}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<!-- Supplier -->
|
||||
<div class="form-group has-validation">
|
||||
<label for="supplier_detail_id">Supplier</label>
|
||||
<select class="form-control form-control-border @error('supplier_detail_id') is-invalid @enderror" id="supplier_detail_id" name="supplier_detail_id">
|
||||
<option value=""></option>
|
||||
@foreach(\App\Models\Supplier::active()->orderBy('name')->get() as $so)
|
||||
<option value="{{ $so->id }}" {{ old('supplier_detail_id',$o->id) == $so->detail->id ? 'selected' : ''}}>{{ $so->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('supplier_detail_id')
|
||||
{{ $message }}
|
||||
@else
|
||||
Date is required.
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Suppliers Name</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<!-- Offering Type -->
|
||||
<div class="form-group has-validation">
|
||||
<label for="offering_type">Type</label>
|
||||
<select class="form-control form-control-border @error('offering_type') is-invalid @enderror" id="offering_type" name="offering_type">
|
||||
<option value=""></option>
|
||||
@foreach(\App\Models\Supplier::offeringTypes()->sortBy(function($item) { return $item->category_name; }) as $to)
|
||||
<option value="{{ $to->category }}" {{ old('offering_type',$oo?->category) == $to->category ? 'selected' : ''}}>{{ $to->category_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('offering_type')
|
||||
{{ $message }}
|
||||
@else
|
||||
Offering Type is Required
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Offering Type</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="type"></div>
|
||||
|
||||
<div class="row">
|
||||
<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 ($oo && $oo->exists)Save @else Add @endif</button>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($oo && $oo->exists)
|
||||
<div class="col-4">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h1 class="card-title">Offering Products</h1>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th class="text-right">Services</th>
|
||||
<th class="text-right">Sold</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($oo->products as $pto)
|
||||
<tr>
|
||||
<td>{{ $pto->id }}</td>
|
||||
<td>{{ $pto->product->name }}</td>
|
||||
<td class="text-right">{{ $pto->product->services->where('active',true)->count() }}</td>
|
||||
<td class="text-right">{{ $pto->product->services->count() }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h1 class="card-title">Services Using this Supplier Product</h1>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="table table-sm" id="services">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Product</th>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($oo->products as $pto)
|
||||
@foreach ($pto->product->services as $so)
|
||||
<tr>
|
||||
<td><a href="{{ url('u/service',[$so->id]) }}">{{ $so->lid }}</a></td>
|
||||
<td>{{ $so->product->type->id }}</td>
|
||||
<td>{{ $so->name }}</td>
|
||||
<td>{{ $so->active ? 'Active' : 'Not Active' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
@css(datatables,bootstrap4|rowgroup)
|
||||
@js(datatables,bootstrap4|responsive|rowgroup)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function load_type(type,id) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'html',
|
||||
cache: false,
|
||||
data: {errors: {!! $errors !!}, old: {!! json_encode(old()) !!} },
|
||||
url: '{{ url('a/supplier/product/view') }}/'+type+(id ? '/'+id : ''),
|
||||
timeout: 2000,
|
||||
error: function(x) {
|
||||
spinner.toggleClass('d-none').toggleClass('fa-spin');
|
||||
alert('Failed to submit');
|
||||
},
|
||||
success: function(data) {
|
||||
$("div[id=type]").empty().append(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@if ($oo && $oo->exists)
|
||||
$('#offering_type').attr('style','pointer-events: none;');
|
||||
load_type('{{$oo->category}}',{{$oo->id}})
|
||||
@endif
|
||||
|
||||
$('#offering_type').on('change',function() {
|
||||
if (! $(this).val())
|
||||
return;
|
||||
|
||||
load_type($(this).val());
|
||||
});
|
||||
|
||||
$('#services').DataTable({
|
||||
order: [[3,'asc'],[1,'asc'],[2,'asc']],
|
||||
rowGroup: {
|
||||
dataSrc: 3,
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [3],
|
||||
visible: false,
|
||||
}
|
||||
],
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
@@ -0,0 +1,308 @@
|
||||
<!-- $o = Supplier{type}::class -->
|
||||
<div class="row">
|
||||
<!-- Supplier Name -->
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="product_id">Product ID</label>
|
||||
<input type="text" class="form-control form-control-border @error('product_id') is-invalid @enderror" id="product_id" name="product_id" placeholder="Product ID" value="{{ old('product_id',$o?->product_id) }}" required>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('product_id')
|
||||
{{ $message }}
|
||||
@else
|
||||
Supplier's Product ID
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Supplier's Product ID</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Suppliers Description -->
|
||||
<div class="offset-1 col-8">
|
||||
<div class="form-group has-validation">
|
||||
<label for="product_desc">Product Description</label>
|
||||
<input type="text" class="form-control form-control-border @error('product_desc') is-invalid @enderror" id="product_desc" name="product_desc" placeholder="Product Description" value="{{ old('product_desc',$o?->product_desc) }}" required>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('product_desc')
|
||||
{{ $message }}
|
||||
@else
|
||||
Product Description is required
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Supplier's Product Description as it appears on Invoices</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Supplier Active -->
|
||||
<div class="col-1">
|
||||
<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>
|
||||
|
||||
<!-- Base Cost -->
|
||||
<div class="offset-1 col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="base_cost">Base (ex)</label>
|
||||
<input type="number" class="form-control form-control-border @error('base_cost') is-invalid @enderror" id="base_cost" name="base_cost" placeholder="Cost" value="{{ old('base_cost',$o?->base_cost) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('base_cost')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Monthly Cost</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Setup Cost -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="setup_cost">Setup (ex)</label>
|
||||
<input type="number" class="form-control form-control-border @error('setup_cost') is-invalid @enderror" id="setup_cost" name="setup_cost" placeholder="Setup" value="{{ old('setup_cost',$o?->setup_cost) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('setup_cost')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Setup Cost</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contract Term -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="contract_term">Contract Term</label>
|
||||
<input type="number" class="form-control form-control-border @error('contract_term') is-invalid @enderror" id="contract_term" name="contract_term" placeholder="Term" value="{{ old('contract_term',$o?->contract_term) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('contract_term')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Term (mths)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Speed -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="speed">Speed</label>
|
||||
<input type="text" class="form-control form-control-border @error('speed') is-invalid @enderror" id="speed" name="speed" placeholder="Speed" value="{{ old('speed',$o?->speed) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('speed')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Speed</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Technology -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="technology">Technology</label>
|
||||
<input type="text" class="form-control form-control-border @error('technology') is-invalid @enderror" id="technology" name="technology" placeholder="Speed" value="{{ old('technology',$o?->technology) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('technology')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Technology</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- @todo Add javascript so these toggles cannot both be on -->
|
||||
<!-- Extra Charged -->
|
||||
<div class="col-1">
|
||||
<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="extra_charged" name="extra_charged" {{ old('extra_charged',$o?->extra_charged) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="extra_charged">Extra Charge</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-1 col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="offpeak_start">OffPeak Start</label>
|
||||
<input type="time" class="form-control form-control-border @error('offpeak_start') is-invalid @enderror" id="offpeak_start" name="offpeak_start" value="{{ old('offpeak_start',($o && $o->offpeak_start) ? $o->offpeak_start->format('H:i') : '') }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('offpeak_start')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Offpeak Start</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<div class="form-group has-validation">
|
||||
<label for="offpeak_end">OffPeak End</label>
|
||||
<input type="time" class="form-control form-control-border @error('offpeak_end') is-invalid @enderror" id="offpeak_end" name="offpeak_end" value="{{ old('offpeak_end',($o && $o->offpeak_end) ? $o->offpeak_end->format('H:i') : '') }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('offpeak_end')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Offpeak Ends</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<!-- Extra Shaped -->
|
||||
<div class="col-1">
|
||||
<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="extra_shaped" name="extra_shaped" {{ old('extra_shaped',$o?->extra_shaped) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="extra_shaped">Extra Shaped</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-1 col-8">
|
||||
<h3 class="text-md">Included Traffic in MB</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Base Down Peak -->
|
||||
<div class="offset-2 col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="base_down_peak">Down Peak</label>
|
||||
<input type="number" class="form-control form-control-border @error('base_down_peak') is-invalid @enderror" id="base_down_peak" name="base_down_peak" value="{{ old('base_down_peak',$o?->base_down_peak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('base_down_peak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Base Down Peak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="base_up_peak">Up Peak</label>
|
||||
<input type="number" class="form-control form-control-border @error('base_up_peak') is-invalid @enderror" id="base_up_peak" name="base_up_peak" value="{{ old('base_up_peak',$o?->base_up_peak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('base_up_peak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Base Down Offpeak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="base_down_offpeak">Down Offpeak</label>
|
||||
<input type="number" class="form-control form-control-border @error('base_down_offpeak') is-invalid @enderror" id="base_down_offpeak" name="base_down_offpeak" value="{{ old('base_down_offpeak',$o?->base_down_offpeak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('base_down_offpeak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Base Down Offpeak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="base_up_offpeak">Up Offpeak</label>
|
||||
<input type="number" class="form-control form-control-border @error('base_up_offpeak') is-invalid @enderror" id="base_up_offpeak" name="base_up_offpeak" value="{{ old('base_up_offpeak',$o?->base_up_offpeak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('base_up_offpeak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Metric Divider -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="metric">Metric Divider</label>
|
||||
<input type="number" class="form-control form-control-border @error('metric') is-invalid @enderror" id="metric" name="metric" placeholder="1000" value="{{ old('metric',$o?->metric) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('metric')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
<span class="input-helper">Metric</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="offset-2 col-8">
|
||||
<p class="text-small">Values determine the included traffic. A value of <strong>0</strong> means no traffic is included and charged at the Extra Traffic rates. An empty value means the traffic is not counted in this category.</p>
|
||||
<p class="text-small">Any values charged at extra rates, the rate determines the value charged, and if the value is empty it will roll up to the <strong>Peak</strong> category or <strong>Down Peak</strong> if the Peak category is null.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="offset-2 col-8">
|
||||
<h3 class="text-md">Extra Traffic in $/mb</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Extra Down Peak -->
|
||||
<div class="offset-2 col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="extra_down_peak">Down Peak</label>
|
||||
<input type="number" class="form-control form-control-border @error('extra_down_peak') is-invalid @enderror" id="extra_down_peak" name="extra_down_peak" value="{{ old('extra_down_peak',$o?->extra_down_peak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('extra_down_peak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Extra Down Peak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="extra_up_peak">Up Peak</label>
|
||||
<input type="number" class="form-control form-control-border @error('extra_up_peak') is-invalid @enderror" id="extra_up_peak" name="extra_up_peak" value="{{ old('extra_up_peak',$o?->extra_up_peak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('extra_up_peak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Extra Down Offpeak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="extra_down_offpeak">Down Offpeak</label>
|
||||
<input type="number" class="form-control form-control-border @error('extra_down_offpeak') is-invalid @enderror" id="extra_down_offpeak" name="extra_down_offpeak" value="{{ old('extra_down_offpeak',$o?->extra_down_offpeak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('extra_down_offpeak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Extra Down Offpeak -->
|
||||
<div class="col-2">
|
||||
<div class="form-group has-validation">
|
||||
<label for="extra_up_offpeak">Up Offpeak</label>
|
||||
<input type="number" class="form-control form-control-border @error('extra_up_offpeak') is-invalid @enderror" id="extra_up_offpeak" name="extra_up_offpeak" value="{{ old('extra_up_offpeak',$o?->extra_up_offpeak) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('extra_up_offpeak')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -14,7 +14,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($o->offeringTypes() as $key => $offering)
|
||||
@foreach (\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
||||
<tr>
|
||||
<th>{{ $offering->type }}</th>
|
||||
@if(Arr::get($o->detail->connections,$key))
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<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)
|
||||
@foreach(\App\Models\Cost::where('supplier_id',$o->id)->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>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<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)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) 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>
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<div class="col-7 col-sm-10">
|
||||
<div class="tab-content">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) 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>
|
||||
@@ -33,7 +33,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($xx=$offering->items->with(['types.product.services'])->get() as $oo)
|
||||
@foreach($xx=$offering->items->with(['products.product.services'])->get() as $oo)
|
||||
<tr>
|
||||
<td>{{ $oo->id }}</td>
|
||||
<td>{{ $oo->name }}</td>
|
||||
@@ -41,9 +41,9 @@
|
||||
<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($oo->products->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($oo->products->pluck('product')->filter()->count()) }}</td>
|
||||
<td class="text-right">{{ number_format(($x=$oo->products->pluck('product.services')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($x->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -53,7 +53,7 @@
|
||||
<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=$xx->pluck('products')->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>
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
||||
$('#offering-{{ $key }}-table').DataTable();
|
||||
|
||||
$('#offering-{{ $key }}-table tbody').on('click','tr', function () {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<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)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) 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>
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<div class="col-7 col-sm-10">
|
||||
<div class="tab-content">
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) 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>
|
||||
@@ -34,11 +34,11 @@
|
||||
</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)
|
||||
@foreach($xx=$offering->items->with(['products.product.services','products.product.type.supplied','products.product.description'])->get() as $oo)
|
||||
@foreach($oo->products->pluck('product')->filter() as $po)
|
||||
|
||||
<tr>
|
||||
<td>{{ $po->lid }}</td>
|
||||
<td><a href="{{ url('a/supplier/product/addedit',[$po->supplier->id,$po->supplied->id,$po->supplied->category]) }}">{{ $po->lid }}</a></td>
|
||||
<td>{{ $po->name_short }}</td>
|
||||
<td>{{ $po->name }}</td>
|
||||
<td class="text-right">{{ $po->active ? 'YES' : 'NO' }}</td>
|
||||
@@ -59,7 +59,7 @@
|
||||
<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=$xx->pluck('products')->flatten()->pluck('product.services')->flatten()->filter())->count()) }}</td>
|
||||
<td class="text-right">{{ number_format($xxx->where('active')->count()) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@foreach($o->offeringTypes() as $key => $offering)
|
||||
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
||||
$('#products-{{ $key }}-table').DataTable();
|
||||
|
||||
$('#products-{{ $key }}-table tbody').on('click','tr', function () {
|
||||
|
@@ -44,7 +44,7 @@
|
||||
@endif
|
||||
<tr>
|
||||
<th>Speed</th>
|
||||
<td>{{ $o->supplied()->speed() }} Mbps</td>
|
||||
<td>{{ $o->supplied()->speed }} Mbps</td>
|
||||
</tr>
|
||||
<!-- @todo -->
|
||||
<tr>
|
||||
|
@@ -1,21 +1,21 @@
|
||||
<li class="nav-header">MAIN</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('home') }}" class="nav-link @if(preg_match('#^event/summary#',Route::current()->uri())) active @endif">
|
||||
<a href="{{ url('home') }}" class="nav-link @if(preg_match('#^u/home$#',$path=request()->path())) active @endif">
|
||||
<i class="nav-icon fas fa-home"></i> <p>Home</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- ORDERS -->
|
||||
<li class="nav-item has-treeview @if(preg_match('#^order/#',Route::current()->uri())) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^order/#',Route::current()->uri())) active @endif">
|
||||
<li class="nav-item has-treeview @if(preg_match('#^order#',$path)) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^order#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-cash-register"></i>
|
||||
<p>Orders <i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('order') }}" class="nav-link @if(Route::current()->uri() == 'group/add') active @endif">
|
||||
<a href="{{ url('order') }}" class="nav-link @if(preg_match('#^order$#',$path)) active @endif">
|
||||
<i class="fas fa-tag nav-icon"></i> <p>New Order</p>
|
||||
</a>
|
||||
</li>
|
||||
@@ -24,21 +24,21 @@
|
||||
|
||||
@can('wholesaler')
|
||||
<!-- CHARGES -->
|
||||
<li class="nav-item has-treeview @if(preg_match('#^charge/#',Route::current()->uri())) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^charge/#',Route::current()->uri())) active @endif">
|
||||
<li class="nav-item has-treeview @if(preg_match('#^a/charge/#',$path)) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^a/charge/#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-plus"></i>
|
||||
<p>Charges <i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/charge/addedit') }}" class="nav-link @if(Route::current()->uri() == 'charge/addedit') active @endif">
|
||||
<a href="{{ url('a/charge/addedit') }}" class="nav-link @if(request()->path() == 'a/charge/addedit') active @endif">
|
||||
<i class="fas fa-cart-plus nav-icon"></i> <p>New Charge</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/charge/unprocessed') }}" class="nav-link @if(Route::current()->uri() == 'charge/unprocessed') active @endif">
|
||||
<a href="{{ url('a/charge/unprocessed') }}" class="nav-link @if(request()->path() == 'a/charge/unprocessed') active @endif">
|
||||
<i class="fas fa-list nav-icon"></i> <p>Unprocessed</p>
|
||||
</a>
|
||||
</li>
|
||||
@@ -46,21 +46,21 @@
|
||||
</li>
|
||||
|
||||
<!-- PAYMENTS -->
|
||||
<li class="nav-item has-treeview @if(preg_match('#^payment/#',Route::current()->uri())) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^payment/#',Route::current()->uri())) active @endif">
|
||||
<li class="nav-item has-treeview @if(preg_match('#^a/payment/#',$path)) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^a/payment/#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-receipt"></i>
|
||||
<p>Payments <i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/payment/addedit') }}" class="nav-link @if(Route::current()->uri() == 'payment/addedit') active @endif">
|
||||
<a href="{{ url('a/payment/addedit') }}" class="nav-link @if(preg_match('#^a/payment/addedit#',$path)) active @endif">
|
||||
<i class="fas fa-money-bill nav-icon"></i> <p>New Payment</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/payment/unapplied') }}" class="nav-link @if(Route::current()->uri() == 'payment/unapplied') active @endif">
|
||||
<a href="{{ url('a/payment/unapplied') }}" class="nav-link @if(preg_match('#^a/payment/unapplied$#',$path)) active @endif">
|
||||
<i class="fas fa-receipt nav-icon"></i> <p>Unapplied</p>
|
||||
</a>
|
||||
</li>
|
||||
@@ -72,31 +72,48 @@
|
||||
<li class="nav-header">ADMIN</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/setup') }}" class="nav-link @if(preg_match('#^a/setup#',Route::current()->uri())) active @endif">
|
||||
<a href="{{ url('a/setup') }}" class="nav-link @if(preg_match('#^a/setup#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-cogs"></i> <p>Site Setup</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/product') }}" class="nav-link @if(preg_match('#^a/product]#',Route::current()->uri())) active @endif">
|
||||
<a href="{{ url('a/product') }}" class="nav-link @if(preg_match('#^a/product#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-barcode"></i> <p>Products</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/supplier') }}" class="nav-link @if(preg_match('#^a/supplier#',Route::current()->uri())) active @endif">
|
||||
<i class="nav-icon fas fa-user-tag"></i> <p>Suppliers</p>
|
||||
<!-- SUPPLIERS -->
|
||||
<li class="nav-item has-treeview @if(preg_match('#^a/supplier#',$path)) menu-open @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^a/supplier#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-user-tag"></i>
|
||||
<p>Suppliers <i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/supplier') }}" class="nav-link @if(preg_match('#^a/supplier(/[cost|details]+/[0-9]+)?$#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-cogs"></i> <p>Configuration</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/supplier/product/add') }}" class="nav-link @if(preg_match('#^a/supplier/product/(add|edit)#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-barcode"></i> <p>New Product</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item has-treeview @if(preg_match('#^a/report/(products)#',request()->path()))menu-open @else menu-closed @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^a/report/(products)#',request()->path())) active @endif">
|
||||
|
||||
<li class="nav-item has-treeview @if(preg_match('#^a/report/(products)#',$path))menu-open @else menu-closed @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^a/report/(products)#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-list"></i> <p>REPORT<i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('a/report/products') }}" class="nav-link @if(preg_match('#^a/report/products$#',request()->path()))active @endif">
|
||||
<a href="{{ url('a/report/products') }}" class="nav-link @if(preg_match('#^a/report/products$#',$path))active @endif">
|
||||
<i class="nav-icon fas fa-barcode"></i> <p>Products</p>
|
||||
</a>
|
||||
</li>
|
||||
@@ -107,26 +124,26 @@
|
||||
@can('reseller')
|
||||
<li class="nav-header">RESELLER</li>
|
||||
|
||||
<li class="nav-item has-treeview @if(preg_match('#^r/report/(domain|email|hosting)#',request()->path()))menu-open @else menu-closed @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^r/report/(domain|email|hosting)#',request()->path())) active @endif">
|
||||
<li class="nav-item has-treeview @if(preg_match('#^r/report/(domain|email|hosting)#',$path))menu-open @else menu-closed @endif">
|
||||
<a href="#" class="nav-link @if(preg_match('#^r/report/(domain|email|hosting)#',$path)) active @endif">
|
||||
<i class="nav-icon fas fa-list"></i> <p>REPORT<i class="fas fa-angle-left right"></i></p>
|
||||
</a>
|
||||
|
||||
<ul class="nav nav-treeview">
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('r/report/domain') }}" class="nav-link @if(preg_match('#^r/report/domain#',request()->path()))active @endif">
|
||||
<a href="{{ url('r/report/domain') }}" class="nav-link @if(preg_match('#^r/report/domain$#',$path))active @endif">
|
||||
<i class="nav-icon fas fa-globe-asia"></i> <p>Domain Names</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('r/report/email') }}" class="nav-link @if(preg_match('#^r/report/email#',request()->path()))active @endif">
|
||||
<a href="{{ url('r/report/email') }}" class="nav-link @if(preg_match('#^r/report/email$#',$path))active @endif">
|
||||
<i class="nav-icon fas fa-envelope"></i> <p>Email Hosting</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('r/report/hosting') }}" class="nav-link @if(preg_match('#^r/report/hosting#',request()->path()))active @endif">
|
||||
<a href="{{ url('r/report/hosting') }}" class="nav-link @if(preg_match('#^r/report/hosting$#',$path))active @endif">
|
||||
<i class="nav-icon fas fa-sitemap"></i> <p>Web Hosting</p>
|
||||
</a>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user