ソースを参照

Shipments - show all columns even when one is open

Vijayakrishnan 4 年 前
コミット
674c47e19b

+ 6 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -625,6 +625,12 @@ class PracticeManagementController extends Controller
         if($filters['client']) $shipments->where('client_id', $filters['client']);
         if($filters['courier']) $shipments->where('courier', 'ILIKE', '%' . $filters['courier'] . '%');
         if($filters['tracking_num']) $shipments->where('tracking_number', 'ILIKE', '%' . $filters['tracking_num'] . '%');
+        if($filters['label']) {
+            if($filters['label'] === 'yes')
+                $shipments->whereNotNull('label_system_file_id');
+            else
+                $shipments->whereNull('label_system_file_id');
+        }
         if($filters['status']) $shipments->where('status', $filters['status']);
         if($filters['cancelled']) $shipments->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
 

+ 16 - 20
resources/views/app/patient/shipments.blade.php

@@ -82,12 +82,10 @@
                     <tr class="bg-light">
                         <th class="px-2 text-nowrap text-secondary border-bottom-0">Created At</th>
                         <th class="px-2 text-nowrap text-secondary border-bottom-0">Supply Orders</th>
-                        @if(!$shipment)
-                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Label File</th>
-                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Courier</th>
-                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Tracking #</th>
-                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Status</th>
-                        @endif
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0">Label File</th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0">Courier</th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0">Tracking #</th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0">Status</th>
                     </tr>
                     </thead>
                     <tbody>
@@ -99,20 +97,18 @@
                                 </a>
                             </td>
                             <td class="px-2">{{count($iShipment->supplyOrders)}}</td>
-                            @if(!$shipment)
-                                <td class="px-2">
-                                    @if($iShipment->label_system_file_id)
-                                        <a class="pdf-viewer-trigger" native="" target="_blank"
-                                           href="/api/shipment/downloadLabel/{{$iShipment->uid}}" title="View">
-                                            <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
-                                            View
-                                        </a>
-                                    @endif
-                                </td>
-                                <td class="px-2">{{ $iShipment->courier }}</td>
-                                <td class="px-2">{{ $iShipment->tracking_number }}</td>
-                                <td class="px-2">{{ $iShipment->status }}</td>
-                            @endif
+                            <td class="px-2">
+                                @if($iShipment->label_system_file_id)
+                                    <a class="pdf-viewer-trigger" native="" target="_blank"
+                                       href="/api/shipment/downloadLabel/{{$iShipment->uid}}" title="View">
+                                        <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
+                                        View
+                                    </a>
+                                @endif
+                            </td>
+                            <td class="px-2">{{ $iShipment->courier }}</td>
+                            <td class="px-2">{{ $iShipment->tracking_number }}</td>
+                            <td class="px-2">{{ $iShipment->status }}</td>
                         </tr>
                     @endforeach
                     </tbody>