diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 5982398..4834d4d 100755 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -241,27 +241,17 @@ class InvoiceController extends Controller 'network_id' => 'required_without:network_agent_id|integer|exists:networks,id', 'network_agent_id' => 'required_without:network_id|integer|exists:networks_agents,id' ]); - $network_id = $request->input('network_id'); $network_agent_id = $request->input('network_agent_id'); - // Correction temporaire - $insured_id = $request->input('insured_id'); - if (!empty($insured_id)) { - $network_agent_id = $insured_id; - } $query = NhInfosInvoice::with(['health_care_sheets:id,invoice_id,health_care_sheet_id,type,practitioner_lastname,practitioner_firstname,practitioner_provider_class,patient_lastname,patient_firstname,institution_name,institution_code']); -// if (!empty($network_id)) { -// $query = $query->where('network_id', $network_id); -// } + if (!empty($network_id)) { + $query = $query->where('network_id', $network_id); + } if (!empty($network_agent_id)) { $query = $query->where('network_agent_id', $network_agent_id); - } else { - if (!empty($network_id)) { - $query = $query->where('network_id', $network_id); - } } $invoices = $query->orderBy('created_at', 'DESC')->paginate($request->input('perPage', 10));