From f026fed0a46c813a176ca2edb8d8b103f9d002f0 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Wed, 12 Jan 2022 18:24:55 +0100 Subject: [PATCH] Update execution of prescription --- .../health_care_sheet_consultation_form.php | 3 ++ .../health_care_sheet_execution_form.php | 30 +++++++++++++++---- .../hyper/infos_health_care_sheet.php | 5 ++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/application/views/nano_health/agent/health_care_sheet_consultation_form.php b/application/views/nano_health/agent/health_care_sheet_consultation_form.php index b5cffba2..ecc31b23 100755 --- a/application/views/nano_health/agent/health_care_sheet_consultation_form.php +++ b/application/views/nano_health/agent/health_care_sheet_consultation_form.php @@ -355,6 +355,9 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); const insurance = insured.filter(i => i.insured_id === $(this).val()); $.each(insurance, function (i, item) { currentInsurance = item; + $('#sheet-form').find('select[name="beneficiary_id"]').children().remove().end() + .append(''); + $('#sheet-form').find('select[name="beneficiary_id"]').append($('', { label: 'Assuré principal', })); diff --git a/application/views/nano_health/agent/health_care_sheet_execution_form.php b/application/views/nano_health/agent/health_care_sheet_execution_form.php index 4cd82d53..c2849389 100755 --- a/application/views/nano_health/agent/health_care_sheet_execution_form.php +++ b/application/views/nano_health/agent/health_care_sheet_execution_form.php @@ -220,18 +220,32 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); if(insured && Array.isArray(insured)){ var currentInsurance = null; var consultations = []; - // console.log('insured', insured) - // insured.each() + $.each(insured, function (i, item) { + $('#sheet-form').find('select[name="insured_id"]').append($('', { + label: 'Assuré principal', + })); $('#sheet-form').find('select[name="insured_id"]').append($('', { + label: 'Ayants droits', + })); + $.each(item.beneficiaries, function (j, it) { + $('#sheet-form').find('select[name="insured_id"]').append($(''); + $.each(consultations, function (j, it) { $('#sheet-form').find('select[name="health_care_sheet_id"]').append($('