Compare commits
No commits in common. "7e6eb4ea12604d7c7dc503939082da23f6f6de4b" and "5e8026e09bd3eff45bfe23b25e8ceaf9bd355b9b" have entirely different histories.
7e6eb4ea12
...
5e8026e09b
@ -1,4 +1,3 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
{{*
|
{{*
|
||||||
Calcule le nombre de jours entre deux dates
|
Calcule le nombre de jours entre deux dates
|
||||||
paramètres :
|
paramètres :
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
{{:admin_header title="Ajout immobilisation" current="module_amortissement"}}
|
{{:admin_header title="Ajout immobilisation" current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
@ -40,7 +39,7 @@
|
|||||||
duration=$_POST.duree|intval
|
duration=$_POST.duree|intval
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:redirect to="index.html?ok=1&msg=immobilisation"}}
|
{{:redirect to="index.html?ok=1"}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{* Préparer les infos pour le formulaire *}}
|
{{* Préparer les infos pour le formulaire *}}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{:admin_header title="Renseigner durée amortissement" custom_css=$custom_css current="module_amortissement"}}
|
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
|
||||||
{{if ! $dialog}}
|
|
||||||
{{:include file="_nav.html" current="index"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* renseigner la durée d'amortissement *}}
|
|
||||||
|
|
||||||
<h2 class="ruler">Durée d'amortissement</h2>
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
|
||||||
{{#form on="add"}}
|
|
||||||
{{* enregistrer les infos de l'immobilisation *}}
|
|
||||||
{{:assign var="line_id" value=$_GET.line_id|intval}}
|
|
||||||
{{:assign key=""|uuid}}
|
|
||||||
{{:save
|
|
||||||
key=$key
|
|
||||||
validate_schema="schema.json"
|
|
||||||
type="immo"
|
|
||||||
line=$line_id
|
|
||||||
duration=$_POST.duree|intval
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{:redirect force="index.html?ok=1&msg=durée"}}
|
|
||||||
{{/form}}
|
|
||||||
|
|
||||||
<form method="post" action="">
|
|
||||||
<fieldset class="ajout_duree">
|
|
||||||
<legend>Renseigner durée amortissement</legend>
|
|
||||||
<dl>
|
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true default=1}}
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p class="submit">
|
|
||||||
{{:button type="submit" name="add" label="Ajouter" shape="right" class="main"}}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
|
@ -1,20 +1,12 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{:admin_header title="Gestion des amortissements" custom_css=$custom_css current="module_amortissement"}}
|
||||||
|
|
||||||
{{:admin_header title="Liste des amortissements" custom_css="./style.css" current="module_amortissement"}}
|
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="_nav.html" current="amortization"}}
|
{{:include file="_nav.html" current="amortization"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
|
||||||
<p class="block confirm">Amortissement enregistré</p>
|
|
||||||
{{elseif $_GET.err}}
|
|
||||||
<p class="block error">Échec enregistrement amortissement</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* récupérer les infos de l'immobilisation *}}
|
{{* récupérer les infos de l'immobilisation *}}
|
||||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.line_id|intval}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$_GET.line|intval}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign message="Pas d'info concernant l'immobilisation %s"|args:$_GET.line_id}}
|
{{:assign message="Immobilisation %s non trouvée"|args:$_GET.line}}
|
||||||
{{:error message=$message}}
|
{{:error message=$message}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
@ -34,12 +26,12 @@
|
|||||||
inner join acc_years as y on trans.id_year = y.id
|
inner join acc_years as y on trans.id_year = y.id
|
||||||
left join acc_projects AS project ON line.id_project = project.id
|
left join acc_projects AS project ON line.id_project = project.id
|
||||||
where line.id = :line_id;
|
where line.id = :line_id;
|
||||||
:line_id = $_GET.line_id|intval
|
:line_id = $_GET.line|intval
|
||||||
assign=ligne_immo
|
assign=ligne_immo
|
||||||
}}
|
}}
|
||||||
<h2>Amortissement de « {{$label}} » d'un montant de {{"%f"|math:$montant|money_currency}} en date du {{$date_achat|date_short}} sur {{$info_immo.duration}} ans</h2>
|
<h2>Amortissement de « {{$label}} » d'un montant de {{"%f"|math:$montant|money_currency}} en date du {{$date_achat|date_short}} sur {{$info_immo.duration}} ans</h2>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign message="Immobilisation %s non trouvée"|args:$_GET.line_id}}
|
{{:assign message="Immobilisation %s non trouvée"|args:$_GET.line}}
|
||||||
{{:error message=$message}}
|
{{:error message=$message}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
@ -71,7 +63,7 @@
|
|||||||
:line_id = $info_immo.line|intval
|
:line_id = $info_immo.line|intval
|
||||||
assign=lines.
|
assign=lines.
|
||||||
}}
|
}}
|
||||||
{{*:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id*}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* calculer les amortissements *}}
|
{{* calculer les amortissements *}}
|
||||||
@ -174,11 +166,11 @@
|
|||||||
{{if $all_years|keys|has:$current_year}}
|
{{if $all_years|keys|has:$current_year}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Enregistrer"
|
label="Enregistrer"
|
||||||
href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&line_id=%s&project_id=%d&label=%s"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.line_id:$project_id:$libelle
|
href="save_amort.html?amount=%d&account=%s&year=%s&trans_id=%d&line_id=%s&project_id=%d&label=%s"|args:$annuite_courante:$ligne_immo.account_id:$current_year:$ligne_immo.trans_id:$_GET.line:$project_id:$libelle
|
||||||
shape="right"
|
shape="right"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:linkbutton label="Enregistrer" href="" shape="lock" class="disabled"}}
|
{{:linkbutton label="Enregistrer" href="" shape="alert"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
63
index.html
63
index.html
@ -1,18 +1,12 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
{{:admin_header title="Gestion des amortissements" custom_css=$custom_css current="module_amortissement"}}
|
{{:admin_header title="Gestion des amortissements" custom_css=$custom_css current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{:include file="_nav.html" current="index"}}
|
{{:include file="_nav.html" current="index"}}
|
||||||
|
|
||||||
{{if $_GET.ok}}
|
{{if $_GET.ok}}
|
||||||
{{if $_GET.msg|match:"immobilisation"}}
|
<p class="block confirm">Immobilisation enregistrée</p>
|
||||||
{{:assign msg="Immobilisation enregistrée"}}
|
|
||||||
{{elseif $_GET.msg|match:"durée"}}
|
|
||||||
{{:assign msg="Durée enregistrée"}}
|
|
||||||
{{/if}}
|
|
||||||
<p class="block confirm">{{$msg}}</p>
|
|
||||||
{{elseif $_GET.err}}
|
{{elseif $_GET.err}}
|
||||||
<p class="block error">Échec enregistrement immobilisation</p>
|
<p class="block error">Enregistrement immobilisation refusée</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* lister les immobilisations *}}
|
{{* lister les immobilisations *}}
|
||||||
@ -56,40 +50,25 @@
|
|||||||
(account.code LIKE '21%' OR account.code LIKE '22%')
|
(account.code LIKE '21%' OR account.code LIKE '22%')
|
||||||
ORDER BY trans.date DESC
|
ORDER BY trans.date DESC
|
||||||
}}
|
}}
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$line_id|intval}}
|
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$line_id|intval}}{{/load}}
|
||||||
{{*:debug info_immo=$info_immo*}}
|
<tr>
|
||||||
{{:assign duration=$duration}}
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
{{else}}
|
<td>{{$trans_date|date_short}}</td>
|
||||||
{{:assign duration=null}}
|
<td>{{$trans_label}}</td>
|
||||||
{{/load}}
|
<td class="money">{{"%f"|math:$debit|money}}</td>
|
||||||
{{*:debug duration=$duration*}}
|
<td class="num">{{$info_immo.duration}}</td>
|
||||||
<tr>
|
<td>{{$account_code}}</td>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td>{{$account_label}}</td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$project_label}}</td>
|
||||||
<td>{{$trans_label}}</td>
|
<td class="actions">
|
||||||
<td class="money">{{"%f"|math:$debit|money}}</td>
|
{{:linkbutton
|
||||||
<td class="num">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
label="Amortissements"
|
||||||
<td>{{$account_code}}</td>
|
href="amortization.html?line=%s"|args:$line_id
|
||||||
<td>{{$account_label}}</td>
|
shape="table"
|
||||||
<td>{{$project_label}}</td>
|
}}
|
||||||
<td class="actions">
|
</td>
|
||||||
{{if $duration == null}}
|
</tr>
|
||||||
{{:linkbutton
|
|
||||||
label="Ajouter durée"
|
|
||||||
href="add_duration.html?line_id=%s"|args:$line_id
|
|
||||||
shape="help"
|
|
||||||
target="_dialog"
|
|
||||||
}}
|
|
||||||
{{else}}
|
|
||||||
{{:linkbutton
|
|
||||||
label="Amortissements"
|
|
||||||
href="amortization.html?line_id=%s"|args:$line_id
|
|
||||||
shape="table"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name="Gestion des amortissements"
|
name="Gestion des amortissements"
|
||||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko"
|
description="Gestion des amortissements : ..."
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://git.roflcopter.fr/lesanges"
|
author_url="https://git.roflcopter.fr/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
{{:admin_header title="Ajout amortissement" current="module_amortissement"}}
|
{{:admin_header title="Ajout amortissement" current="module_amortissement"}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
@ -39,7 +38,7 @@
|
|||||||
linked_transactions=$_GET.trans_id|intval
|
linked_transactions=$_GET.trans_id|intval
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:redirect to="amortization.html?line_id=%s&ok=1"|args:$_GET.line_id}}
|
{{:redirect to="amortization.html?line=%s"|args:$_GET.line_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{* Préparer les infos pour le formulaire *}}
|
{{* Préparer les infos pour le formulaire *}}
|
||||||
|
Loading…
Reference in New Issue
Block a user