소스 검색

Unack'd cancelled SOs - dashboard stat + list page

Vijayakrishnan 4 년 전
부모
커밋
2809a3c143

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

@@ -257,6 +257,12 @@ class HomeController extends Controller
             ->where('is_cancellation_acknowledged', false)
             ->where('is_cancellation_acknowledged', false)
             ->count();
             ->count();
 
 
+        // unacknowledged cancelled supply orders for authed pro
+        $keyNumbers['unacknowledgedCancelledSupplyOrders'] = SupplyOrder::where('signed_by_pro_id', $performerProID)
+            ->where('is_cancelled', true)
+            ->where('is_cancellation_acknowledged', false)
+            ->count();
+
         // patientsHavingBirthdayToday
         // patientsHavingBirthdayToday
         $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
         $queryClients = $this->performer()->pro->getAccessibleClientsQuery();
         $keyNumbers['patientsHavingBirthdayToday'] = $queryClients
         $keyNumbers['patientsHavingBirthdayToday'] = $queryClients

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

@@ -819,6 +819,15 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.supply-orders-hanging', compact('supplyOrders', 'counts'));
         return view('app.practice-management.supply-orders-hanging', compact('supplyOrders', 'counts'));
     }
     }
 
 
+    public function supplyOrdersCancelledButUnacknowledged(Request $request)
+    {
+        $supplyOrders = SupplyOrder::where('signed_by_pro_id', $this->performer()->pro->id)
+            ->where('is_cancelled', true)
+            ->where('is_cancellation_acknowledged', false)
+            ->paginate();
+        return view('app.practice-management.supply-orders-cancelled-but-unacknowledged', compact('supplyOrders'));
+    }
+
     private function getSupplyOrderCounts()
     private function getSupplyOrderCounts()
     {
     {
         return [
         return [

+ 6 - 0
resources/views/app/dashboard.blade.php

@@ -51,6 +51,12 @@
                                         <a href="/practice-management/unacknowledged-cancelled-bills">Unacknowledged Cancelled Bills</a>
                                         <a href="/practice-management/unacknowledged-cancelled-bills">Unacknowledged Cancelled Bills</a>
                                     </th>
                                     </th>
                                 </tr>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$keyNumbers['unacknowledgedCancelledSupplyOrders']}}</th>
+                                    <th class="pl-2">
+                                        <a href="/practice-management/supply-orders/cancelled-but-unacknowledged">Unacknowledged Cancelled Supply Orders</a>
+                                    </th>
+                                </tr>
                                 <tr>
                                 <tr>
                                     <th class="px-2 text-center">{{$keyNumbers['patientsHavingBirthdayToday']}}</th>
                                     <th class="px-2 text-center">{{$keyNumbers['patientsHavingBirthdayToday']}}</th>
                                     <th class="pl-2">
                                     <th class="pl-2">

+ 49 - 0
resources/views/app/practice-management/supply-orders-cancelled-but-unacknowledged.blade.php

@@ -0,0 +1,49 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div id="practice-supply-orders" class="p-3 mcp-theme-1">
+        <div class="card">
+
+            <div class="card-header px-3 py-3 d-flex align-items-center bg-white">
+                <strong class="font-size-14">
+                    Supply Orders - Cancelled but unacknowledged
+                </strong>
+            </div>
+            <div class="card-body p-0">
+                <table class="table table-sm table-condensed p-0 m-0" style="table-layout: fixed">
+                    <thead class="bg-light">
+                    <tr>
+                        <th class="border-0">Patient</th>
+                        <th class="border-0">Address</th>
+                        <th class="border-0">Item(s)</th>
+                        <th class="border-0">Shipment</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach ($supplyOrders as $supplyOrder)
+                        <tr data-client-uid="{{$supplyOrder->client->uid}}">
+                            <td class="align-top border-top">
+                                <a href="{{route('patients.view.supply-orders',['patient'=>$supplyOrder->client, 'supplyOrder'=>$supplyOrder, 'filter' => 'all'])}}"> {{$supplyOrder->client->displayName()}}</a>
+                            </td>
+                            <td class="align-top border-top">
+                                {!! $supplyOrder->mailing_address_full ? implode(" ", [$supplyOrder->mailing_address_line1 . ' ' . $supplyOrder->mailing_address_line2, $supplyOrder->mailing_address_city . ' ' . $supplyOrder->mailing_address_state . ' ' . $supplyOrder->mailing_address_zip]) : '-'  !!}
+                            </td>
+                            <td class="align-top border-top">
+                                {{$supplyOrder->product->title}}
+                            </td>
+                            <td class="align-top border-top">
+                                <b>CANCELLED</b>
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+                <div>
+                    {{$supplyOrders->links()}}
+                </div>
+            </div>
+        </div>
+    </div>
+
+@endsection

+ 2 - 0
routes/web.php

@@ -132,6 +132,8 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('packs-multi-print', 'PracticeManagementController@packsMultiPrint')->name('packs-multi-print');
             Route::get('packs-multi-print', 'PracticeManagementController@packsMultiPrint')->name('packs-multi-print');
             Route::get('packs-multi-pdf/{ids?}', 'PracticeManagementController@packsMultiPDF')->name('packs-multi-pdf');
             Route::get('packs-multi-pdf/{ids?}', 'PracticeManagementController@packsMultiPDF')->name('packs-multi-pdf');
         });
         });
+
+        Route::get('supply-orders/cancelled-but-unacknowledged', 'PracticeManagementController@supplyOrdersCancelledButUnacknowledged')->name('supply-orders-cancelled-but-unacknowledged');
     });
     });
 
 
     Route::middleware('pro.auth.admin')->group(function(){
     Route::middleware('pro.auth.admin')->group(function(){