Sfoglia il codice sorgente

Processing bills matrix - bal post date - start/end filter

Vijayakrishnan 3 anni fa
parent
commit
b8f4c26b52

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

@@ -578,6 +578,16 @@ class PracticeManagementController extends Controller
                 break;
         }
 
+        $filter = $request->input('bs');
+        if ($filter) {
+            $bills = $bills->where('balance_post_date', '>=', $filter);
+        }
+
+        $filter = $request->input('be');
+        if ($filter) {
+            $bills = $bills->where('balance_post_date', '<=', $filter);
+        }
+
         $bills = $bills->orderBy('effective_date', 'desc')->paginate();
 
         $viewData = [

+ 24 - 6
resources/views/app/practice-management/processing-bill-matrix.blade.php

@@ -15,7 +15,7 @@
                 <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')}}&t={{request()->input('t')}}')">
+                            onchange="fastLoad('/practice-management/processing-bill-matrix/' + this.value + '?f={{request()->input('f')}}&t={{request()->input('t')}}&bs={{request()->input('bs')}}&be={{request()->input('be')}}')">
                         <option value="" {{!@$targetPro ? 'selected' : ''}}>All Pros</option>
                     </select>
                 </div>
@@ -24,7 +24,7 @@
                 @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 + '&t={{request()->input('t')}}')">
+                            onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f=' + this.value + '&t={{request()->input('t')}}&bs={{request()->input('bs')}}&be={{request()->input('be')}}')">
                         <option {{request()->input('f') === '' ? 'selected' : ''}} value="">All Bills</option>
                         <option {{request()->input('f') === 'verified' ? 'selected' : ''}} value="verified">Verified
                             Only
@@ -36,20 +36,32 @@
                 </div>
                 <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={{request()->input('f')}}&t=' + this.value)">
+                            onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f={{request()->input('f')}}&bs={{request()->input('bs')}}&be={{request()->input('be')}}&t=' + this.value)">
                         <option {{!request()->input('t') || request()->input('t') === 'hcp' ? 'selected' : ''}} value="hcp">
                             HCP Bills
                         </option>
                         <option {{request()->input('t') === 'na' ? 'selected' : ''}} value="na">NA Bills</option>
                     </select>
                 </div>
+                <div class="ml-auto d-inline-flex align-items-center">
+                    <b class="mr-2">Bal Post Date</b>
+                    <input type="date"
+                           value="{{request()->input('bs')}}"
+                           onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f={{request()->input('f')}}&t={{request()->input('t')}}&be={{request()->input('be')}}&bs=' + this.value)"
+                           class="form-control form-control-sm width-150px" name="bpdFrom">
+                    <span class="mx-2">to</span>
+                    <input type="date"
+                           value="{{request()->input('be')}}"
+                           onchange="fastLoad('/practice-management/processing-bill-matrix/{{@$targetPro ? $targetPro->uid : ''}}?f={{request()->input('f')}}&t={{request()->input('t')}}&bs={{request()->input('bs')}}&be=' + this.value)"
+                           class="form-control form-control-sm width-150px" name="bpdTo">
+                </div>
             </div>
             <div class="card-body p-0">
                 <table class="table table-sm table-condensed p-0 m-0">
                     <thead class="bg-light">
                     <tr>
                         <th><input type="checkbox"/> All</th>
-                        <th>Note Link</th>
+                        <th>Context</th>
                         <td>Effective Date</td>
                         <td>Balance Post Date</td>
                         @if(!request()->input('t') || request()->input('t') === 'hcp')
@@ -80,10 +92,12 @@
                                     <a href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->note->uid }}">
                                         Note Link
                                     </a>
-                                @else
+                                @elseif($row->client)
                                     <a href="/patients/view/{{ $row->client->uid }}">
                                         Chart
                                     </a>
+                                @else
+                                    Generic
                                 @endif
                             </td>
                             <td>{{friendly_date($row->effective_date)}}</td>
@@ -93,7 +107,11 @@
                             @elseif(request()->input('t') === 'na')
                                 <td>{{$row->genericPro->name_last}}, {{$row->genericPro->name_first}}</td>
                             @endif
-                            <td>{{$row->client->name_last}}, {{$row->client->name_first}}</td>
+                            <td>
+                                @if($row->client)
+                                    {{$row->client->name_last}}, {{$row->client->name_first}}
+                                @endif
+                            </td>
                             <td>{{$row->code}}</td>
                             <td>{{str_contains($row->code, 'Treatment Services') || str_contains($row->code, 'Administrative Services') ? ceil((float) $row->number_of_units * 60) . ' mins' : $row->number_of_units}}</td>
                             <td>{{$row->is_verified ? 'Verified: ' . friendly_date($row->marked_verified_at, true) : 'Not Verified'}} </td>