Classer ou déclasser manuellement une écriture « à ignorer »

This commit is contained in:
Jean-Christophe Engel 2025-11-18 12:03:38 +01:00
parent 4c160e054a
commit 262b25889b
3 changed files with 120 additions and 1 deletions

View file

@ -31,6 +31,9 @@
</p>
</div>
</fieldset>
<fieldset>
{{:input type="checkbox" value=1 name="unhide" label="Afficher les écritures marquées ignorées" }}
</fieldset>
</form>
<table class="list">
@ -79,6 +82,15 @@
ORDER BY trans.date DESC;
!condition=$condition
}}
{{* voir si l'écriture a été marquée ignorée *}}
{{:assign ignore=false}}
{{#load type="immo" assign="info_immo" where="$$.line = :line_id AND $$.status = 'ignored'" :line_id=$immo_id|intval}}
{{:assign ignore=true}}
{{/load}}
{{if $ignore && $_POST.unhide == null}}
{{:continue}}
{{/if}}
{{* voir s'il existe une écriture qui solde l'immobilisation *}}
{{#select
count(*) AS count
@ -92,6 +104,7 @@
}}
{{:assign count=$count}}
{{/select}}
{{* S'il y a plus d'une écriture de même montant on ne peut pas décider *}}
{{if $count == 1}}
{{:continue}}
@ -109,7 +122,14 @@
<td class="money">{{"%f"|math:$debit|money:false}}</td>
<td class="account_code"><a href={{$compte_url}}>{{$account_code}}</a></td>
<td>{{$account_label}}</td>
<td class="actions"></td>
<td class="actions">
{{:linkbutton
label="Modifier"
href="ignore.html?immo_id=%s"|args:$immo_id
shape="edit"
target="_dialog"
}}
</td>
</tr>
{{/select}}
</tbody>
@ -132,4 +152,13 @@
}
function changeVisibility(evt, idcheck = 'f_unhide_1') {
this.form.dispatchEvent(new Event('submit'));
this.form.submit();
}
(function () {
document.getElementById('f_unhide_1').onclick = changeVisibility;
})();
</script>