ajout modification informations immobilisation
This commit is contained in:
parent
b1a78a3047
commit
a1bf1c485c
@ -68,6 +68,19 @@
|
||||
{{if $amortissable == "non"}}
|
||||
{{:continue}}
|
||||
{{/if}}
|
||||
{{* voir s'il existe des écritures d'amortissement associées *}}
|
||||
{{#select
|
||||
links.id_transaction,
|
||||
links.id_related
|
||||
FROM acc_transactions_links AS links
|
||||
WHERE links.id_transaction = :trans_id OR links.id_related = :trans_id;
|
||||
:trans_id=$trans_id
|
||||
}}
|
||||
{{:assign exist_amort=true}}
|
||||
{{else}}
|
||||
{{:assign exist_amort=false}}
|
||||
{{/select}}
|
||||
{{*:debug trans_id=$trans_id trans_label=$trans_label exist_amort=$exist_amort*}}
|
||||
<tr>
|
||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||
<td>{{$trans_date|date_short}}</td>
|
||||
@ -86,6 +99,14 @@
|
||||
target="_dialog"
|
||||
}}
|
||||
{{else}}
|
||||
{{if ! $exist_amort}}
|
||||
{{:linkbutton
|
||||
label="Modifier infos"
|
||||
href="modif_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||
shape="help"
|
||||
target="_dialog"
|
||||
}}
|
||||
{{/if}}
|
||||
{{:linkbutton
|
||||
label="Amortissements"
|
||||
href="amortization.html?immo_id=%s"|args:$immo_id
|
||||
|
@ -7,11 +7,15 @@
|
||||
{{:include file="_nav.html" current="index"}}
|
||||
{{/if}}
|
||||
|
||||
{{* infos de l'immobilisation *}}
|
||||
{{:assign var="immo_id" value=$_GET.immo_id|intval}}
|
||||
{{#load type="immo" assign="info_immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
||||
{{/load}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="change"}}
|
||||
|
||||
{{* chercher la date d'acquisition de l'immobilisation *}}
|
||||
{{:assign var="immo_id" value=$_GET.immo_id|intval}}
|
||||
{{#select
|
||||
trans.date as date_achat
|
||||
from acc_transactions_lines as line
|
||||
@ -36,16 +40,15 @@
|
||||
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
|
||||
{{/if}}
|
||||
{{:assign duration=$_POST.duree|intval}}
|
||||
{{if $duration <= 0}}
|
||||
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
||||
{{/if}}
|
||||
{{:assign noamort=false}}
|
||||
{{/if}}
|
||||
|
||||
{{#load type="immo" where="$$.line = :line_id" :line_id=$immo_id|intval}}
|
||||
{{:assign key=$key}}
|
||||
{{/load}}
|
||||
{{* enregistrer les infos modifiées de l'immobilisation *}}
|
||||
{{*:assign key=""|uuid*}}
|
||||
{{:save
|
||||
key=$key
|
||||
key=$info_immo.key
|
||||
validate_schema="schema.json"
|
||||
type="immo"
|
||||
line=$immo_id
|
||||
@ -64,7 +67,8 @@
|
||||
{{:form_errors}}
|
||||
{{/form}}
|
||||
|
||||
{{* renseigner la date de mise en service et durée d'amortissement *}}
|
||||
{{* modifier la date de mise en service et durée d'amortissement *}}
|
||||
|
||||
{{if $_GET.amort == 0}}
|
||||
{{:assign checked=1}}
|
||||
{{:assign disabled=1}}
|
||||
@ -72,13 +76,14 @@
|
||||
{{:assign checked=0}}
|
||||
{{:assign disabled=0}}
|
||||
{{/if}}
|
||||
|
||||
<form method="post" action="">
|
||||
<fieldset id="infos_immo">
|
||||
<legend></legend>
|
||||
<dl>
|
||||
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" default=$checked help="Cocher pour ne pas amortir" onclick="toggleInputs('infos_immo','f_no_amort_1')"}}
|
||||
{{:input type="date" name="date_mes" label="Date de mise en service" disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 disabled=$disabled}}
|
||||
{{:input type="date" name="date_mes" label="Date de mise en service" default=$info_immo.date disabled=$disabled help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||
{{:input type="number" name="duree" label="Durée d'amortissement" default=$info_immo.duration required=true min=1 disabled=$disabled}}
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user