소스 검색

Processing-bill-matrix - new filter "Verification Status" (All, Verified, Unverified)

Vijayakrishnan 3 년 전
부모
커밋
1da8a5c777
3개의 변경된 파일43개의 추가작업 그리고 26개의 파일을 삭제
  1. 20 15
      app/Http/Controllers/PracticeManagementController.php
  2. 22 10
      resources/views/app/practice-management/processing-bill-matrix.blade.php
  3. 1 1
      routes/web.php

+ 20 - 15
app/Http/Controllers/PracticeManagementController.php

@@ -513,30 +513,35 @@ class PracticeManagementController extends Controller
         $proUid = $proUid ? $proUid : $request->get('pro-uid');
         $performerPro = $this->performer->pro;
         $targetPro = null;
-        $allPros = [];
         if ($performerPro->pro_type == 'ADMIN') {
-            $allPros = Pro::all();
             $targetPro = Pro::where('uid', $proUid)->first();
         } else {
             $targetPro = $performerPro;
         }
-        $bills = [];
+
+        $bills = Bill
+            ::where('has_hcp_been_paid', false)
+            ->where('is_cancelled', false)
+            ->where('is_signed_by_hcp', true);
+
         if ($targetPro) {
-            $bills = Bill::where('hcp_pro_id', $targetPro->id)->
-            where('has_hcp_been_paid', false)->
-            where('is_cancelled', false)->
-            where('is_signed_by_hcp', true)->
-            orderBy('effective_date', 'desc')->paginate();
-        } else {
-            $bills = Bill::where('has_hcp_been_paid', false)->
-            where('is_cancelled', false)->
-            where('is_signed_by_hcp', true)->
-            orderBy('effective_date', 'desc')->
-            paginate();
+            $bills = $bills->where('hcp_pro_id', $targetPro->id);
+        }
+
+        $filter = $request->input('f');
+        switch ($filter) {
+            case 'verified':
+                $bills = $bills->where('is_verified', true);
+                break;
+            case 'not-verified':
+                $bills = $bills->where('is_verified', false);
+                break;
         }
+
+        $bills = $bills->orderBy('effective_date', 'desc')->paginate();
+
         $viewData = [
             'bills' => $bills,
-            'allPros' => $allPros,
             'targetPro' => $targetPro,
             'performerPro' => $performerPro,
             'proUid' => $proUid

+ 22 - 10
resources/views/app/practice-management/processing-bill-matrix.blade.php

@@ -7,17 +7,29 @@
         <div class="card">
 
             <div class="card-header px-3 py-2 d-flex align-items-center">
-                <strong class="mr-4">
+                <strong class="text-nowrap">
                     <i class="fas fa-user-injured"></i>
                     Processing Bills
                 </strong>
-                <select class="ml-auto max-width-300px form-control form-control-sm"
-                        onchange="fastLoad('/practice-management/processing-bill-matrix/' + this.value, true, false, false)">
-                    <option value="" {{ $proUid === '' ? 'selected' : '' }}>All Pros</option>
-                    @foreach($allPros as $_pro)
-                        <option value="{{$_pro->uid}}" {{ $proUid === $_pro->uid ? 'selected' : '' }}>{{$_pro->displayName()}}</option>
-                    @endforeach
-                </select>
+                <span class="mx-2">for</span>
+                <div class="width-200px">
+                    <select provider-search data-pro-uid="{{ @$targetPro->uid }}"
+                            name="proUid" class="form-control form-control-sm mr-auto width-200px"
+                            onchange="fastLoad('/practice-management/processing-bill-matrix/' + this.value + '?f={{request()->input('f')}}')">
+                        <option value="" {{!@$targetPro ? 'selected' : ''}}>All Pros</option>
+                    </select>
+                </div>
+                @if(@$targetPro)
+                    <a href="/practice-management/processing-bill-matrix" class="ml-2">Clear Filter</a>
+                @endif
+                <div class="width-200px ml-2">
+                    <select name="filter" class="form-control form-control-sm mr-auto width-200px"
+                            onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f=' + this.value)">
+                        <option {{request()->input('f') === '' ? 'selected' : ''}} value="">All Bills</option>
+                        <option {{request()->input('f') === 'verified' ? 'selected' : ''}} value="verified">Verified Only</option>
+                        <option {{request()->input('f') === 'not-verified' ? 'selected' : ''}} value="not-verified">Not Verified Only</option>
+                    </select>
+                </div>
             </div>
             <div class="card-body p-0">
                 <table class="table table-sm table-condensed p-0 m-0">
@@ -70,8 +82,8 @@
                 </table>
             </div>
         </div>
-        <div>
-            {{$bills->links()}}
+        <div class="mt-3">
+            {{$bills->withQueryString()->links()}}
         </div>
     </div>
 

+ 1 - 1
routes/web.php

@@ -112,7 +112,7 @@ Route::middleware('pro.auth')->group(function () {
 
             Route::get('cellular-measurements', 'PracticeManagementController@cellularMeasurements')->name('cellularMeasurements');
 
-            Route::get('processing-bill-matrix/{proUid?}', 'PracticeManagementController@processingBillMatrix')->name('processingBillMatrix');
+            Route::get('processing-bill-matrix/{proUid?}/{filter?}', 'PracticeManagementController@processingBillMatrix')->name('processingBillMatrix');
 
             //Route::get('hcp-bill-matrix/{proUid?}', 'PracticeManagementController@hcpBillMatrix')->name('hcpBillMatrix');
             Route::get('bill-matrix/{proUid?}', 'PracticeManagementController@billMatrix')->name('billMatrix');