Suppression paramètre ligne immobilisation
This commit is contained in:
parent
3d1109018e
commit
9649d6af0e
9 changed files with 63 additions and 74 deletions
|
|
@ -149,7 +149,7 @@
|
||||||
{{*/if*}}
|
{{*/if*}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Amortissements"
|
label="Amortissements"
|
||||||
href="amortization.html?immo_line_id=%s&type_immo=%s&immo_doc_id=%s"|args:$immo_line_id:$type_immo:$immo_doc_id shape="table"
|
href="amortization.html?immo_doc_id=%s&type_immo=%s"|args:$immo_doc_id:$type_immo shape="table"
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
{{if $account_ok == null}}
|
{{if $account_ok == null}}
|
||||||
{{:assign compte=$debit_account|implode:""}}
|
{{:assign compte=$debit_account|implode:""}}
|
||||||
{{:redirect url="add_account.html?account=%s&chart=%s&immo_line_id=%s"|args:$compte:$selected_chart:$_GET.immo_line_id}}
|
{{:redirect url="add_account.html?account=%s&chart=%s"|args:$compte:$selected_chart}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:assign debit_account=$debit_account|keys|value:0}}
|
{{:assign debit_account=$debit_account|keys|value:0}}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Lister les écritures d'amortissement associées à une immobilisation
|
Lister les écritures d'amortissement associées à une immobilisation
|
||||||
@param immo_line_id : id de la ligne d'immo
|
|
||||||
@param immo_doc_id : id du doc associé à l'immo
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
@param type_immo : managed, amortized, archived, others
|
@param type_immo : managed, amortized, archived, others
|
||||||
*}}
|
*}}
|
||||||
|
|
@ -172,7 +171,7 @@
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Sortir du bilan"
|
label="Sortir du bilan"
|
||||||
href="balance_sheet_exit.html?immo_line_id=%s&immo_doc_id=%s&type_immo=%s"|args:$_GET.immo_line_id:$_GET.immo_doc_id:$_GET.type_immo
|
href="balance_sheet_exit.html?immo_doc_id=%s&type_immo=%s"|args:$_GET.immo_doc_id:$_GET.type_immo
|
||||||
shape="export"
|
shape="export"
|
||||||
class="main"
|
class="main"
|
||||||
}}
|
}}
|
||||||
|
|
@ -253,7 +252,7 @@
|
||||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||||
<td>{{$line.account_label}}</td>
|
<td>{{$line.account_label}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{:linkbutton label="Détacher" href="detach_amort.html?amort_line_id=%d&immo_line_id=%d&immo_doc_id=%s"|args:$line.amort_line_id:$ligne_immo.immo_line_id:$_GET.immo_doc_id shape="minus"}}
|
{{:linkbutton label="Détacher" href="detach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.amort_line_id shape="minus"}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,17 @@
|
||||||
{{*
|
{{*
|
||||||
Enregistrer la liaison entre une ligne d'écriture d'amortissement
|
Enregistrer la liaison entre une ligne d'écriture d'amortissement
|
||||||
et une ligne d'écriture d'immobilisation
|
et une ligne d'écriture d'immobilisation
|
||||||
@param immo_line_id : numéro de ligne de l'écriture d'immobilisation
|
|
||||||
@param amort_line_id : numéro de ligne de l'écriture d'amortissement
|
|
||||||
@param immo_doc_id : numéro du doc d'immo
|
@param immo_doc_id : numéro du doc d'immo
|
||||||
|
@param amort_line_id : numéro de ligne de l'écriture d'amortissement
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* chercher l'écriture d'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
|
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||||
|
{{:assign label_immo=$label|or:$ligne_immo.trans_label}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
line.id_transaction as immo_trans_id,
|
line.id_transaction as immo_trans_id,
|
||||||
line.debit as montant,
|
line.debit as montant,
|
||||||
|
|
@ -17,19 +22,13 @@
|
||||||
FROM acc_transactions_lines as line
|
FROM acc_transactions_lines as line
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||||
WHERE line.id = :line_id;
|
WHERE line.id = :line_id;
|
||||||
:line_id = $_GET.immo_line_id|intval
|
:line_id = $info_immo.line
|
||||||
assign="ligne_immo"
|
assign="ligne_immo"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Immobilisation non trouvée"}}
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* chercher le doc associé à l'immo *}}
|
|
||||||
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
|
||||||
{{:assign label_immo=$label|or:$ligne_immo.trans_label}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Immobilisation non trouvée"}}
|
|
||||||
{{/load}}
|
|
||||||
{{:assign montant_immo=$info_immo.amount|or:$ligne_immo.montant}}
|
{{:assign montant_immo=$info_immo.amount|or:$ligne_immo.montant}}
|
||||||
|
|
||||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
||||||
|
|
@ -191,7 +190,7 @@
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect force="amortization.html?immo_line_id=%s&immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_line_id:$_GET.immo_doc_id:$status}}
|
{{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=attach_amort"|args:$_GET.immo_doc_id:$status}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Amortir l'immobilisation" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Amortir l'immobilisation" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
|
||||||
|
|
@ -3,24 +3,29 @@
|
||||||
{{*
|
{{*
|
||||||
Supprimer l'association entre une écriture d'amortissement et
|
Supprimer l'association entre une écriture d'amortissement et
|
||||||
une écriture d'immobilisation
|
une écriture d'immobilisation
|
||||||
@param immo_line_id : id de la ligne d'immo
|
|
||||||
@param amort_line_id : id de la ligne d'amortissement
|
|
||||||
@param immo_doc_id : id du doc associé à l'immo
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param amort_line_id : id de la ligne d'amortissement
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* chercher l'écriture d'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
|
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
{{* écriture d'immobilisation *}}
|
||||||
{{#select
|
{{#select
|
||||||
id_transaction
|
id_transaction
|
||||||
FROM acc_transactions_lines
|
FROM acc_transactions_lines
|
||||||
WHERE id = :line_id;
|
WHERE id = :line_id;
|
||||||
:line_id = $_GET.immo_line_id|intval
|
:line_id = $info_immo.line
|
||||||
}}
|
}}
|
||||||
{{:assign immo_trans_id=$id_transaction}}
|
{{:assign immo_trans_id=$id_transaction}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Immobilisation non trouvée"}}
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* chercher l'écriture d'amortissement *}}
|
{{* écriture d'amortissement *}}
|
||||||
{{#select
|
{{#select
|
||||||
id_transaction
|
id_transaction
|
||||||
FROM acc_transactions_lines
|
FROM acc_transactions_lines
|
||||||
|
|
@ -69,11 +74,9 @@
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* marquer immo non soldée *}}
|
{{* marquer immo non soldée *}}
|
||||||
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}{{/load}}
|
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
status="managed"
|
status="managed"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{:redirect
|
{{:redirect to="amortization.html?immo_doc_id=%s&ok=1&msg=detach"|args:$_GET.immo_doc_id:}}
|
||||||
to="amortization.html?immo_line_id=%s&ok=1&msg=detach&immo_doc_id=%s"|args:$_GET.immo_line_id:$_GET.immo_doc_id}}
|
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,21 @@
|
||||||
{{*
|
{{*
|
||||||
Supprimer l'association entre une écriture d'immobilisation et
|
Supprimer l'association entre une écriture d'immobilisation et
|
||||||
une écriture au crédit du compte d'immobilisation
|
une écriture au crédit du compte d'immobilisation
|
||||||
@param immo_line_id : id de la ligne d'immo
|
|
||||||
@param credit__line_id : id de la ligne de crédit
|
|
||||||
@param immo_doc_id : id du doc associé à l'immo
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param credit_line_id : id de la ligne de crédit
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* chercher l'écriture d'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
|
{{#load type="immo" id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
id_transaction
|
id_transaction
|
||||||
FROM acc_transactions_lines
|
FROM acc_transactions_lines
|
||||||
WHERE id = :line_id;
|
WHERE id = :line_id;
|
||||||
:line_id = $_GET.immo_line_id|intval
|
:line_id = $info_immo.line
|
||||||
}}
|
}}
|
||||||
{{:assign immo_trans_id=$id_transaction}}
|
{{:assign immo_trans_id=$id_transaction}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
@ -68,6 +72,4 @@
|
||||||
{{:delete id=$id}}
|
{{:delete id=$id}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{:redirect
|
{{:redirect to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id}}
|
||||||
to="details_immo.html?immo_doc_id=%s&ok=1&msg=detach&"|args:$_GET.immo_doc_id}}
|
|
||||||
*}}
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
Afficher les détails d'une immmo
|
Afficher les détails d'une immmo
|
||||||
- permettre l'association d'une immo au crédit du compte de l'immo
|
- permettre l'association d'une immo au crédit du compte de l'immo
|
||||||
- permettre de modifier les paramètres de l'immo
|
- permettre de modifier les paramètres de l'immo
|
||||||
@param (OBSOLÈTE ?) immo_line_id : numéro de ligne de l'écriture d'immobilisation
|
|
||||||
@param immo_doc_id : numéro du doc d'immo
|
@param immo_doc_id : numéro du doc d'immo
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
|
|
@ -112,7 +111,7 @@
|
||||||
{{*/if*}}
|
{{*/if*}}
|
||||||
</aside>
|
</aside>
|
||||||
<nav style="margin-bottom: 1em;">
|
<nav style="margin-bottom: 1em;">
|
||||||
{{*:linkbutton shape="left" label="Retour à la liste des immobilisations" href="index.html*}}
|
{{:linkbutton shape="left" label="Retour à la liste des immobilisations" href="index.html}}
|
||||||
{{if $total_amort == 0}}
|
{{if $total_amort == 0}}
|
||||||
{{:linkbutton label="Modifier les paramètres" href="modify_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="edit" target="_dialog"}}
|
{{:linkbutton label="Modifier les paramètres" href="modify_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="edit" target="_dialog"}}
|
||||||
{{:linkbutton label="Supprimer les paramètres" href="delete_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="delete" target="_dialog"}}
|
{{:linkbutton label="Supprimer les paramètres" href="delete_infos.html?immo_doc_id=%s"|args:$_GET.immo_doc_id shape="delete" target="_dialog"}}
|
||||||
|
|
@ -156,7 +155,7 @@
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$line.amount|money_currency_html:false|raw}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{:linkbutton label="Détacher" href="detach_immo.html?credit_line_id=%d&immo_line_id=%d&immo_doc_id=%s"|args:$line.credit_line_id:$ligne_immo.immo_line_id:$_GET.immo_doc_id shape="minus"}}
|
{{:linkbutton label="Détacher" href="detach_immo.html?immo_doc_id=%s&credit_line_id=%s"|args:$_GET.immo_doc_id:$line.credit_line_id shape="minus"}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
|
||||||
|
|
@ -3,29 +3,29 @@
|
||||||
{{*
|
{{*
|
||||||
Lister les écritures d'amortissement indépendantes
|
Lister les écritures d'amortissement indépendantes
|
||||||
et proposer des les attacher à l'immo sélectionnée
|
et proposer des les attacher à l'immo sélectionnée
|
||||||
@param immo_line_id = id de la ligne d'immo
|
|
||||||
@param immo_doc_id id du doc d'immo associé
|
@param immo_doc_id id du doc d'immo associé
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* récupérer les infos de l'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
|
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||||
|
{{:assign label_immo=$label|or:$ligne_immo.label}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.label as label,
|
trans.label as label,
|
||||||
line.label as line_label
|
line.label as line_label
|
||||||
FROM acc_transactions_lines AS line
|
FROM acc_transactions_lines AS line
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||||
WHERE line.id = :line_id;
|
WHERE line.id = :line_id;
|
||||||
:line_id = $_GET.immo_line_id|intval
|
:line_id = $info_immo.line
|
||||||
assign=ligne_immo
|
assign="ligne_immo"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Immobilisation non trouvée"}}
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{#load id=$_GET.immo_doc_id|intval}}
|
|
||||||
{{:assign label_immo=$label|or:$ligne_immo.label}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Informations de l'immobilisation %s (%s) non trouvées"|args:$_GET.immo_line_id:$ligne_immo.label}}
|
|
||||||
{{/load}}
|
|
||||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $label_immo}}
|
||||||
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
{{:assign label_immo=$label_immo|cat:" — "|cat:$ligne_immo.line_label}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -138,11 +138,7 @@
|
||||||
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
<td><a href="{{$compte_url}}">{{$line.account_code}}</a></td>
|
||||||
<td>{{$line.account_label}}</td>
|
<td>{{$line.account_label}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $_GET.init == null}}
|
{{:linkbutton label="Attacher" href="attach_amort.html?immo_doc_id=%s&amort_line_id=%s"|args:$_GET.immo_doc_id:$line.amort_line_id shape="plus"}}
|
||||||
{{:linkbutton label="Attacher" href="attach_amort.html?amort_line_id=%d&immo_line_id=%d&immo_doc_id=%s"|args:$line.amort_line_id:$_GET.immo_line_id:$_GET.immo_doc_id shape="plus"}}
|
|
||||||
{{elseif $_GET.init}}
|
|
||||||
{{:linkbutton label="Attacher" href="attach_amort_init.html?amort_line_id=%d&immo_line_id=%d&immo_doc_id=%s"|args:$line.amort_line_id:$_GET.immo_line_id:$_GET.immo_doc_id shape="plus"}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,15 @@
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Créer une écriture d'amortissement
|
Créer une écriture d'amortissement
|
||||||
@param immo_line_id : id de la ligne d'immobilisation
|
|
||||||
@param immo_doc_id : id du doc associé à l'immo
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* Infos de l'immobilisation *}}
|
{{* Infos de l'immobilisation *}}
|
||||||
|
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
line.id_account as account_id,
|
line.id_account as account_id,
|
||||||
line.debit as montant,
|
line.debit as montant,
|
||||||
|
|
@ -21,37 +25,24 @@
|
||||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
INNER JOIN acc_accounts AS account ON line.id_account = account.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.immo_line_id|intval
|
:line_id = $info_immo.line
|
||||||
assign="ligne_immo"
|
assign="ligne_immo"
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Immobilisation non trouvée"}}
|
{{:error message="Immobilisation non trouvée"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{:assign date_debut=$ligne_immo.date}}
|
{{if $info_immo.amount != null}}
|
||||||
|
{{:assign var="ligne_immo.montant" value=$info_immo.amount}}
|
||||||
{{#load id=$_GET.immo_doc_id|intval assign="info_immo"}}
|
|
||||||
{{:assign duree=$duration}}
|
|
||||||
{{if $date_achat != null}}
|
|
||||||
{{:assign date_debut=$date_achat}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $date_mes != null}}
|
{{:assign date_debut=$info_immo.date_mes|or:$info_immo.date_achat|or:$ligne_immo.date}}
|
||||||
{{:assign date_debut=$date_mes}}
|
{{:assign amort_label=$info_immo.label|or:$ligne_immo.label}}
|
||||||
{{/if}}
|
|
||||||
{{:assign status=$status}}
|
|
||||||
{{:assign amort_label=$label|or:$ligne_immo.label}}
|
|
||||||
{{if $amount != null}}
|
|
||||||
{{:assign var="ligne_immo.montant" value=$amount}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
|
||||||
{{:error message="Informations de l'immobilisation « %s » non trouvées ; vous devez d'abord les renseigner"|args:$ligne_immo.label}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $amort_label}}
|
{{if $ligne_immo.line_label != null && $ligne_immo.line_label != $amort_label}}
|
||||||
{{:assign amort_label=$amort_label|cat:" — "|cat:$ligne_immo.line_label}}
|
{{:assign amort_label=$amort_label|cat:" — "|cat:$ligne_immo.line_label}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign var="amort_label" value="Amortissement %s"|args:$amort_label}}
|
{{:assign var="amort_label" value="Amortissement %s"|args:$amort_label}}
|
||||||
|
|
||||||
{{if $status == "amortized" || $status == "archived"}}
|
{{if $info_immo.status == "amortized" || $info_immo.status == "archived"}}
|
||||||
{{:error message="Cette immobilisation est complètement amortie ; il est impossible d'ajouter une écriture d'amortissement"}}
|
{{:error message="Cette immobilisation est complètement amortie ; il est impossible d'ajouter une écriture d'amortissement"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
@ -264,14 +255,14 @@
|
||||||
|
|
||||||
{{* immo soldée ? *}}
|
{{* immo soldée ? *}}
|
||||||
{{if $_POST.montant|trim|money_int == $solde}}
|
{{if $_POST.montant|trim|money_int == $solde}}
|
||||||
{{:assign status="amortized"}}
|
{{:assign var="info_immo.status" value="amortized"}}
|
||||||
{{:save
|
{{:save
|
||||||
key=$info_immo.key
|
key=$info_immo.key
|
||||||
status=$status
|
status=$info_immo.status
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:redirect force="amortization.html?immo_line_id=%s&immo_doc_id=%s&type_immo=%s&ok=1&msg=amortissement"|args:$_GET.immo_line_id:$_GET.immo_doc_id:$status}}
|
{{:redirect force="amortization.html?immo_doc_id=%s&type_immo=%s&ok=1&msg=amortissement"|args:$_GET.immo_doc_id:$info_immo.status}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{:admin_header title="Ajout amortissement" custom_css="./style.css" current="module_amortization"}}
|
{{:admin_header title="Ajout amortissement" custom_css="./style.css" current="module_amortization"}}
|
||||||
|
|
@ -288,7 +279,7 @@
|
||||||
{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}}
|
{{:include file="_calcul_dates.html" date_debut=$date_debut date_fin=$date_amort keep="nbjours"}}
|
||||||
|
|
||||||
{{* montant de l'amortissement *}}
|
{{* montant de l'amortissement *}}
|
||||||
{{:assign montant_amort="%f/%f/365*%d"|math:$ligne_immo.montant:$duree:$nbjours|intval}}
|
{{:assign montant_amort="%f/%f/365*%d"|math:$ligne_immo.montant:$info_immo.duration:$nbjours|intval}}
|
||||||
{{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.montant:$total_amort}}
|
{{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.montant:$total_amort}}
|
||||||
{{:assign var="debit_account.6811" value="6811 — Dot. aux amortissements des immobilisations"}}
|
{{:assign var="debit_account.6811" value="6811 — Dot. aux amortissements des immobilisations"}}
|
||||||
{{:assign var="credit_account.%s"|args:$code_amort value="%s — "|args:$code_amort|cat:$amort_account_label}}
|
{{:assign var="credit_account.%s"|args:$code_amort value="%s — "|args:$code_amort|cat:$amort_account_label}}
|
||||||
|
|
@ -325,7 +316,7 @@
|
||||||
}}
|
}}
|
||||||
<div id="donnees" class="hidden">
|
<div id="donnees" class="hidden">
|
||||||
{{:input type="text" name="montant_immo" default=$ligne_immo.montant}}
|
{{:input type="text" name="montant_immo" default=$ligne_immo.montant}}
|
||||||
{{:input type="text" name="duree_amort" default=$duree}}
|
{{:input type="text" name="duree_amort" default=$info_immo.duration}}
|
||||||
{{:input type="text" name="somme_amort" default=$total_amort}}
|
{{:input type="text" name="somme_amort" default=$total_amort}}
|
||||||
{{:input type="select" name="years_data" options=$years_data}}
|
{{:input type="select" name="years_data" options=$years_data}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue