Harmonisation dialogue paramètres
This commit is contained in:
parent
9106c4226b
commit
c7d71d082d
1 changed files with 11 additions and 11 deletions
|
@ -26,7 +26,7 @@
|
|||
}}
|
||||
{{/select}}
|
||||
|
||||
{{if $_POST.no_amort}}
|
||||
{{if ! $_POST.amortir}}
|
||||
{{* ne pas amortir *}}
|
||||
{{:assign duration=0}}
|
||||
{{:assign date_debut=$ligne_immo.date_achat|parse_date}}
|
||||
|
@ -62,7 +62,7 @@
|
|||
status=$status
|
||||
}}
|
||||
|
||||
{{if $_POST.no_amort}}
|
||||
{{if ! $_POST.amortir}}
|
||||
{{:assign type_immo="autres"}}
|
||||
{{else}}
|
||||
{{:assign type_immo=$_GET.type_immo}}
|
||||
|
@ -81,10 +81,10 @@
|
|||
|
||||
{{* renseigner ou modifier la date de mise en service et la durée d'amortissement *}}
|
||||
{{if $_GET.amort == 0}}
|
||||
{{:assign checked=1}}
|
||||
{{:assign checked=0}}
|
||||
{{:assign disabled=1}}
|
||||
{{else}}
|
||||
{{:assign checked=0}}
|
||||
{{:assign checked=1}}
|
||||
{{:assign disabled=0}}
|
||||
{{/if}}
|
||||
|
||||
|
@ -93,19 +93,19 @@
|
|||
<legend></legend>
|
||||
<dl>
|
||||
{{if $checked}}
|
||||
{{:assign helptext = "Dé-cocher pour amortir"}}
|
||||
{{:assign helptext = "Dé-cocher pour ne pas amortir"}}
|
||||
{{else}}
|
||||
{{:assign helptext = "Cocher pour ne pas amortir"}}
|
||||
{{:assign helptext = "Cocher pour amortir"}}
|
||||
{{/if}}
|
||||
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" default=$checked help=$helptext onclick="toggleInputs('infos_immo','f_no_amort_1')"}}
|
||||
{{:input id="amortir" type="checkbox" value=1 name="amortir" label="Amortir" default=$checked help=$helptext onclick="toggleInputs('infos_immo','f_amortir_1')"}}
|
||||
{{if $info_immo != null}}
|
||||
{{:assign date_defaut=$info_immo.date}}
|
||||
{{:assign duree_defaut=$info_immo.duration}}
|
||||
{{else}}
|
||||
{{:assign duree_defaut=1}}
|
||||
{{/if}}
|
||||
{{:input type="date" name="date_mes" label="Date de mise en service" default=$date_defaut disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||
{{:input type="number" name="duree" label="Durée d'amortissement" default=$duree_defaut required=true min=1 disabled=$disabled}}
|
||||
{{:input type="date" name="date_mes" label="Date de mise en service" default=$date_defaut disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
@ -118,11 +118,11 @@
|
|||
{{* activer/désactiver les champs de saisie *}}
|
||||
<script type="text/javascript">
|
||||
function toggleInputs(idfs, idcb) {
|
||||
const noamort = document.getElementById(idcb);
|
||||
const amortir = document.getElementById(idcb);
|
||||
const fs = document.getElementById(idfs);
|
||||
for (let field of fs.querySelectorAll("input")) {
|
||||
if (field == noamort) { continue }
|
||||
if (noamort.checked) {
|
||||
if (field == amortir) { continue }
|
||||
if (! amortir.checked) {
|
||||
field.setAttribute("disabled","disabled");
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue