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($('