Explorar o código

Dashboard key numbers + matrix for unacknowledged-cancelled-bills

Vijayakrishnan %!s(int64=4) %!d(string=hai) anos
pai
achega
e506dd2b61

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

@@ -250,6 +250,12 @@ class HomeController extends Controller
         // num measurements that need stamping
         $keyNumbers['measurementsToBeStamped'] = ($this->performer()->pro->pro_type === 'ADMIN' ? '-' : count($this->performer()->pro->getMeasurements(true)));
 
+        // unacknowledged cancelled bills for authed pro
+        $keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
+            ->where('is_cancelled', true)
+            ->where('is_cancellation_acknowledged', false)
+            ->count();
+
         $reimbursement = [];
         $reimbursement["currentBalance"] =  $performer->pro->balance;
         $reimbursement["nextPaymentDate"] = '--';

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

@@ -150,6 +150,16 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.bills', compact('bills', 'filter'));
     }
 
+    public function unacknowledgedCancelledBills(Request $request)
+    {
+        $bills = Bill::where('hcp_pro_id', $this->performer()->pro->id)
+            ->where('is_cancelled', true)
+            ->where('is_cancellation_acknowledged', false)
+            ->orderBy('created_at', 'desc')
+            ->get();
+        return view('app.practice-management.unacknowledged-cancelled-bills', compact('bills'));
+    }
+
     public function myTickets(Request $request, $filter = 'open')
     {
         $performer = $this->performer();

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

@@ -45,6 +45,12 @@
                                            v-on:click.prevent="tab='measurements'">Unstamped Measurements</a>
                                     </th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$keyNumbers['unacknowledgedCancelledBills']}}</th>
+                                    <th class="pl-2">
+                                        <a href="/practice-management/unacknowledged-cancelled-bills">Unacknowledged Cancelled Bills</a>
+                                    </th>
+                                </tr>
                             </tbody>
                         </table>
                     </div>

+ 126 - 0
resources/views/app/practice-management/unacknowledged-cancelled-bills.blade.php

@@ -0,0 +1,126 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4 font-size-16">
+                <i class="fas fa-user-injured"></i>
+                Unacknowledged Cancelled Bills
+            </strong>
+        </div>
+        <div class="card-body p-0">
+
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="px-3 border-0">Created</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0 w-50">Context</th>
+                    <th class="border-0">Role</th>
+                    <th class="border-0">Amount</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($bills as $bill)
+                    <tr class="">
+                        <td class="px-3">
+                            {{ friendly_date_time($bill->created_at, true) }}
+                        </td>
+                        <td class="">
+                            <a href="/patients/view/{{ $bill->client->uid }}">{{ $bill->client->displayName() }}</a>
+                        </td>
+                        <td class="stag-no-wrap-td">
+                            @if($bill->careMonth)
+                                <b>{{ $bill->code }}</b>
+                                -
+                                <a href="/patients/view/{{ $bill->client->uid }}/care-months/view/{{ $bill->careMonth->uid }}">
+                                    <b>{{ friendly_month($bill->careMonth->start_date) }}</b>
+                                </a>
+                            @elseif($bill->note)
+                                <b>{{ $bill->code }}</b>
+                                -
+                                <a href="/patients/view/{{ $bill->client->uid }}/notes/view/{{ $bill->note->uid }}">
+                                    <b>Note</b>
+                                </a>
+                            @endif
+                            @if(!empty($bill->reason1))
+                                <div class="text-secondary text-sm stag-no-wrap" title="{{ $bill->reason1 }}">{{ $bill->reason1 }}</div>
+                            @endif
+                        </td>
+                        <td>
+                            <?php
+                            $roles = [];
+                            if($bill->hcp_pro_id === $pro->id) $roles[] = 'HCP';
+                            if($bill->cm_pro_id === $pro->id) $roles[] = 'CM';
+                            if($bill->rme_pro_id === $pro->id) $roles[] = 'RME';
+                            if($bill->rmm_pro_id === $pro->id) $roles[] = 'RMM';
+                            $roles = implode("<br>", $roles);
+                            ?>
+                            {!! $roles !!}
+                        </td>
+                        <td>
+                            @if($bill->hcp_pro_id === $pro->id)
+                                @if($bill->has_hcp_been_paid)
+                                    <div>
+                                        <span class="text-dark">HCP Received:</span>
+                                        <span class="font-weight-bold text-success ml-2">${{ $bill->hcp_payment_amount }}</span>
+                                    </div>
+                                @else
+                                    <div>
+                                        <span class="text-dark">HCP Expected:</span>
+                                        <span class="font-weight-bold text-dark ml-2">{{ $bill->hcp_expected_payment_amount ? '$' . $bill->hcp_expected_payment_amount : '-' }}</span>
+                                    </div>
+                                @endif
+                            @endif
+                            @if($bill->cm_pro_id === $pro->id)
+                                @if($bill->has_cm_been_paid)
+                                    <div>
+                                        <span class="text-dark">CM Received:</span>
+                                        <span class="font-weight-bold text-success ml-2">${{ $bill->cm_payment_amount }}</span>
+                                    </div>
+                                @else
+                                    <div>
+                                        <span class="text-dark">CM Expected:</span>
+                                        <span class="font-weight-bold text-dark ml-2">{{ $bill->cm_expected_payment_amount ? '$' . $bill->cm_expected_payment_amount : '-' }}</span>
+                                    </div>
+                                @endif
+                            @endif
+                            @if($bill->rmm_pro_id === $pro->id)
+                                @if($bill->has_rmm_been_paid)
+                                    <div>
+                                        <span class="text-dark">RMM Received:</span>
+                                        <span class="font-weight-bold text-success ml-2">${{ $bill->rmm_payment_amount }}</span>
+                                    </div>
+                                @else
+                                    <div>
+                                        <span class="text-dark">RMM Expected:</span>
+                                        <span class="font-weight-bold text-dark ml-2">{{ $bill->rmm_expected_payment_amount ? '$' . $bill->rmm_expected_payment_amount : '-' }}</span>
+                                    </div>
+                                @endif
+                            @endif
+                            @if($bill->rme_pro_id === $pro->id)
+                                @if($bill->has_rme_been_paid)
+                                    <div>
+                                        <span class="text-dark">RME Received:</span>
+                                        <span class="font-weight-bold text-success ml-2">${{ $bill->rme_payment_amount }}</span>
+                                    </div>
+                                @else
+                                    <div>
+                                        <span class="text-dark">RME Expected:</span>
+                                        <span class="font-weight-bold text-dark ml-2">{{ $bill->rme_expected_payment_amount ? '$' . $bill->rme_expected_payment_amount : '-' }}</span>
+                                    </div>
+                                @endif
+                            @endif
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+    </div>
+
+@endsection

+ 1 - 0
routes/web.php

@@ -81,6 +81,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('contract', 'PracticeManagementController@contract')->name('contract');
         Route::get('notes/{filter?}', 'PracticeManagementController@notes')->name('notes');
         Route::get('bills/{filter?}', 'PracticeManagementController@bills')->name('bills');
+        Route::get('unacknowledged-cancelled-bills', 'PracticeManagementController@unacknowledgedCancelledBills')->name('unacknowledged-cancelled-bills');
         Route::get('my-tickets/{filter?}', 'PracticeManagementController@myTickets')->name('myTickets');
         Route::get('my-text-shortcuts', 'PracticeManagementController@myTextShortcuts')->name('myTextShortcuts');
         Route::get('my-favorites/{filter?}', 'PracticeManagementController@myFavorites')->name('myFavorites');