save_amort : version initiale

This commit is contained in:
Jean-Christophe Engel 2024-02-16 11:53:19 +01:00
parent 636bb10a8c
commit 8f3e689951

61
save_amort.html Normal file
View File

@ -0,0 +1,61 @@
{{:admin_header title="Ajout amortissement" current="module_amortissement"}}
{{* barre de navigation *}}
{{if ! $dialog}}
{{:include file="_nav.html" current="amortization"}}
{{/if}}
{{* Traiter l'envoi du formulaire *}}
{{* Préparer les infos pour le formulaire *}}
{{:assign var="debit_account.6811" value="6811 — Dot. aux amortissements des immobilisations"}}
{{*
déterminer le compte d'amortissement en fonction du compte
d'immobilisation => ajouter un 8 après le 2 de tête
*}}
{{#select code, label from acc_accounts where id = :id; :id=$_GET.account assign=amort_account}}{{/select}}
{{:assign c1=$amort_account.code|substr:0:1}}
{{:assign reste=$amort_account.code|substr:1}}
{{:assign amort_code=$c1|cat:8|cat:$reste}}
{{:assign var="credit_account.%s"|args:$amort_code value="%s — Amortissements "|args:$amort_code|cat:$amort_account.label}}
{{#select id, label, end_date from acc_years where id=:id; :id=$_GET.year assign=year}}{{/select}}
{{*:debug year.id=$year.id year.end_date=$year.end_date|date_short*}}
{{#years closed=false}}
{{:assign var="open_years.%d"|args:$id value=$label}}
{{/years}}
<form method="post" action="">
<fieldset class="ajout_amort">
<legend>Ajouter une écriture d'amortissement</legend>
<dl>
{{:input type="select" default=$year.id name="id_year" label="Exercice" required=true options=$open_years}}
{{:input type="date" name="date" label="Date" required=true default=$year.end_date|date_short}}
{{:input type="text" name="designation" label="Désignation" required=true default=$_GET.label}}
{{:input type="money" name="montant" label="Montant" required=true default=$_GET.amount}}
{{:input
type="list"
name="debit_account"
label="Compte de débit"
required=true
target="!acc/charts/accounts/selector.php?&key=code&year=%d"|args:$year.id
default=$debit_account
}}
{{:input
type="list"
name="credi_account"
label="Compte d'amortissement (280xx ou 281xx)"
required=true
target="!acc/charts/accounts/selector.php?key=code&year=%d"|args:$year.id
default=$credit_account
}}
</dl>
</fieldset>
<p class="submit">
{{:button type="submit" name="add" label="Enregistrer" shape="right" class="main"}}
</p>
</form>
{{:admin_footer}}