|
@@ -91,19 +91,21 @@ class PracticeManagementController extends Controller
|
|
|
$claimStatus = $request->get('status');
|
|
|
|
|
|
$rows = BillingReport::paginate(50);
|
|
|
- $rows = $rows->whereHas('client', function($clientQuery){
|
|
|
- return $clientQuery->where('client_engagement_status_category','<>' ,'DUMMY');
|
|
|
- });
|
|
|
+
|
|
|
if($claimStatus){
|
|
|
if($claimStatus == 'NO_CLAIMS'){
|
|
|
$rows = BillingReport::whereHas('note', function($noteQuery) use ($claimStatus){
|
|
|
return $noteQuery->has('claims', '=', 0);
|
|
|
+ })->whereHas('client', function($clientQuery){
|
|
|
+ return $clientQuery->where('client_engagement_status_category','<>' ,'DUMMY');
|
|
|
})->paginate(50);
|
|
|
}else{
|
|
|
$rows = BillingReport::whereHas('note', function($noteQuery) use ($claimStatus){
|
|
|
return $noteQuery->whereHas('claims', function($claimQuery) use ($claimStatus) {
|
|
|
return $claimQuery->where('status', $claimStatus);
|
|
|
});
|
|
|
+ })->whereHas('client', function($clientQuery){
|
|
|
+ return $clientQuery->where('client_engagement_status_category','<>' ,'DUMMY');
|
|
|
})->paginate(50);
|
|
|
}
|
|
|
|