diff --git a/_unfinished.html b/_unfinished.html index 5db1083..3565470 100644 --- a/_unfinished.html +++ b/_unfinished.html @@ -31,6 +31,9 @@

+
+ {{:input type="checkbox" value=1 name="unhide" label="Afficher les écritures marquées ignorées" }} +
@@ -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 @@ - + {{/select}} @@ -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; +})(); + diff --git a/ignore.html b/ignore.html new file mode 100644 index 0000000..a8d4ec6 --- /dev/null +++ b/ignore.html @@ -0,0 +1,85 @@ +{{* -*- brindille -*- *}} + +{{* + Marquer la ligne d'écriture « à ignorer » + @param immo_id : numéro de ligne +*}} + +{{#select + trans.id AS trans_id, + trans.date AS date, + trans.label AS label, + line.debit AS amount + FROM acc_transactions_lines AS line + INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id + WHERE line.id = :line_id + ; + :line_id = $_GET.immo_id + assign=ligne_immo +}} +{{else}} + {{:error message="Il n'y a aucune écriture avec le numéro de ligne %s !"|args:$_GET.immo_id}} +{{/select}} +{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.immo_id|intval}}{{/load}} + +{{* Traiter l'envoi du formulaire *}} +{{#form on="proceed"}} + {{if $_POST.ignore != null && $info_immo == null}} + {{* ignorer l'écriture *}} + {{:assign duration=0}} + {{:assign status="ignored"}} + {{:save + key=""|uuid + validate_schema="schema.json" + type="immo" + line=$_GET.immo_id|intval + duration=$duration + date=$ligne_immo.date + status=$status + }} + {{:redirect force="index.html?ok=1&msg=infos&type_immo=unfinished"}} + {{elseif $_POST.ignore == null && $info_immo != null}} + {{* dés-ignorer l'écriture *}} + {{:delete id=$info_immo.id}} + {{:redirect force="index.html?ok=1&msg=infos&type_immo=unfinished"}} + {{else}} + {{:redirect force="index.html?type_immo=unfinished"}} + {{/if}} +{{else}} + {{:form_errors}} +{{/form}} + +{{:admin_header title="Ignorer l'écriture" custom_css="./style.css" current="module_amortissement"}} + +{{* barre de navigation *}} +{{if ! $dialog}} + {{:include file="_nav.html" current="index"}} +{{/if}} + + +
+ Ignorer +
+
+
Écriture
+
#{{$ligne_immo.trans_id}} {{$ligne_immo.label}}
+
Montant
+
{{"%f"|math:$ligne_immo.amount|money_currency}}
+
+
+
+ {{if $info_immo != null && $info_immo.status == "ignored"}} + {{:input type="checkbox" name="ignore" checked="checked" value="1" label="Ignoré" help="Décocher pour ne plus ignorer l'écriture"}} + {{else}} + {{:input type="checkbox" name="ignore" value="1" label="Ignoré" help="Cocher pour ignorer l'écriture ; elle n'apparaitra plus dans la liste des immobilisations"}} + {{/if}} +
+
+ +

+ {{:button type="submit" name="proceed" label="Confirmer" shape="right" class="main"}} +

+ + + +{{:admin_footer}} diff --git a/style.css b/style.css index 40922ee..5c0e9c6 100644 --- a/style.css +++ b/style.css @@ -38,6 +38,11 @@ h2[class="aide"], h3[class="aide"] { margin-right: 0; } +.informations dl.describe > dd { + margin-left: 0; + margin-right: 0; +} + nav.amort aside { margin-top : 0; }
{{"%f"|math:$debit|money:false}} {{$account_label}} + {{:linkbutton + label="Modifier" + href="ignore.html?immo_id=%s"|args:$immo_id + shape="edit" + target="_dialog" + }} +