Forráskód Böngészése

Page - bills-under-processing

Vijayakrishnan 3 éve
szülő
commit
a38bd2cefe

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

@@ -1771,4 +1771,48 @@ ORDER BY claim.created_at DESC
         return view('app.practice-management.generic-bills');
     }
 
+    public function billsUnderProcessing(Request $request)
+    {
+
+        $bills = Bill::where('is_cancelled', false)
+            ->where(function ($query) {   // mcp of any client program and program OB pending
+                $query
+                    ->where(function ($_query) {
+                        $_query->where('hcp_pro_id', $this->pro->id)
+                            ->where('hcp_expected_payment_amount', '>', 0)
+                            ->where('has_hcp_been_paid', false)
+                            ->where('is_signed_by_hcp', true);
+                    })
+                    ->orWhere(function ($_query) {
+                        $_query->where('cm_pro_id', $this->pro->id)
+                            ->where('cm_expected_payment_amount', '>', 0)
+                            ->where('has_cm_been_paid', false)
+                            ->where('is_signed_by_cm', true);
+                    })
+                    ->orWhere(function ($_query) {
+                        $_query->where('rme_pro_id', $this->pro->id)
+                            ->where('rme_expected_payment_amount', '>', 0)
+                            ->where('has_rme_been_paid', false)
+                            ->where('is_signed_by_rme', true);
+                    })
+                    ->orWhere(function ($_query) {
+                        $_query->where('rmm_pro_id', $this->pro->id)
+                            ->where('rmm_expected_payment_amount', '>', 0)
+                            ->where('has_rmm_been_paid', false)
+                            ->where('is_signed_by_rmm', true);
+                    })
+                    ->orWhere(function ($_query) {
+                        $_query->where('generic_pro_id', $this->pro->id)
+                            ->where('generic_pro_expected_payment_amount', '>', 0)
+                            ->where('has_generic_pro_been_paid', false)
+                            ->where('is_signed_by_generic_pro', true);
+                    });
+            })
+            ->orderBy('created_at', 'DESC')
+            ->paginate();
+
+        return view('app.practice-management.bills-under-processing', compact('bills'));
+
+    }
+
 }

+ 1 - 1
resources/views/app/dashboard.blade.php

@@ -154,7 +154,7 @@
                                 </tr> -->
                                 <tr>
                                     <th class="px-2">${{friendly_money($reimbursement['nextPaymentAmount'])}}</th>
-                                    <th class="pl-2">Processing</th>
+                                    <th class="pl-2"><a href="/practice-management/bills-under-processing">Processing</a></th>
                                 </tr>
                                 {{--
                                 <tr>

+ 96 - 0
resources/views/app/practice-management/bills-under-processing.blade.php

@@ -0,0 +1,96 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1" id="processing-bill-matrix">
+
+        <div class="card">
+
+            <div class="card-header px-3 py-2">
+                <div class="font-weight-bold text-nowrap mb-2">
+                    <i class="fas fa-user-injured"></i>
+                    Bills Under Processing
+                </div>
+            </div>
+            <div class="card-body p-0">
+                <table class="table table-sm table-condensed table-hover p-0 m-0">
+                    <thead class="bg-light">
+                    <tr>
+                        <th class="border-bottom-0 border-top-0 pl-3">Context</th>
+                        <th class="border-bottom-0 border-top-0">Effective Date</th>
+                        <th class="border-bottom-0 border-top-0">Role</th>
+                        <th class="border-bottom-0 border-top-0">Client</th>
+                        <th class="border-bottom-0 border-top-0">Code</th>
+                        <th class="border-bottom-0 border-top-0">Units</th>
+                        <th class="border-bottom-0 border-top-0">Verified?</th>
+                        <th class="border-bottom-0 border-top-0">Expected Amount</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach ($bills as $row)
+                        <?php
+                        $role = '';
+                        $amount = 0;
+                        if($row->hcp_pro_id === $pro->id) {
+                            $role = 'HCP';
+                            $amount = $row->hcp_expected_payment_amount;
+                        }
+                        elseif($row->cm_pro_id === $pro->id) {
+                            $role = 'CM';
+                            $amount = $row->cm_expected_payment_amount;
+                        }
+                        elseif($row->rme_pro_id === $pro->id) {
+                            $role = 'RME';
+                            $amount = $row->rme_expected_payment_amount;
+                        }
+                        elseif($row->rmm_pro_id === $pro->id) {
+                            $role = 'RMM';
+                            $amount = $row->rmm_expected_payment_amount;
+                        }
+                        elseif($row->generic_pro_id === $pro->id) {
+                            $role = 'GENERIC';
+                            $amount = $row->generic_pro_expected_payment_amount;
+                        }
+                        ?>
+                        <tr>
+                            <td class="pl-3">
+                                @if($row->note)
+                                    <a href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->note->uid }}">
+                                        Note Link
+                                    </a>
+                                @elseif($row->client)
+                                    <a href="/patients/view/{{ $row->client->uid }}">
+                                        Chart
+                                    </a>
+                                @else
+                                    Generic
+                                @endif
+                            </td>
+                            <td>{{friendly_date($row->effective_date)}}</td>
+                            <td>{{$role}}</td>
+                            <td>
+                                @if($row->client)
+                                    {{$row->client->name_last}}, {{$row->client->name_first}}
+                                @endif
+                            </td>
+                            <td>{{$row->code}}
+                                @if($row->generic_target_entity_type && $row->generic_target_entity_uid)
+                                    <div class="mt-1 text-sm text-secondary font-weight-bold">{{$row->generic_target_entity_type}}</div>
+                                @endif
+                            </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 ? 'Yes<br>' . friendly_date($row->marked_verified_at, true) : 'No' !!} </td>
+                            <td>
+                                {{number_format($amount, 2)}}
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+        <div class="mt-3">
+            {{$bills->withQueryString()->links()}}
+        </div>
+    </div>
+@endsection

+ 1 - 0
routes/web.php

@@ -76,6 +76,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('dashboard', 'PracticeManagementController@dashboard')->name('dashboard');
         Route::get('previous-bills', 'PracticeManagementController@previousBills')->name('previousBills');
         Route::get('financial-transactions', 'PracticeManagementController@financialTransactions')->name('financialTransactions');
+        Route::get('bills-under-processing', 'PracticeManagementController@billsUnderProcessing')->name('bills-under-processing');
         Route::get('pending-bills-to-sign', 'PracticeManagementController@pendingBillsToSign')->name('pendingBillsToSign');
         Route::get('hr', 'PracticeManagementController@hr')->name('hr');
         Route::get('direct-deposit-settings', 'PracticeManagementController@directDepositSettings')->name('directDepositSettings');