2021-12-24 01:14:01 +00:00
|
|
|
<!-- $o = Supplier::class -->
|
|
|
|
<div class="row">
|
2022-02-01 05:40:46 +00:00
|
|
|
<div class="col-5 col-sm-2">
|
2021-12-24 01:14:01 +00:00
|
|
|
<div class="nav flex-column nav-tabs h-100" role="tablist" aria-orientation="vertical">
|
2022-06-30 13:51:20 +00:00
|
|
|
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
2021-12-24 01:14:01 +00:00
|
|
|
<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>
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
<div class="col-7 col-sm-10">
|
2021-12-24 01:14:01 +00:00
|
|
|
<div class="tab-content">
|
2022-06-30 13:51:20 +00:00
|
|
|
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
2021-12-24 01:14:01 +00:00
|
|
|
<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>
|
2023-03-15 04:34:28 +00:00
|
|
|
@foreach($xx=$offering->items->with(['products.products.services'])->get() as $oo)
|
2021-12-24 01:14:01 +00:00
|
|
|
<tr>
|
|
|
|
<td>{{ $oo->id }}</td>
|
2023-03-15 04:34:28 +00:00
|
|
|
<td>{{ $oo->name }}</td>
|
|
|
|
<td>{{ $oo->name_long }}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<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>
|
2022-06-30 13:51:20 +00:00
|
|
|
<td class="text-right">{{ number_format($oo->products->count()) }}</td>
|
2023-03-15 04:34:28 +00:00
|
|
|
<td class="text-right">{{ number_format($oo->products->pluck('products')->filter()->count()) }}</td>
|
|
|
|
<td class="text-right">{{ number_format(($x=$oo->products->pluck('products')->flatten()->pluck('services')->flatten()->filter())->count()) }}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<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>
|
2022-06-30 13:51:20 +00:00
|
|
|
<td class="text-right">{{ number_format(($x=$xx->pluck('products')->flatten()->filter())->count()) }}</td>
|
2023-03-15 04:34:28 +00:00
|
|
|
<td class="text-right">{{ number_format($x->pluck('products')->filter()->count()) }}</td>
|
|
|
|
<td class="text-right">{{ number_format(($xxx=$x->pluck('products')->flatten()->pluck('services')->flatten()->filter())->count()) }}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<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() {
|
2022-06-30 13:51:20 +00:00
|
|
|
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
|
2021-12-24 01:14:01 +00:00
|
|
|
$('#offering-{{ $key }}-table').DataTable();
|
|
|
|
|
|
|
|
$('#offering-{{ $key }}-table tbody').on('click','tr', function () {
|
|
|
|
$(this).toggleClass('selected');
|
|
|
|
});
|
|
|
|
@endforeach
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|