Browse Source

fixed commercial payer on billing report

= 3 years ago
parent
commit
a292383d3c

+ 4 - 0
app/Models/ClientPrimaryCoverage.php

@@ -80,6 +80,10 @@ class ClientPrimaryCoverage extends Model
         return $this->hasOne(Payer::class, 'id', 'mcd_payer_id');
     }
 
+    public function commercialPayer(){
+        return $this->hasOne(Payer::class, 'id', 'commercial_payer_id');
+    }
+
     public function autoMedicareResult(){
         return $this->hasOne(MedicareResult::class, 'id', 'auto_medicare_result_id');
     }

+ 1 - 1
resources/views/app/practice-management/billing-report.blade.php

@@ -89,7 +89,7 @@
                                     @endif
                                 @else 
                                     <div>
-                                        {{$row->client->getPrimaryCoverage()->commercial_payer_name}}
+                                        {{$row->client->getPrimaryCoverage()->commercialPayer?$row->client->getPrimaryCoverage()->commercialPayer->name:''}}
                                     </div>
                                     <div>
                                         Deductible: {{friendly_money($row->client->getPrimaryCoverage()->deductible_amount)}}