petites corrections

This commit is contained in:
Jean-Christophe Engel 2024-12-26 11:33:04 +01:00
parent 11be1386c2
commit f76c243b8c
2 changed files with 9 additions and 5 deletions

View File

@ -38,9 +38,9 @@
{{:assign duration=$_POST.duree|intval}} {{:assign duration=$_POST.duree|intval}}
{{:assign noamort=false}} {{:assign noamort=false}}
{{/if}} {{/if}}
{{* enregistrer les infos de l'immobilisation *}} {{* enregistrer les infos de l'immobilisation *}}
{{:assign key=""|uuid}} {{:assign key=""|uuid}}
{{:save {{:save
key=$key key=$key
validate_schema="schema.json" validate_schema="schema.json"
@ -51,7 +51,12 @@
noamort=$noamort noamort=$noamort
}} }}
{{:redirect force="index.html?ok=1&msg=infos"}} {{if $_POST.no_amort}}
{{:assign amort=0}}
{{else}}
{{:assign amort=1}}
{{/if}}
{{:redirect force="index.html?ok=1&msg=infos&amort=%s"|args:$amort}}
{{else}} {{else}}
{{:form_errors}} {{:form_errors}}
{{/form}} {{/form}}
@ -70,7 +75,7 @@
<dl> <dl>
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" default=$checked help="Cocher pour ne pas amortir" onclick="toggleInputs('infos_immo','f_no_amort_1')"}} {{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" default=$checked help="Cocher pour ne pas amortir" onclick="toggleInputs('infos_immo','f_no_amort_1')"}}
{{:input type="date" name="date_mes" label="Date de mise en service" disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}} {{:input type="date" name="date_mes" label="Date de mise en service" disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
{{:input type="number" name="duree" label="Durée d'amortissement" required=true default=1 disabled=$disabled}} {{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 disabled=$disabled}}
</dl> </dl>
</fieldset> </fieldset>
@ -83,7 +88,6 @@
{{* activer/désactiver les champs de saisie *}} {{* activer/désactiver les champs de saisie *}}
<script type="text/javascript"> <script type="text/javascript">
function toggleInputs(idfs, idcb) { function toggleInputs(idfs, idcb) {
console.log("cb=" + idcb);
const noamort = document.getElementById(idcb); const noamort = document.getElementById(idcb);
const fs = document.getElementById(idfs); const fs = document.getElementById(idfs);
for (let field of fs.querySelectorAll("input")) { for (let field of fs.querySelectorAll("input")) {

View File

@ -81,7 +81,7 @@
{{if $duration == null}} {{if $duration == null}}
{{:linkbutton {{:linkbutton
label="Ajouter infos" label="Ajouter infos"
href="add_duration.html?immo_id=%s&amort=1"|args:$immo_id href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
shape="help" shape="help"
target="_dialog" target="_dialog"
}} }}