Explorar o código

CompanyPro related minor UI

Vijayakrishnan %!s(int64=3) %!d(string=hai) anos
pai
achega
c267d4003f

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

@@ -198,6 +198,21 @@ class PracticeManagementController extends Controller
 
             // more cases can be added as needed
             default:
+                $query = $query
+                    ->where(function ($q) use ($proID) {
+                        $q->where(function ($q2) use ($proID) {
+                            $q2->where('hcp_pro_id', $proID);
+                        })
+                            ->orWhere(function ($q2) use ($proID) {
+                                $q2->where('cm_pro_id', $proID);
+                            })
+                            ->orWhere(function ($q2) use ($proID) {
+                                $q2->where('rme_pro_id', $proID);
+                            })
+                            ->orWhere(function ($q2) use ($proID) {
+                                $q2->where('rmm_pro_id', $proID);
+                            });
+                    });
                 break;
         }
         $bills = $query->orderBy('created_at', 'desc')->get();

+ 8 - 0
app/Models/Bill.php

@@ -32,4 +32,12 @@ class Bill extends Model
     public function genericPro() {
         return $this->hasOne(Pro::class, 'id', 'generic_pro_id');
     }
+
+    public function hcpCompanyPro() {
+        return $this->hasOne(CompanyPro::class, 'id', 'hcp_company_pro_id');
+    }
+
+    public function genericCompanyPro() {
+        return $this->hasOne(CompanyPro::class, 'id', 'generic_company_pro_id');
+    }
 }

+ 2 - 0
resources/views/app/practice-management/bills.blade.php

@@ -35,7 +35,9 @@
                             {{ friendly_date_time($bill->created_at, true) }}
                         </td>
                         <td class="">
+                            @if($bill->client)
                             <a href="/patients/view/{{ $bill->client->uid }}">{{ $bill->client->displayName() }}</a>
+                            @endif
                         </td>
                         <td class="stag-no-wrap-td">
                             @if($bill->careMonth)

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

@@ -110,11 +110,16 @@
                             </td>
                             <td>{{friendly_date($row->effective_date)}}</td>
                             <td>{{friendly_date($row->balance_post_date)}}</td>
-                            @if(!request()->input('t') || request()->input('t') === 'hcp')
-                                <td>{{$row->hcp->name_last}}, {{$row->hcp->name_first}}</td>
-                            @elseif(request()->input('t') === 'na')
-                                <td>{{$row->genericPro->name_last}}, {{$row->genericPro->name_first}}</td>
-                            @endif
+                            <td>
+                                @if(!request()->input('t') || request()->input('t') === 'hcp')
+                                    {{$row->hcp->name_last}}, {{$row->hcp->name_first}}
+                                    <div class="mt-1 text-sm text-secondary font-weight-bold">{{$row->hcpCompanyPro->company->name}}</div>
+                                @elseif(request()->input('t') === 'na')
+                                    {{$row->genericPro->name_last}}, {{$row->genericPro->name_first}}
+                                    <div class="mt-1 text-sm text-secondary font-weight-bold">{{$row->genericCompanyPro->company->name}}</div>
+                                @endif
+
+                            </td>
                             <td>
                                 @if($row->client)
                                     {{$row->client->name_last}}, {{$row->client->name_first}}