Ajout projet et proprification
This commit is contained in:
parent
f35ca35538
commit
5e081c4f23
3 changed files with 45 additions and 91 deletions
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="add"}}
|
||||
{{* :debug POST=$_POST *}}
|
||||
|
||||
{{* enregistrer l'écriture *}}
|
||||
{{:assign var="credit_accounts" value=$_POST.credit_account|keys}}
|
||||
|
|
@ -15,9 +14,6 @@
|
|||
{{:assign var="debit_accounts" value=$_POST.debit_account|keys}}
|
||||
{{:assign var="debit_account" value=$debit_accounts.0}}
|
||||
|
||||
{{* :debug credit_account=$credit_account *}}
|
||||
{{* :debug debit_account=$debit_account *}}
|
||||
|
||||
{{:api
|
||||
method="POST"
|
||||
path="accounting/transaction"
|
||||
|
|
@ -29,17 +25,11 @@
|
|||
amount=$_POST.montant
|
||||
debit=$debit_account
|
||||
credit=$credit_account
|
||||
id_project=$_POST.id_project
|
||||
}}
|
||||
|
||||
{{* :debug result=$result *}}
|
||||
|
||||
{{* enregistrer les infos de l'immobilisation *}}
|
||||
{{* :debug lines=$result.lines *}}
|
||||
{{* :debug line1=$result.lines.1 *}}
|
||||
|
||||
{{:assign var="line_id" value=$result.lines.1.id}}
|
||||
{{* :debug line_id=$line_id *}}
|
||||
|
||||
{{:assign key=""|uuid}}
|
||||
{{:save
|
||||
key=$key
|
||||
|
|
@ -57,7 +47,7 @@
|
|||
{{:assign var="bank_account.512A" value="512A — Compte courant"}}
|
||||
{{#years closed=false}}
|
||||
{{:assign var="open_years.%d"|args:$id value=$label}}
|
||||
{{if $start_date <= $now && $end_date >= $now}}
|
||||
{{if $start_date|strtotime <= $now && $end_date|strtotime >= $now}}
|
||||
{{:assign best_year=$id}}
|
||||
{{/if}}
|
||||
{{/years}}
|
||||
|
|
@ -66,9 +56,13 @@
|
|||
|
||||
{{*
|
||||
TODO
|
||||
- ajouter projet et autres rubriques selon besoin
|
||||
- ajouter autres rubriques selon besoin
|
||||
*}}
|
||||
|
||||
{{#select id,label FROM acc_projects WHERE archived = 0;}}
|
||||
{{:assign var="projects.%d"|args:$id value=$label}}
|
||||
{{/select}}
|
||||
|
||||
<form method="post" action="">
|
||||
<fieldset class="ajout_immo">
|
||||
<legend>Ajouter une immobilisation</legend>
|
||||
|
|
@ -93,6 +87,9 @@
|
|||
required=true
|
||||
target="!acc/charts/accounts/selector.php?key=code&year=%d"|args:$best_year
|
||||
}}
|
||||
{{if $projects != null}}
|
||||
{{:input type="select" name="id_project" label="Projet (analytique)" options=$projects default_empty="— Aucun —"}}
|
||||
{{/if}}
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue