|
@@ -0,0 +1,176 @@
|
|
|
|
+@extends ('layouts/template')
|
|
|
|
+
|
|
|
|
+@section('content')
|
|
|
|
+
|
|
|
|
+ <div id="practice-shipments" class="p-3 mcp-theme-1">
|
|
|
|
+ <div class="card">
|
|
|
|
+
|
|
|
|
+ <div class="card-header px-3 py-2 d-flex align-items-center">
|
|
|
|
+ <strong class="mr-4">
|
|
|
|
+ <i class="fas fa-user-injured"></i>
|
|
|
|
+ Shipments
|
|
|
|
+ </strong>
|
|
|
|
+ <a href="/practice-management/shipments" class="ml-auto">Clear Filters</a>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="card-body p-0">
|
|
|
|
+ <table class="table table-sm table-condensed p-0 m-0">
|
|
|
|
+ <thead class="bg-light">
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="border-0">Client</th>
|
|
|
|
+ <th class="border-0 w-25">Supply Orders</th>
|
|
|
|
+ <th class="border-0">Courier</th>
|
|
|
|
+ <th class="border-0">Tracking #</th>
|
|
|
|
+ <th class="border-0">Label File</th>
|
|
|
|
+ <th class="border-0">Status</th>
|
|
|
|
+ <th class="border-0">Created At</th>
|
|
|
|
+ <th class="border-0">Cancelled?</th>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right">
|
|
|
|
+ <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
|
|
|
|
+ data-filter="client">
|
|
|
|
+ <option value="">All</option>
|
|
|
|
+ @foreach($shClients as $shClient)
|
|
|
|
+ <option value="{{$shClient->id}}"
|
|
|
|
+ {{$filters['client'] == $shClient->id ? 'selected' : ''}}>{{$shClient->displayName()}}</option>
|
|
|
|
+ @endforeach
|
|
|
|
+ </select>
|
|
|
|
+ </th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right"></th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right">
|
|
|
|
+ <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
|
|
|
|
+ data-filter="courier"
|
|
|
|
+ value="{{$filters['courier']}}" placeholder="Any">
|
|
|
|
+ </th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right">
|
|
|
|
+ <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
|
|
|
|
+ data-filter="tracking_num"
|
|
|
|
+ value="{{$filters['tracking_num']}}" placeholder="Any">
|
|
|
|
+ </th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right"></th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right">
|
|
|
|
+ <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
|
|
|
|
+ data-filter="status">
|
|
|
|
+ <option value="">All</option>
|
|
|
|
+ <option {{$filters['status'] == 'CREATED' ? 'selected' : ''}} value="CREATED">Created</option>
|
|
|
|
+ <option {{$filters['status'] == 'SHIPPED' ? 'selected' : ''}} value="SHIPPED">Shipped</option>
|
|
|
|
+ <option {{$filters['status'] == 'DELIVERED' ? 'selected' : ''}} value="DELIVERED">Delivered</option>
|
|
|
|
+ <option {{$filters['status'] == 'RETURNED_TO_SENDER' ? 'selected' : ''}} value="RETURNED_TO_SENDER">Returned to Sender</option>
|
|
|
|
+ <option {{$filters['status'] == 'CANCELLED' ? 'selected' : ''}} value="CANCELLED">Cancelled</option>
|
|
|
|
+ </select>
|
|
|
|
+ </th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right"></th>
|
|
|
|
+ <th class="p-0 border-bottom-0 border-right">
|
|
|
|
+ <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
|
|
|
|
+ data-filter="cancelled">
|
|
|
|
+ <option value="">All</option>
|
|
|
|
+ <option {{$filters['cancelled'] == 'not_cancelled' ? 'selected' : ''}} value="not_cancelled">Not Cancelled</option>
|
|
|
|
+ <option {{$filters['cancelled'] == 'cancelled' ? 'selected' : ''}} value="cancelled">Cancelled</option>
|
|
|
|
+ </select>
|
|
|
|
+ </th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody>
|
|
|
|
+ @foreach ($shipments as $shipment)
|
|
|
|
+ <tr class="{{$shipment->is_cancelled ? 'bg-light' : ''}}">
|
|
|
|
+ <td>{{$shipment->client->displayName()}}</a></td>
|
|
|
|
+ <td>
|
|
|
|
+ @if($shipment->supplyOrders && count($shipment->supplyOrders))
|
|
|
|
+ <table class="table table-sm table-striped table-bordered mb-0 bg-white">
|
|
|
|
+ <thead>
|
|
|
|
+ <tr class="">
|
|
|
|
+ <th class="text-nowrap text-secondary border-bottom-0">Supply Order</th>
|
|
|
|
+ <th class="text-nowrap text-secondary border-bottom-0">IMEI</th>
|
|
|
|
+ <th class="text-nowrap text-secondary border-bottom-0">Lot #</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody>
|
|
|
|
+ @foreach($shipment->supplyOrders as $iSupplyOrder)
|
|
|
|
+ <tr class="">
|
|
|
|
+ <td class="">{{ $iSupplyOrder->product->title }}</td>
|
|
|
|
+ <td class="">{{ $iSupplyOrder->imei }}</td>
|
|
|
|
+ <td class="">{{ $iSupplyOrder->lot_number }}</td>
|
|
|
|
+ </tr>
|
|
|
|
+ @endforeach
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ @else
|
|
|
|
+ None
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>{{$shipment->courier}}</td>
|
|
|
|
+ <td>{{$shipment->tracking_number}}</td>
|
|
|
|
+ <td>
|
|
|
|
+ @if($shipment->label_system_file_id)
|
|
|
|
+ <a class="pdf-viewer-trigger" native="" target="_blank"
|
|
|
|
+ href="/api/shipment/downloadLabel/{{$shipment->uid}}" title="View">
|
|
|
|
+ <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
|
|
|
|
+ View
|
|
|
|
+ </a>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ {{$shipment->status}}
|
|
|
|
+ @if($shipment->status === 'DELIVERED' && $shipment->delivered_date)
|
|
|
|
+ <div class="text-secondary text-sm mt-1">
|
|
|
|
+ on {{friendlier_date_time($shipment->delivered_date)}}
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ {{friendlier_date_time($shipment->created_at)}}
|
|
|
|
+ <div class="text-secondary text-sm mt-1">
|
|
|
|
+ By {{$shipment->createdSession->pro->displayName()}}
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ <td>{!! $shipment->is_cancelled ? '<b class="text-warning-mellow">Yes</b>' : 'No' !!}</td>
|
|
|
|
+ </tr>
|
|
|
|
+ @endforeach
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ <div>
|
|
|
|
+ {{$shipments->links()}}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <script>
|
|
|
|
+ (function() {
|
|
|
|
+
|
|
|
|
+ function applyFilters() {
|
|
|
|
+ let params = {}, queryLine = [];
|
|
|
|
+ $('[data-filter]').each(function() {
|
|
|
|
+ if($.trim($(this).val())) {
|
|
|
|
+ params[$(this).attr('data-filter')] = $.trim($(this).val());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ for(let x in params) {
|
|
|
|
+ if(params.hasOwnProperty(x)) {
|
|
|
|
+ queryLine.push(x + '=' + encodeURIComponent(params[x]));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ queryLine = queryLine.join('&');
|
|
|
|
+
|
|
|
|
+ fastLoad('/practice-management/shipments?' + queryLine);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function init() {
|
|
|
|
+ $('select[data-filter]')
|
|
|
|
+ .off('change')
|
|
|
|
+ .on('change', applyFilters);
|
|
|
|
+ $('input[data-filter]')
|
|
|
|
+ .off('keyup')
|
|
|
|
+ .on('keyup', function(_event) {
|
|
|
|
+ if(_event.which === 13) {
|
|
|
|
+ applyFilters();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ addMCInitializer('practice-shipments', init, '#practice-shipments')
|
|
|
|
+
|
|
|
|
+ }).call(window);
|
|
|
|
+ </script>
|
|
|
|
+@endsection
|