ajout modification informations immobilisation
This commit is contained in:
parent
b1a78a3047
commit
a1bf1c485c
@ -68,6 +68,19 @@
|
|||||||
{{if $amortissable == "non"}}
|
{{if $amortissable == "non"}}
|
||||||
{{:continue}}
|
{{:continue}}
|
||||||
{{/if}}
|
{{/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>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
@ -79,18 +92,26 @@
|
|||||||
<td>{{$project_label}}</td>
|
<td>{{$project_label}}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{if $duration == null}}
|
{{if $duration == null}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Ajouter infos"
|
label="Ajouter infos"
|
||||||
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
href="add_infos.html?immo_id=%s&amort=1"|args:$immo_id
|
||||||
shape="help"
|
shape="help"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:linkbutton
|
{{if ! $exist_amort}}
|
||||||
label="Amortissements"
|
{{:linkbutton
|
||||||
href="amortization.html?immo_id=%s"|args:$immo_id
|
label="Modifier infos"
|
||||||
shape="table"
|
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
|
||||||
|
shape="table"
|
||||||
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -104,10 +125,10 @@
|
|||||||
<legend>Ajouter une immobilisation</legend>
|
<legend>Ajouter une immobilisation</legend>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Ajouter une immobilisation"
|
label="Ajouter une immobilisation"
|
||||||
shape="plus"
|
shape="plus"
|
||||||
href="add_asset.html"
|
href="add_asset.html"
|
||||||
target="_dialog"
|
target="_dialog"
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -7,11 +7,15 @@
|
|||||||
{{:include file="_nav.html" current="index"}}
|
{{:include file="_nav.html" current="index"}}
|
||||||
{{/if}}
|
{{/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 *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="change"}}
|
{{#form on="change"}}
|
||||||
|
|
||||||
{{* chercher la date d'acquisition de l'immobilisation *}}
|
{{* chercher la date d'acquisition de l'immobilisation *}}
|
||||||
{{:assign var="immo_id" value=$_GET.immo_id|intval}}
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.date as date_achat
|
trans.date as date_achat
|
||||||
from acc_transactions_lines as line
|
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}}
|
{{:error message="Erreur : la date de mise en service (%s) ne peut être antérieure à la date d'acquisition (%s)"|args:$dd:$da}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign duration=$_POST.duree|intval}}
|
{{:assign duration=$_POST.duree|intval}}
|
||||||
|
{{if $duration <= 0}}
|
||||||
|
{{:error message="Erreur : la durée d'amortissement doit être strictement positive"}}
|
||||||
|
{{/if}}
|
||||||
{{:assign noamort=false}}
|
{{:assign noamort=false}}
|
||||||
{{/if}}
|
{{/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 *}}
|
{{* enregistrer les infos modifiées de l'immobilisation *}}
|
||||||
{{*:assign key=""|uuid*}}
|
|
||||||
{{:save
|
{{:save
|
||||||
key=$key
|
key=$info_immo.key
|
||||||
validate_schema="schema.json"
|
validate_schema="schema.json"
|
||||||
type="immo"
|
type="immo"
|
||||||
line=$immo_id
|
line=$immo_id
|
||||||
@ -64,7 +67,8 @@
|
|||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
{{/form}}
|
{{/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}}
|
{{if $_GET.amort == 0}}
|
||||||
{{:assign checked=1}}
|
{{:assign checked=1}}
|
||||||
{{:assign disabled=1}}
|
{{:assign disabled=1}}
|
||||||
@ -72,13 +76,14 @@
|
|||||||
{{:assign checked=0}}
|
{{:assign checked=0}}
|
||||||
{{:assign disabled=0}}
|
{{:assign disabled=0}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset id="infos_immo">
|
<fieldset id="infos_immo">
|
||||||
<legend></legend>
|
<legend></legend>
|
||||||
<dl>
|
<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 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="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" required=true min=0 default=1 disabled=$disabled}}
|
{{:input type="number" name="duree" label="Durée d'amortissement" default=$info_immo.duration required=true min=1 disabled=$disabled}}
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user