Prechádzať zdrojové kódy

Patient > supply orders - show cancelled too

Vijayakrishnan 4 rokov pred
rodič
commit
8d00d7e12b

+ 0 - 1
app/Models/Client.php

@@ -448,7 +448,6 @@ class Client extends Model
     public function supplyOrders()
     {
         return $this->hasMany(SupplyOrder::class, 'client_id', 'id')
-            ->where('is_cancelled', false)
             ->orderBy('created_at', 'desc');
     }
 

+ 4 - 1
resources/views/app/patient/supply-orders.blade.php

@@ -69,11 +69,14 @@
                         </thead>
                         <tbody>
                         @foreach($patient->supplyOrders as $iSupplyOrder)
-                            <tr class="{{@$supplyOrder && @$supplyOrder->uid === $iSupplyOrder->uid ? 'bg-aliceblue' : ''}}">
+                            <tr class="{{@$supplyOrder && @$supplyOrder->uid === $iSupplyOrder->uid ? 'bg-aliceblue' : ''}} {{$iSupplyOrder->is_cancelled ? 'on-hover-opaque' : ''}}">
                                 <td class="px-2">
                                     <a href="{{route('patients.view.supply-orders', ['patient' => $patient, 'supplyOrder' => $iSupplyOrder])}}">
                                         {{ $iSupplyOrder->product->title }}
                                     </a>
+                                    @if($iSupplyOrder->is_cancelled)
+                                        <div class="font-weight-bold text-sm text-secondary"><i class="fa fa-ban"></i> CANCELLED</div>
+                                    @endif
                                 </td>
                                 <td class="px-2">{{ $iSupplyOrder->reason }}</td>
                                 <td class="px-2">{{ friendlier_date_time($iSupplyOrder->created_at) }}</td>