diff --git a/templates/_js.tpl b/templates/_js.tpl index 8bffb35..5508ae6 100644 --- a/templates/_js.tpl +++ b/templates/_js.tpl @@ -40,14 +40,14 @@ function changeTypeSaisie(type) { g.toggle(['.type_client', '.type_membre'], false); - g.toggle('.type_' + type, true); + + if (type) { + g.toggle('.type_' + type, true); + } } const form = document.querySelector('#f_numero_facture').form; - - if (form.base_receveur) { - changeTypeSaisie(form.base_receveur.value); - } + changeTypeSaisie(form.base_receveur.value); var inputs = $('input[name="base_receveur"]'); diff --git a/templates/facture_ajouter.tpl b/templates/facture_ajouter.tpl index 7ad46c6..9aa9471 100644 --- a/templates/facture_ajouter.tpl +++ b/templates/facture_ajouter.tpl @@ -58,27 +58,26 @@ Client
-
+
{if !empty($clients)}
{input type="radio" name="base_receveur" value="membre" label="Un·e membre" default=1} {input type="radio" name="base_receveur" value="client" label="Un·e client·e"}
{/if} -
-
- {input type="select" name="membre" label="Membre" options=$membres required=1} -
- - {if !empty($clients)} -
- {input type="select" name="client" label="Client" options=$clients required=1 class="type_client"} -
- {else} - - {/if} -
+ +
+ {input type="select" name="membre" label="Membre" options=$membres required=1} +
+ + {if !empty($clients)} +
+ {input type="select" name="client" label="Client" options=$clients required=1 class="type_client"} +
+ {else} + + {/if}