Corrige le fonctionemment de l'ajout de document quand aucun client n'existe

This commit is contained in:
bohwaz 2021-12-17 12:07:53 +01:00
parent 97abfb4774
commit f39755121d
2 changed files with 15 additions and 9 deletions

View File

@ -43,7 +43,11 @@
g.toggle('.type_' + type, true); g.toggle('.type_' + type, true);
} }
changeTypeSaisie(document.forms[0].base_receveur.value); const form = document.querySelector('#f_numero_facture').form;
if (form.base_receveur) {
changeTypeSaisie(form.base_receveur.value);
}
var inputs = $('input[name="base_receveur"]'); var inputs = $('input[name="base_receveur"]');
@ -83,7 +87,6 @@
g.toggle(e, true); g.toggle(e, true);
g.toggle('p.submit', true); g.toggle('p.submit', true);
}); });
console.log(e.value);
selectType(e.value); selectType(e.value);
}; };
}); });

View File

@ -65,16 +65,19 @@
{input type="radio" name="base_receveur" value="client" label="Un·e client·e"} {input type="radio" name="base_receveur" value="client" label="Un·e client·e"}
</dd> </dd>
{/if} {/if}
<dd>
<div class="type_membre"> <div class="type_membre">
{input type="select" name="membre" label="Membre" options=$membres required=1} {input type="select" name="membre" label="Membre" options=$membres required=1}
</div> </div>
{if !empty($clients)} {if !empty($clients)}
<div class="type_client"> <div class="type_client">
{input type="select" name="client" label="Client" options=$clients required=1 class="type_client"} {input type="select" name="client" label="Client" options=$clients required=1 class="type_client"}
</div> </div>
{/if} {else}
<input type="hidden" name="base_receveur" value="membre" />
{/if}
</dd>
</dl> </dl>
</fieldset> </fieldset>