Compare commits
No commits in common. "main" and "v0.41.3" have entirely different histories.
39 changed files with 283 additions and 214 deletions
|
|
@ -65,12 +65,13 @@
|
||||||
{{* chercher le doc de sortie du bilan *}}
|
{{* chercher le doc de sortie du bilan *}}
|
||||||
{{:assign var="immo_line.exit_date" value=null}}
|
{{:assign var="immo_line.exit_date" value=null}}
|
||||||
{{#load type="exit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id=$immo_doc_id}}
|
{{#load type="exit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id=$immo_doc_id}}
|
||||||
|
{{:assign exit_line_id=$exit_line_id}}
|
||||||
{{#select
|
{{#select
|
||||||
trans.date
|
trans.date
|
||||||
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 = :exit_line_id;
|
WHERE line.id = :exit_line_id;
|
||||||
:exit_line_id=$line_id
|
:exit_line_id=$exit_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign var="immo_line.exit_date" value=$date}}
|
{{:assign var="immo_line.exit_date" value=$date}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -85,7 +86,7 @@
|
||||||
}}
|
}}
|
||||||
{{if $amount == null}}
|
{{if $amount == null}}
|
||||||
{{#select credit FROM acc_transactions_lines WHERE id = :credit_line_id;
|
{{#select credit FROM acc_transactions_lines WHERE id = :credit_line_id;
|
||||||
:credit_line_id=$line_id
|
:credit_line_id=$credit_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
{{:assign total_credits="%d+%d"|math:$total_credits:$credit}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -105,7 +106,7 @@
|
||||||
line.credit
|
line.credit
|
||||||
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
|
||||||
INNER JOIN !table AS cession_link ON json_extract(cession_link.document, '$.line_id') = line.id
|
INNER JOIN !table AS cession_link ON json_extract(cession_link.document, '$.cession_line_id') = line.id
|
||||||
INNER JOIN !table AS immo_doc ON json_extract(cession_link.document, '$.immo_doc_id') = immo_doc.id
|
INNER JOIN !table AS immo_doc ON json_extract(cession_link.document, '$.immo_doc_id') = immo_doc.id
|
||||||
WHERE json_extract(immo_doc.document, '$.line') = :immo_line_id
|
WHERE json_extract(immo_doc.document, '$.line') = :immo_line_id
|
||||||
;
|
;
|
||||||
|
|
@ -147,7 +148,7 @@
|
||||||
{{:assign label_immo=$label_immo|cat:" — "|cat:$line_label}}
|
{{:assign label_immo=$label_immo|cat:" — "|cat:$line_label}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<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>{{$date_mes|date_short}}</td>
|
<td>{{$date_mes|date_short}}</td>
|
||||||
<td>{{$exit_date|date_short}}</td>
|
<td>{{$exit_date|date_short}}</td>
|
||||||
<td>{{$label_immo}}</td>
|
<td>{{$label_immo}}</td>
|
||||||
|
|
|
||||||
37
_attach_cession.html
Normal file
37
_attach_cession.html
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Enregistrer la liaison entre une écriture d'immobilisation et
|
||||||
|
une écriture de cession
|
||||||
|
@param immo_doc_id : id du document associé à l'immobilisation
|
||||||
|
@param cession_line_id : ligne de l'écriture de cession
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* données de l'immobilisation *}}
|
||||||
|
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id keep="info_immo, ligne_immo, message"}}
|
||||||
|
{{if $message != null}}
|
||||||
|
{{:error message=$message}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* chercher l'écriture de cession de l'immobilisation *}}
|
||||||
|
{{#select
|
||||||
|
id_transaction
|
||||||
|
FROM acc_transactions_lines
|
||||||
|
WHERE id = :line_id;
|
||||||
|
:line_id = $cession_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:assign cession_id=$id_transaction}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Impossible de trouver l'écriture de cession de l'immobilisation"}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{* Lier l'écriture de cession à l'écriture d'immobilisation *}}
|
||||||
|
{{:include file="_common_attach.html" immo_doc_id=$immo_doc_id trans_id=$cession_id}}
|
||||||
|
|
||||||
|
{{* enregistrer la liaison de l'écriture de cession *}}
|
||||||
|
{{:save
|
||||||
|
key=""|uuid
|
||||||
|
type="cession_link"
|
||||||
|
immo_doc_id=$info_immo.id
|
||||||
|
cession_line_id=$cession_line_id|intval
|
||||||
|
}}
|
||||||
37
_attach_exit.html
Normal file
37
_attach_exit.html
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Enregistrer la liaison entre une écriture d'immobilisation et
|
||||||
|
une écriture de sortie d'immobilisation
|
||||||
|
@param immo_doc_id : id du document associé à l'immobilisation
|
||||||
|
@param exit_line_id : ligne de l'écriture de sortie d'immobilisation
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* données de l'immobilisation *}}
|
||||||
|
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id keep="info_immo, ligne_immo, message"}}
|
||||||
|
{{if $message != null}}
|
||||||
|
{{:error message=$message}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{* chercher l'écriture de sortie d'immobilisation *}}
|
||||||
|
{{#select
|
||||||
|
id_transaction
|
||||||
|
FROM acc_transactions_lines
|
||||||
|
WHERE id = :line_id;
|
||||||
|
:line_id = $exit_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:assign rebut_id=$id_transaction}}
|
||||||
|
{{else}}
|
||||||
|
{{:error message="Impossible de trouver l'écriture de sortie d'immobilisation"}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
|
{{* Lier l'écriture de sortie à l'écriture d'immobilisation *}}
|
||||||
|
{{:include file="_common_attach.html" immo_doc_id=$immo_doc_id trans_id=$rebut_id}}
|
||||||
|
|
||||||
|
{{* enregistrer la liaison de l'écriture de sortie *}}
|
||||||
|
{{:save
|
||||||
|
key=""|uuid
|
||||||
|
type="exit_link"
|
||||||
|
immo_doc_id=$info_immo.id
|
||||||
|
exit_line_id=$exit_line_id|intval
|
||||||
|
}}
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{*
|
|
||||||
Enregistrer la liaison entre une ligne d'immobilisation et une ligne
|
|
||||||
@param immo_doc_id : id du document associé à l'immobilisation
|
|
||||||
@param line_id : ligne de l'écriture à associer
|
|
||||||
@param type : type de ligne à associer (cession, exit, ...)
|
|
||||||
*}}
|
|
||||||
|
|
||||||
{{* données de l'immobilisation *}}
|
|
||||||
{{:include file="_get_immo_data.html" immo_doc_id=$immo_doc_id keep="info_immo, ligne_immo, message"}}
|
|
||||||
{{if $message != null}}
|
|
||||||
{{:error message=$message}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* chercher l'écriture de la ligne à associer *}}
|
|
||||||
{{#select
|
|
||||||
id_transaction
|
|
||||||
FROM acc_transactions_lines
|
|
||||||
WHERE id = :line_id;
|
|
||||||
:line_id = $line_id|intval
|
|
||||||
}}
|
|
||||||
{{:assign trans_id=$id_transaction}}
|
|
||||||
{{else}}
|
|
||||||
{{if $type == "cession"}}
|
|
||||||
{{:assign mtype="cession"}}
|
|
||||||
{{elseif $type == "exit"}}
|
|
||||||
{{:assign mtype="sortie"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:error message="Impossible de trouver l'écriture de %s de l'immobilisation"|args:$mtype}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
{{* Lier cette écriture à l'écriture d'immobilisation *}}
|
|
||||||
{{:include file="_common_attach.html" immo_doc_id=$immo_doc_id trans_id=$trans_id}}
|
|
||||||
|
|
||||||
{{* enregistrer la liaison *}}
|
|
||||||
{{:assign link_type=$type|cat:"_link"}}
|
|
||||||
{{:save
|
|
||||||
key=""|uuid
|
|
||||||
type=$link_type
|
|
||||||
immo_doc_id=$info_immo.id
|
|
||||||
line_id=$line_id|intval
|
|
||||||
}}
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
Supprimer l'association entre une ligne d'immobilisation et une ligne associée
|
Supprimer l'association entre une ligne d'immo et une autre ligne (amort, credit, cession, sortie)
|
||||||
@param immo_doc_id : id du doc associé à l'immo
|
@param immo_doc_id : id du doc associé à la ligne d'immobilisation
|
||||||
@param line_id : id de la ligne associée
|
@param line_id : id de la ligne à détacher
|
||||||
@param type : type de ligne associée (amort, credit, cession, exit, ...)
|
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{* données de l'immobilisation *}}
|
{{* données de l'immobilisation *}}
|
||||||
|
|
@ -51,23 +50,3 @@
|
||||||
assign_code="result_code"
|
assign_code="result_code"
|
||||||
transactions=$linked_transactions
|
transactions=$linked_transactions
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{* supprimer le doc de liaison entre les lignes *}}
|
|
||||||
{{:assign link_type=$type|cat:"_link"}}
|
|
||||||
{{#load type=$link_type
|
|
||||||
where="$$.immo_doc_id = :immo_doc_id AND $$.line_id = :line_id"
|
|
||||||
:immo_doc_id=$immo_doc_id|intval
|
|
||||||
:line_id = $line_id|intval
|
|
||||||
}}
|
|
||||||
{{:delete id=$id}}
|
|
||||||
{{/load}}
|
|
||||||
|
|
||||||
{{if $type == "amort"}}
|
|
||||||
{{if $info_immo.status == "amortized"}}
|
|
||||||
{{* marquer immo non soldée *}}
|
|
||||||
{{:save
|
|
||||||
key=$info_immo.key
|
|
||||||
status="managed"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
27
_detach_amort.html
Normal file
27
_detach_amort.html
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Supprimer l'association entre une écriture d'amortissement et
|
||||||
|
une écriture d'immobilisation
|
||||||
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param amort_line_id : id de la ligne d'amortissement
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:include file="_common_detach.html" immo_doc_id=$immo_doc_id line_id=$amort_line_id keep="info_immo"}}
|
||||||
|
|
||||||
|
{{* supprimer le doc de liaison entre les lignes *}}
|
||||||
|
{{#load type="amort_link"
|
||||||
|
where="$$.immo_doc_id = :immo_doc_id AND $$.amort_line_id = :amort_line_id"
|
||||||
|
:immo_doc_id=$immo_doc_id|intval
|
||||||
|
:amort_line_id = $amort_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:delete id=$id}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
{{* marquer immo non soldée *}}
|
||||||
|
{{if $info_immo.status == "amortized"}}
|
||||||
|
{{:save
|
||||||
|
key=$info_immo.key
|
||||||
|
status="managed"
|
||||||
|
}}
|
||||||
|
{{/if}}
|
||||||
19
_detach_cession.html
Normal file
19
_detach_cession.html
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Supprimer l'association entre une écriture d'immobilisation et
|
||||||
|
une écriture de cession
|
||||||
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param cession_line_id : id de la ligne de cession
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:include file="_common_detach.html" immo_doc_id=$immo_doc_id line_id=$cession_line_id}}
|
||||||
|
|
||||||
|
{{* supprimer le doc de liaison entre les lignes *}}
|
||||||
|
{{#load type="cession_link"
|
||||||
|
where="$$.immo_doc_id = :immo_doc_id AND $$.cession_line_id = :cession_line_id"
|
||||||
|
:immo_doc_id=$immo_doc_id|intval
|
||||||
|
:cession_line_id = $cession_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:delete id=$id}}
|
||||||
|
{{/load}}
|
||||||
19
_detach_credit.html
Normal file
19
_detach_credit.html
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Supprimer l'association entre une écriture d'immobilisation et
|
||||||
|
une écriture au crédit du compte d'immobilisation
|
||||||
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param credit_line_id : id de la ligne de crédit
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:include file="_common_detach.html" immo_doc_id=$immo_doc_id line_id=$credit_line_id}}
|
||||||
|
|
||||||
|
{{* supprimer le doc de liaison entre les lignes *}}
|
||||||
|
{{#load type="credit_link"
|
||||||
|
where="$$.immo_doc_id = :immo_doc_id AND $$.credit_line_id = :credit_line_id"
|
||||||
|
:immo_doc_id=$immo_doc_id|intval
|
||||||
|
:credit_line_id = $credit_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:delete id=$id}}
|
||||||
|
{{/load}}
|
||||||
19
_detach_exit.html
Normal file
19
_detach_exit.html
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Supprimer l'association entre une écriture d'immobilisation et
|
||||||
|
une écriture de sortie de bilan
|
||||||
|
@param immo_doc_id : id du doc associé à l'immo
|
||||||
|
@param exit_line_id : id de la ligne de sortie de bilan
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:include file="_common_detach.html" immo_doc_id=$immo_doc_id line_id=$exit_line_id}}
|
||||||
|
|
||||||
|
{{* supprimer le doc de liaison entre les lignes *}}
|
||||||
|
{{#load type="exit_link"
|
||||||
|
where="$$.immo_doc_id = :immo_doc_id AND $$.exit_line_id = :exit_line_id"
|
||||||
|
:immo_doc_id=$immo_doc_id|intval
|
||||||
|
:exit_line_id = $exit_line_id|intval
|
||||||
|
}}
|
||||||
|
{{:delete id=$id}}
|
||||||
|
{{/load}}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
@result total_amort : montant total des amortissements de l'immobilisation
|
@result total_amort : montant total des amortissements de l'immobilisation
|
||||||
@result created_amort : vrai s'il y a au moins un amortissement créé par le module dans la liste
|
@result created_amort : vrai s'il y a au moins un amortissement créé par le module dans la liste
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{:assign total_amort=0}}
|
{{:assign total_amort=0}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.immo_doc_id = :immo_doc_id"
|
where="$$.immo_doc_id = :immo_doc_id"
|
||||||
|
|
@ -30,7 +31,7 @@
|
||||||
INNER join acc_accounts AS account on line.id_account = account.id
|
INNER join acc_accounts AS account on line.id_account = account.id
|
||||||
WHERE line.id = :amort_line_id
|
WHERE line.id = :amort_line_id
|
||||||
;
|
;
|
||||||
:amort_line_id = $amort_info.line_id
|
:amort_line_id = $amort_line_id
|
||||||
assign="amort_line"
|
assign="amort_line"
|
||||||
}}
|
}}
|
||||||
{{:assign var="amort_line.amount" value=$amort_info.amount|or:$amort_line.amount}}
|
{{:assign var="amort_line.amount" value=$amort_info.amount|or:$amort_line.amount}}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
*}}
|
*}}
|
||||||
{{:assign linked_immos=null}}
|
{{:assign linked_immos=null}}
|
||||||
{{:assign total_credits=0}}
|
{{:assign total_credits=0}}
|
||||||
{{#load type="credit_link" where="$$.immo_doc_id=:immo_doc_id" :immo_doc_id=$immo_doc_id|intval assign="credit_info"}}
|
{{#load type="credit_link" where="$$.immo_doc_id=:immo_doc_id" :immo_doc_id=$immo_doc_id|intval}}
|
||||||
{{#select
|
{{#select
|
||||||
line.credit,
|
line.credit,
|
||||||
line.id as line_id,
|
line.id as line_id,
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
||||||
INNER join acc_accounts AS account on line.id_account = account.id
|
INNER join acc_accounts AS account on line.id_account = account.id
|
||||||
WHERE line.id = :credit_line_id;
|
WHERE line.id = :credit_line_id;
|
||||||
:credit_line_id=$credit_info.line_id
|
:credit_line_id=$credit_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign credit=$credit}}
|
{{:assign credit=$credit}}
|
||||||
{{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date account_id=$account_id account_code=$account_code account_label=$account_label year=$year}}
|
{{:assign var="linked_immos." doc=$id trans_id=$trans_id credit_line_id=$line_id label=$label amount=$credit date=$date account_id=$account_id account_code=$account_code account_label=$account_label year=$year}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
{{:assign keep_amort=true}}
|
{{:assign keep_amort=true}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.line_id = :amort_line_id"
|
where="$$.amort_line_id = :amort_line_id"
|
||||||
:amort_line_id=$amort_line.line_id|intval
|
:amort_line_id=$amort_line.line_id|intval
|
||||||
assign="amort_link"
|
assign="amort_link"
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
}}
|
}}
|
||||||
{{if $amount == null}}
|
{{if $amount == null}}
|
||||||
{{#select credit FROM acc_transactions_lines WHERE id = :credit_line_id;
|
{{#select credit FROM acc_transactions_lines WHERE id = :credit_line_id;
|
||||||
:credit_line_id=$line_id
|
:credit_line_id=$credit_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign montant_immo="%d-%d"|math:$montant_immo:$credit}}
|
{{:assign montant_immo="%d-%d"|math:$montant_immo:$credit}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
{{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$montant_immo}}
|
{{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$montant_immo}}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$immo_trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$immo_trans_id}}</a></td>
|
||||||
<td>{{$immo_date|date_short}}</td>
|
<td>{{$immo_date|date_short}}</td>
|
||||||
<td>{{$label_immo}}</td>
|
<td>{{$label_immo}}</td>
|
||||||
<td class="money">{{$montant_immo|money_html:false|raw}}</td>
|
<td class="money">{{$montant_immo|money_html:false|raw}}</td>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign unhide=1}}
|
{{:assign unhide=1}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign var="user_hides.unhide_other" value=$unhide}}
|
{{:assign var="user_hides.unhide_other" value=$unhide"}}
|
||||||
{{:assign var="saved_hides.%s"|args:$logged_user.id value=$user_hides}}
|
{{:assign var="saved_hides.%s"|args:$logged_user.id value=$user_hides}}
|
||||||
{{:save key="config" hides=$saved_hides}}
|
{{:save key="config" hides=$saved_hides}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
{{:assign checked="checked"}}
|
{{:assign checked="checked"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* vérifier l'existence de la table du module' *}}
|
{{* vérifier l'existence de la table du module *}}
|
||||||
{{if $module.table != null}}
|
{{if $module.table != null}}
|
||||||
{{:assign columns="$$.status as status, SUM($$.amount) as amount,"}}
|
{{:assign columns="$$.status as status, SUM($$.amount) as amount,"}}
|
||||||
{{:assign table_join="LEFT JOIN !table AS info ON $$.line = line.id"}}
|
{{:assign table_join="LEFT JOIN !table AS info ON $$.line = line.id"}}
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
lister les immobilisations non prises en charge par le module
|
lister les immobilisations non prises en charge par le module
|
||||||
ou dont le montant n'a pas été totalement affecté'
|
ou dont le montant n'a pas été totalement affecté
|
||||||
*}}
|
*}}
|
||||||
{{:assign account_condition="("}}
|
{{:assign account_condition="("}}
|
||||||
{{#foreach from=$module.config.prefixes item="code"}}
|
{{#foreach from=$module.config.prefixes item="code"}}
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.trans_id_year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.trans_id_year}}
|
||||||
{{:assign reste="%d-%d"|math:$line.debit:$line.amount}}
|
{{:assign reste="%d-%d"|math:$line.debit:$line.amount}}
|
||||||
<tr {{if $status == "ignored"}}class="ignored"{{/if}}>
|
<tr {{if $status == "ignored"}}class="ignored"{{/if}}>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.immo_trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.immo_trans_id}}</a></td>
|
||||||
<td class="nombre">{{$line.immo_line_id}}</td>
|
<td class="nombre">{{$line.immo_line_id}}</td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
<td>{{$line.trans_label}}{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}</td>
|
<td>{{$line.trans_label}}{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}</td>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
{{if $module.table}}
|
{{if $module.table}}
|
||||||
{{* supprimer les documents sans écriture associée *}}
|
{{* supprimer les documents sans écriture associée *}}
|
||||||
|
{{:assign var="docs." type="amort_link" field="amort_line_id"}}
|
||||||
|
{{:assign var="docs." type="credit_link" field="credit_line_id"}}
|
||||||
|
{{:assign var="docs." type="cession_link" field="cession_line_id"}}
|
||||||
|
{{:assign var="docs." type="exit_link" field="exit_line_id"}}
|
||||||
{{:assign var="docs." type="immo" field="line"}}
|
{{:assign var="docs." type="immo" field="line"}}
|
||||||
{{:assign var="docs." type="amort_link" field="line_id"}}
|
|
||||||
{{:assign var="docs." type="credit_link" field="line_id"}}
|
|
||||||
{{:assign var="docs." type="cession_link" field="line_id"}}
|
|
||||||
{{:assign var="docs." type="exit_link" field="line_id"}}
|
|
||||||
|
|
||||||
{{#foreach from=$docs}}
|
{{#foreach from=$docs}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign unhide=1}}
|
{{:assign unhide=1}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign var="user_hides.unhide_unfinished" value=$unhide}}
|
{{:assign var="user_hides.unhide_unfinished" value=$unhide"}}
|
||||||
{{:assign var="saved_hides.%s"|args:$logged_user.id value=$user_hides}}
|
{{:assign var="saved_hides.%s"|args:$logged_user.id value=$user_hides}}
|
||||||
{{:save key="config" hides=$saved_hides}}
|
{{:save key="config" hides=$saved_hides}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
|
|
||||||
<tr {{if $ignore}}class="checked"{{/if}}>
|
<tr {{if $ignore}}class="checked"{{/if}}>
|
||||||
<td class="check">{{:input type="checkbox" name="selected[]" value=$trans_id}}</td>
|
<td class="check">{{:input type="checkbox" name="selected[]" value=$trans_id}}</td>
|
||||||
<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>
|
||||||
<td>{{$trans_label}}</td>
|
<td>{{$trans_label}}</td>
|
||||||
<td class="money">{{"%f"|math:$debit|money_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$debit|money_html:false|raw}}</td>
|
||||||
|
|
|
||||||
|
|
@ -34,21 +34,6 @@
|
||||||
<p class="block info">Mise à jour vers version {{$tag}} terminée</p>
|
<p class="block info">Mise à jour vers version {{$tag}} terminée</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* version 0.42 *}}
|
|
||||||
{{:assign tag="0.42"}}
|
|
||||||
|
|
||||||
{{:include file="_compare_version.tpl" nv1=$module_version nv2=$tag keep="comp"}}
|
|
||||||
{{:assign module_comp=$comp}}
|
|
||||||
{{:include file="_compare_version.tpl" nv1=$module.config.version nv2=$tag keep="comp"}}
|
|
||||||
{{:assign config_comp=$comp}}
|
|
||||||
|
|
||||||
{{if $module_comp >= 0 && $config_comp < 0}}
|
|
||||||
{{* $module_version >= '0.42' && $module.config.version < '0.42' *}}
|
|
||||||
|
|
||||||
{{:include file="_upgrade_to042.tpl"}}
|
|
||||||
<p class="block info">Mise à jour vers version {{$tag}} terminée</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* enregistrer le nouveau numéro de version dans la config du module *}}
|
{{* enregistrer le nouveau numéro de version dans la config du module *}}
|
||||||
{{:include file="_compare_version.tpl" nv1=$module_version nv2=$module.config.version keep="comp"}}
|
{{:include file="_compare_version.tpl" nv1=$module_version nv2=$module.config.version keep="comp"}}
|
||||||
{{if $comp > 0}}
|
{{if $comp > 0}}
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
{{* remplacer xxx_line_id par line_id pour simplifier et mutualiser le code *}}
|
|
||||||
|
|
||||||
{{:assign var="link_types." type="amort"}}
|
|
||||||
{{:assign var="link_types." type="credit"}}
|
|
||||||
{{:assign var="link_types." type="cession"}}
|
|
||||||
{{:assign var="link_types." type="exit"}}
|
|
||||||
|
|
||||||
{{* lister les liens actuels *}}
|
|
||||||
{{#foreach from=$link_types}}
|
|
||||||
{{:assign link_type=$type|cat:"_link"}}
|
|
||||||
{{:assign line_id=$type|cat:"_line_id"}}
|
|
||||||
{{#load type=$link_type assign="link"}}
|
|
||||||
{{:assign new_link=null}}
|
|
||||||
{{:assign var="new_link.key" value=$link.key}}
|
|
||||||
{{:assign var="new_link.type" value=$link.type}}
|
|
||||||
{{:assign var="new_link.immo_doc_id" value=$link.immo_doc_id}}
|
|
||||||
{{:assign var="new_link.line_id" from="link.%s"|args:$line_id}}
|
|
||||||
{{:assign var="new_link.amount" value=$link.amount}}
|
|
||||||
{{:assign var="new_link.created" value=$link.created}}
|
|
||||||
{{* mémoriser les infos des docs *}}
|
|
||||||
{{:assign var="new_links." value=$new_link}}
|
|
||||||
{{/load}}
|
|
||||||
{{:delete type=$link_type}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{* créer les nouveaux documents de liaisons *}}
|
|
||||||
{{#foreach from=$new_links item="link"}}
|
|
||||||
{{:save
|
|
||||||
key=$link.key
|
|
||||||
type=$link.type
|
|
||||||
immo_doc_id=$link.immo_doc_id
|
|
||||||
line_id=$link.line_id
|
|
||||||
amount=$link.amount
|
|
||||||
created=$link.created
|
|
||||||
}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<span class="num"><a href="{{$trans_url}}">{{$ligne_immo.immo_trans_id}}</a> </span>{{$immo_label}}
|
<span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.immo_trans_id}}</a> </span>{{$immo_label}}
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$ligne_immo.montant|money_currency_html:false|raw}}</dd>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
une écriture au crédit du compte d'immobilisation
|
une écriture au crédit du compte d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_credit"}}
|
{{#form on="detach_credit"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_credit type="credit"}}
|
{{:include file="_detach_credit.html" immo_doc_id=$_POST.immo_doc_id credit_line_id=$_POST.detach_credit}}
|
||||||
{{:redirect to="?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_POST.immo_doc_id}}
|
{{:redirect to="?immo_doc_id=%s&ok=1&msg=detach_avoir"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
une écriture d'immobilisation
|
une écriture d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_amort"}}
|
{{#form on="detach_amort"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_amort type="amort"}}
|
{{:include file="_detach_amort.html" immo_doc_id=$_POST.immo_doc_id amort_line_id=$_POST.detach_amort}}
|
||||||
{{:redirect to="?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_POST.immo_doc_id:}}
|
{{:redirect to="?immo_doc_id=%s&ok=1&msg=detach_amort"|args:$_POST.immo_doc_id:}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||||
<dt>Début d'amortissement</dt>
|
<dt>Début d'amortissement</dt>
|
||||||
|
|
@ -200,7 +200,7 @@
|
||||||
{{#foreach from=$linked_immos item="line"}}
|
{{#foreach from=$linked_immos item="line"}}
|
||||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>{{$line.label}}</td>
|
<td>{{$line.label}}</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>
|
||||||
|
|
@ -260,7 +260,7 @@
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
{{:assign solde="%f-%d"|math:$solde:$line.amount}}
|
{{:assign solde="%f-%d"|math:$solde:$line.amount}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{$line.trans_label}}
|
{{$line.trans_label}}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
{{* montant de l'écriture d'amortissement déjà affecté *}}
|
{{* montant de l'écriture d'amortissement déjà affecté *}}
|
||||||
{{:assign montant_affecte=0}}
|
{{:assign montant_affecte=0}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.line_id = :amort_line_id"
|
where="$$.amort_line_id = :amort_line_id"
|
||||||
:amort_line_id = $_GET.amort_line_id|intval
|
:amort_line_id = $_GET.amort_line_id|intval
|
||||||
}}
|
}}
|
||||||
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
{{* vérifier si cette liaison est déjà présente dans les documents pour éviter les doublons *}}
|
{{* vérifier si cette liaison est déjà présente dans les documents pour éviter les doublons *}}
|
||||||
{{* TODO voir si nécessaire ? *}}
|
{{* TODO voir si nécessaire ? *}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.immo_doc_id = :immo_doc_id AND $$.line_id = :amort_line_id"
|
where="$$.immo_doc_id = :immo_doc_id AND $$.amort_line_id = :amort_line_id"
|
||||||
:immo_doc_id=$_GET.immo_doc_id|intval
|
:immo_doc_id=$_GET.immo_doc_id|intval
|
||||||
:amort_line_id = $_GET.amort_line_id|intval
|
:amort_line_id = $_GET.amort_line_id|intval
|
||||||
limit=1
|
limit=1
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="amort_link"
|
type="amort_link"
|
||||||
immo_doc_id=$_GET.immo_doc_id|intval
|
immo_doc_id=$_GET.immo_doc_id|intval
|
||||||
line_id=$_GET.amort_line_id|intval
|
amort_line_id=$_GET.amort_line_id|intval
|
||||||
amount=$saved_amount
|
amount=$saved_amount
|
||||||
}}
|
}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd>{{$label_immo}}</dd>
|
<dd>{{$label_immo}}</dd>
|
||||||
<dt>Amortissement</dt>
|
<dt>Amortissement</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$amort_line.trans_id}}</a></span> {{$amort_label}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$amort_line.trans_id}}</a></span> {{$amort_label}}</dd>
|
||||||
<dt>Montant de l'écriture d'amortissement</dt>
|
<dt>Montant de l'écriture d'amortissement</dt>
|
||||||
<dd>{{$amort_line.amount|money_currency_html:false|raw}}</dd>
|
<dd>{{$amort_line.amount|money_currency_html:false|raw}}</dd>
|
||||||
{{if $montant_affecte > 0}}
|
{{if $montant_affecte > 0}}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
{{* montant de l'écriture de crédit déjà affecté *}}
|
{{* montant de l'écriture de crédit déjà affecté *}}
|
||||||
{{:assign montant_affecte=0}}
|
{{:assign montant_affecte=0}}
|
||||||
{{#load type="credit_link"
|
{{#load type="credit_link"
|
||||||
where="$$.line_id = :credit_line_id"
|
where="$$.credit_line_id = :credit_line_id"
|
||||||
:credit_line_id = $_GET.credit_line_id|intval
|
:credit_line_id = $_GET.credit_line_id|intval
|
||||||
}}
|
}}
|
||||||
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
{{:assign montant_affecte="%d+%d"|math:$montant_affecte:$amount}}
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="credit_link"
|
type="credit_link"
|
||||||
immo_doc_id=$_GET.immo_doc_id|intval
|
immo_doc_id=$_GET.immo_doc_id|intval
|
||||||
line_id=$_GET.credit_line_id|intval
|
credit_line_id=$_GET.credit_line_id|intval
|
||||||
amount=$saved_credit
|
amount=$saved_credit
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd>{{$label_immo}}</dd>
|
<dd>{{$label_immo}}</dd>
|
||||||
<dt>Écriture au crédit du compte d'immobilisation</dt>
|
<dt>Écriture au crédit du compte d'immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$credit_trans_url}}">{{$credit_line.trans_id}}</a></span> {{$credit_line.trans_label}}{{if $credit_line.line_label != null && $credit_line.line_label != $credit_line.trans_label}} — {{$credit_line.line_label}}{{/if}}</dd>
|
<dd><span class="num"><a href="{{$credit_trans_url}}">#{{$credit_line.trans_id}}</a></span> {{$credit_line.trans_label}}{{if $credit_line.line_label != null && $credit_line.line_label != $credit_line.trans_label}} — {{$credit_line.line_label}}{{/if}}</dd>
|
||||||
<dt>Montant de l'écriture</dt>
|
<dt>Montant de l'écriture</dt>
|
||||||
<dd>{{$credit_line.amount|money_currency_html:false|raw}}</dd>
|
<dd>{{$credit_line.amount|money_currency_html:false|raw}}</dd>
|
||||||
<dt>Montant déjà affecté</dt>
|
<dt>Montant déjà affecté</dt>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
{{#select
|
{{#select
|
||||||
trans.id
|
trans.id
|
||||||
FROM acc_transactions_lines AS line
|
FROM acc_transactions_lines AS line
|
||||||
INNER JOIN !table AS credit_link ON $$.line_id = line.id
|
INNER JOIN !table AS credit_link ON $$.credit_line_id = line.id
|
||||||
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 $$.type = "credit_link" AND $$.immo_doc_id = :immo_doc_id
|
WHERE $$.type = "credit_link" AND $$.immo_doc_id = :immo_doc_id
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
une écriture au crédit du compte d'immobilisation
|
une écriture au crédit du compte d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_credit"}}
|
{{#form on="detach_credit"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_credit type="credit"}}
|
{{:include file="_detach_credit.html" immo_doc_id=$_POST.immo_doc_id credit_line_id=$_POST.detach_credit}}
|
||||||
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_avoir"|args:$_POST.immo_doc_id}}
|
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_avoir"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -56,15 +56,15 @@
|
||||||
FROM acc_transactions AS trans
|
FROM acc_transactions AS trans
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
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 module_data_amortization AS mda ON json_extract(mda.document, '$.line_id') = line.id
|
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||||
WHERE
|
WHERE
|
||||||
account.code LIKE :account_code
|
account.code LIKE :account_code
|
||||||
AND line.credit > 0
|
AND line.credit > 0
|
||||||
AND credit_line_id NOT IN (
|
AND credit_line_id NOT IN (
|
||||||
SELECT json_extract(credit_link.document, '$.line_id') AS line_id FROM !table as credit_link
|
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||||
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
||||||
UNION
|
UNION
|
||||||
SELECT json_extract(exit_link.document, '$.line_id') AS line_id FROM !table as exit_link
|
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
{{:assign keep_amort=true}}
|
{{:assign keep_amort=true}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.line_id = :amort_line_id"
|
where="$$.amort_line_id = :amort_line_id"
|
||||||
:amort_line_id=$amort_line.amort_line_id
|
:amort_line_id=$amort_line.amort_line_id
|
||||||
assign="amort_link"
|
assign="amort_link"
|
||||||
}}
|
}}
|
||||||
|
|
@ -152,7 +152,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||||
<dt>Montant de l'immobilisation</dt>
|
<dt>Montant de l'immobilisation</dt>
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>{{$line.label}}</td>
|
<td>{{$line.label}}</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>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
une écriture d'immobilisation
|
une écriture d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_amort"}}
|
{{#form on="detach_amort"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_amort type="amort"}}
|
{{:include file="_detach_amort.html" immo_doc_id=$_POST.immo_doc_id amort_line_id=$_POST.detach_amort}}
|
||||||
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_amort"|args:$_POST.immo_doc_id}}
|
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_amort"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
{{:assign keep_amort=true}}
|
{{:assign keep_amort=true}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.line_id = :amort_line_id"
|
where="$$.amort_line_id = :amort_line_id"
|
||||||
:amort_line_id=$amort_line.amort_line_id|intval
|
:amort_line_id=$amort_line.amort_line_id|intval
|
||||||
assign="amort_link"
|
assign="amort_link"
|
||||||
}}
|
}}
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||||
<dt>Montant de l'immobilisation</dt>
|
<dt>Montant de l'immobilisation</dt>
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $line.line_label != null}}
|
{{if $line.line_label != null}}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
une écriture de cession
|
une écriture de cession
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_cession"}}
|
{{#form on="detach_cession"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_cession type="cession"}}
|
{{:include file="_detach_cession.html" immo_doc_id=$_POST.immo_doc_id cession_line_id=$_POST.detach_cession}}
|
||||||
{{:redirect to="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}}
|
{{:redirect to="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=detach_cession"|args:$_GET.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
{{* voir si l'écriture de cession est déjà liée à une immo *}}
|
{{* voir si l'écriture de cession est déjà liée à une immo *}}
|
||||||
{{* TODO VOIR SI UTILE
|
{{* TODO VOIR SI UTILE
|
||||||
{{#load type="cession_link"
|
{{#load type="cession_link"
|
||||||
where="$$.line_id = :cession_line_id"
|
where="$$.cession_line_id = :cession_line_id"
|
||||||
:cession_line_id = $line.line_id
|
:cession_line_id = $line.line_id
|
||||||
assign="cession_link"
|
assign="cession_link"
|
||||||
}}
|
}}
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||||
<dt>Montant de l'immobilisation</dt>
|
<dt>Montant de l'immobilisation</dt>
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $line.line_label != null}}
|
{{if $line.line_label != null}}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
{{#select credit
|
{{#select credit
|
||||||
FROM acc_transactions_lines
|
FROM acc_transactions_lines
|
||||||
WHERE id = :cession_line_id;
|
WHERE id = :cession_line_id;
|
||||||
:cession_line_id = $line_id
|
:cession_line_id = $cession_line_id
|
||||||
}}
|
}}
|
||||||
{{:assign montant_cession=$credit}}
|
{{:assign montant_cession=$credit}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||||
WHERE line.id = :exit_line_id;
|
WHERE line.id = :exit_line_id;
|
||||||
:exit_line_id = $exit_info.line_id
|
:exit_line_id = $exit_info.exit_line_id
|
||||||
assign="exit_line"
|
assign="exit_line"
|
||||||
}}
|
}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
@ -125,15 +125,15 @@
|
||||||
FROM acc_transactions AS trans
|
FROM acc_transactions AS trans
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||||
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.line_id') = line.id
|
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||||
WHERE
|
WHERE
|
||||||
acc.code = :acc_code
|
acc.code = :acc_code
|
||||||
AND line.credit > 0
|
AND line.credit > 0
|
||||||
AND credit_line_id NOT IN (
|
AND credit_line_id NOT IN (
|
||||||
SELECT json_extract(credit_link.document, '$.line_id') AS line_id FROM !table as credit_link
|
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||||
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
||||||
UNION
|
UNION
|
||||||
SELECT json_extract(exit_link.document, '$.line_id') AS line_id FROM !table as exit_link
|
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
{{:assign amort_amount=0}}
|
{{:assign amort_amount=0}}
|
||||||
{{:assign keep_amort=true}}
|
{{:assign keep_amort=true}}
|
||||||
{{#load type="amort_link"
|
{{#load type="amort_link"
|
||||||
where="$$.line_id = :amort_line_id"
|
where="$$.amort_line_id = :amort_line_id"
|
||||||
:amort_line_id=$amort_line.amort_line_id|intval
|
:amort_line_id=$amort_line.amort_line_id|intval
|
||||||
assign="amort_link"
|
assign="amort_link"
|
||||||
}}
|
}}
|
||||||
|
|
@ -224,7 +224,7 @@
|
||||||
une écriture de sortie de bilan
|
une écriture de sortie de bilan
|
||||||
*}}
|
*}}
|
||||||
{{#form on="detach_exit"}}
|
{{#form on="detach_exit"}}
|
||||||
{{:include file="_detach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.detach_exit type="exit"}}
|
{{:include file="_detach_exit.html" immo_doc_id=$_POST.immo_doc_id exit_line_id=$_POST.detach_exit}}
|
||||||
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_exit"|args:$_POST.immo_doc_id}}
|
{{:redirect to="?immo_doc_id=%s&from=exit&ok=1&msg=detach_exit"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -247,7 +247,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}</dd>
|
||||||
<dt>Montant de l'immobilisation</dt>
|
<dt>Montant de l'immobilisation</dt>
|
||||||
|
|
@ -332,7 +332,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$exit_url}}">{{$exit_line.trans_id}}</a></td>
|
<td class="num"><a href="{{$exit_url}}">#{{$exit_line.trans_id}}</a></td>
|
||||||
<td>{{$exit_line.date|date_short}}</td>
|
<td>{{$exit_line.date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $exit_line.line_label != null}}
|
{{if $exit_line.line_label != null}}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Écriture</dt>
|
<dt>Écriture</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$ligne_immo.label}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
{{:include file="_nav.html" current=$type_immo}}
|
{{:include file="_nav.html" current=$type_immo}}
|
||||||
|
|
||||||
{{* Mise à niveau *}}
|
{{* Mise à niveau *}}
|
||||||
{{:assign module_version="0.42"}}
|
{{:assign module_version="0.41"}}
|
||||||
{{:include file="_upgrade.html" module_version=$module_version}}
|
{{:include file="_upgrade.html" module_version=$module_version}}
|
||||||
|
|
||||||
{{* supprimer les documents sans écriture associée *}}
|
{{* supprimer les documents sans écriture associée *}}
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,45 @@
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"exclusiveMinimum": 0
|
"exclusiveMinimum": 0
|
||||||
},
|
},
|
||||||
"line_id" : {
|
"amort_line_id" : {
|
||||||
"description": "ligne d'écriture associée à l'immobilisation",
|
"description": "ligne d'amortissement associée à l'immobilisation",
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0
|
||||||
|
},
|
||||||
|
"credit_line_id": {
|
||||||
|
"description": "ligne au crédit du compte de l'immobilisation",
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0
|
||||||
|
},
|
||||||
|
"exit_line_id": {
|
||||||
|
"description": "ligne de sortie du bilan de l'immobilisation",
|
||||||
|
"type": "integer",
|
||||||
|
"exclusiveMinimum": 0
|
||||||
|
},
|
||||||
|
"cession_line_id": {
|
||||||
|
"description": "ligne de cession de l'immobilisation",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"exclusiveMinimum": 0
|
"exclusiveMinimum": 0
|
||||||
},
|
},
|
||||||
"amount": {
|
"amount": {
|
||||||
"description": "montant de la ligne associée à l'immobilisation",
|
"description": "montant de la ligne d'amortissement ou de crédit",
|
||||||
"type": ["number", "null"]
|
"type": ["number", "null"]
|
||||||
},
|
},
|
||||||
"created" : {
|
"created" : {
|
||||||
"description" : "vrai si ligne créée dans le module",
|
"description" : "vrai si amortissement créé dans le module",
|
||||||
"type" : ["boolean", "null"]
|
"type" : ["boolean", "null"]
|
||||||
},
|
}
|
||||||
"required": ["type", "immo_doc_id", "line_id"]
|
},
|
||||||
}
|
"required": ["type", "immo_doc_id"],
|
||||||
|
"if": {"properties": {"type": {"const": "amort_link"}}, "required": ["type"]},
|
||||||
|
"then": {"required": ["amort_line_id"]},
|
||||||
|
"else":
|
||||||
|
"if": {"properties": {"type": {"const": "credit_link"}}, "required": ["type"]},
|
||||||
|
"then": {"required": ["credit_line_id"]},
|
||||||
|
"else":
|
||||||
|
"if": {"properties": {"type": {"const": "cession_link"}}, "required": ["type"]},
|
||||||
|
"then": {"required": ["cession_line_id"]},
|
||||||
|
"else":
|
||||||
|
"if": {"properties": {"type": {"const": "exit_link"}}, "required": ["type"]},
|
||||||
|
"then": {"required": ["exit_line_id"]},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,10 @@
|
||||||
WHERE !account_condition
|
WHERE !account_condition
|
||||||
AND credit > 0
|
AND credit > 0
|
||||||
AND credit_line_id NOT IN (
|
AND credit_line_id NOT IN (
|
||||||
SELECT json_extract(credit_link.document, '$.line_id') AS line_id FROM !table as credit_link
|
SELECT json_extract(link.document, '$.credit_line_id') AS credit_line_id FROM !table as link
|
||||||
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
WHERE json_extract(link.document, '$.type') == "credit_link"
|
||||||
UNION
|
UNION
|
||||||
SELECT json_extract(exit_link.document, '$.line_id') AS line_id FROM !table as exit_link
|
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link")
|
WHERE json_extract(exit_link.document, '$.type') == "exit_link")
|
||||||
ORDER BY trans.date, trans.label;
|
ORDER BY trans.date, trans.label;
|
||||||
!account_condition = $account_condition
|
!account_condition = $account_condition
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||||
<dt>Date de l'immobilisation</dt>
|
<dt>Date de l'immobilisation</dt>
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.credit_trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.credit_trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.credit_year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.credit_year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.credit_trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.credit_trans_id}}</a></td>
|
||||||
<td>{{$line.trans_date|date_short}}</td>
|
<td>{{$line.trans_date|date_short}}</td>
|
||||||
<td class="money">{{"%f"|math:$line.credit_amount|money_html:false|raw}}</td>
|
<td class="money">{{"%f"|math:$line.credit_amount|money_html:false|raw}}</td>
|
||||||
<td>{{$line.trans_label}}
|
<td>{{$line.trans_label}}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
une écriture de cession
|
une écriture de cession
|
||||||
*}}
|
*}}
|
||||||
{{#form on="attach_cession"}}
|
{{#form on="attach_cession"}}
|
||||||
{{:include file="_attach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.attach_cession type="cession"}}
|
{{:include file="_attach_cession.html" immo_doc_id=$_POST.immo_doc_id cession_line_id=$_POST.attach_cession}}
|
||||||
{{:redirect force="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_cession"|args:$_POST.immo_doc_id}}
|
{{:redirect force="exit_step3.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_cession"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||||
<dt>Date de l'immobilisation</dt>
|
<dt>Date de l'immobilisation</dt>
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
{{:assign cession_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign cession_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$cession_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$cession_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $line.line_label != null}}
|
{{if $line.line_label != null}}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
une écriture de sortie d'immobilisation
|
une écriture de sortie d'immobilisation
|
||||||
*}}
|
*}}
|
||||||
{{#form on="attach_exit"}}
|
{{#form on="attach_exit"}}
|
||||||
{{:include file="_attach_line.html" immo_doc_id=$_POST.immo_doc_id line_id=$_POST.attach_exit type="exit"}}
|
{{:include file="_attach_exit.html" immo_doc_id=$_POST.immo_doc_id exit_line_id=$_POST.attach_exit}}
|
||||||
{{:redirect force="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_exit"|args:$_POST.immo_doc_id}}
|
{{:redirect force="exit_step4.html?immo_doc_id=%s&from=exit&ok=1&msg=attach_exit"|args:$_POST.immo_doc_id}}
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
|
|
@ -47,15 +47,15 @@
|
||||||
FROM acc_transactions AS trans
|
FROM acc_transactions AS trans
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||||
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.line_id') = line.id
|
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||||
WHERE
|
WHERE
|
||||||
acc.code = :acc_code
|
acc.code = :acc_code
|
||||||
AND line.credit > 0
|
AND line.credit > 0
|
||||||
AND credit_line_id NOT IN (
|
AND credit_line_id NOT IN (
|
||||||
SELECT json_extract(credit_link.document, '$.line_id') AS line_id FROM !table as credit_link
|
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||||
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
WHERE json_extract(credit_link.document, '$.type') == "credit_link"
|
||||||
UNION
|
UNION
|
||||||
SELECT json_extract(exit_link.document, '$.line_id') AS line_id FROM !table as exit_link
|
SELECT json_extract(exit_link.document, '$.exit_line_id') AS line_id FROM !table as exit_link
|
||||||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$ligne_immo.amount|money_currency_html:false|raw}}</dd>
|
||||||
<dt>Date de l'immobilisation</dt>
|
<dt>Date de l'immobilisation</dt>
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
{{:assign exit_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign exit_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$exit_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$exit_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.date|date_short}}</td>
|
<td>{{$line.date|date_short}}</td>
|
||||||
<td>{{$line.trans_label}}
|
<td>{{$line.trans_label}}
|
||||||
{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}
|
{{if $line.line_label != null && $line.line_label != $line.trans_label}} — {{$line.line_label}}{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$immo_label}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$immo_label}}</dd>
|
||||||
<dt>Compte d'immobilisation</dt>
|
<dt>Compte d'immobilisation</dt>
|
||||||
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}
|
<dd>{{$ligne_immo.account_code}} — {{$ligne_immo.account_label}}
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Immobilisations et amortissements\nversion 0.42"
|
description="Immobilisations et amortissements\nversion 0.41.3"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://gitea.zaclys.com/lesanges"
|
author_url="https://gitea.zaclys.com/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
<div class="informations">
|
<div class="informations">
|
||||||
<dl class="describe">
|
<dl class="describe">
|
||||||
<dt>Immobilisation</dt>
|
<dt>Immobilisation</dt>
|
||||||
<dd><span class="num"><a href="{{$trans_url}}">{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
<dd><span class="num"><a href="{{$trans_url}}">#{{$ligne_immo.trans_id}}</a></span> {{$label_immo}}</dd>
|
||||||
<dt>Montant</dt>
|
<dt>Montant</dt>
|
||||||
<dd class="money strong">{{"%f"|math:$montant_immo|money_currency_html:false|raw}}</dd>
|
<dd class="money strong">{{"%f"|math:$montant_immo|money_currency_html:false|raw}}</dd>
|
||||||
<dt>Début d'amortissement</dt>
|
<dt>Début d'amortissement</dt>
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$line.trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.year}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href="{{$trans_url}}">{{$line.trans_id}}</a></td>
|
<td class="num"><a href="{{$trans_url}}">#{{$line.trans_id}}</a></td>
|
||||||
<td>{{$line.trans_date|date_short}}</td>
|
<td>{{$line.trans_date|date_short}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{if $line.line_label != null}}
|
{{if $line.line_label != null}}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="amort_link"
|
type="amort_link"
|
||||||
immo_doc_id=$_GET.immo_doc_id|intval
|
immo_doc_id=$_GET.immo_doc_id|intval
|
||||||
line_id=$line.id
|
amort_line_id=$line.id
|
||||||
created=true
|
created=true
|
||||||
}}
|
}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
|
|
@ -229,7 +229,7 @@
|
||||||
{{:assign var=date_amort value=$years.0.end_date}}
|
{{:assign var=date_amort value=$years.0.end_date}}
|
||||||
{{: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="round(%f/%f/365*%d,2)"|math:$ligne_immo.amount:$info_immo.duration:$nbjours|intval}}
|
{{:assign montant_amort="%f/%f/365*%d"|math:$ligne_immo.amount:$info_immo.duration:$nbjours|intval}}
|
||||||
{{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.amount:$total_amort}}
|
{{:assign montant_amort="min(%f, %d-%d)"|math:$montant_amort:$ligne_immo.amount:$total_amort}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ function getNumber(text) {
|
||||||
// @param date de fin
|
// @param date de fin
|
||||||
// @result montant de l'amortissement
|
// @result montant de l'amortissement
|
||||||
function computeAmort(montant_immo, duree_immo, somme_amort, date_debut, date_fin) {
|
function computeAmort(montant_immo, duree_immo, somme_amort, date_debut, date_fin) {
|
||||||
const nbjours = Math.round(1 + Math.abs((date_fin - date_debut)) / (60*60*24));
|
const nbjours = 1 + (date_fin - date_debut) / (60*60*24);
|
||||||
return Math.round(Math.min(montant_immo / duree_immo / 365 * nbjours, montant_immo - somme_amort));
|
return Math.round(Math.min(montant_immo / duree_immo / 365 * nbjours, montant_immo - somme_amort));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,7 +131,7 @@ function displayAmort(id_immo, id_duree, id_amort, id_years, id_exercices, id_mo
|
||||||
const somme_amort = Number(document.getElementById(id_amort).value);
|
const somme_amort = Number(document.getElementById(id_amort).value);
|
||||||
const montant_amort = computeAmort(montant_immo, duree_immo, somme_amort, date_debut, date_fin);
|
const montant_amort = computeAmort(montant_immo, duree_immo, somme_amort, date_debut, date_fin);
|
||||||
case_montant.value = montant_amort/100;
|
case_montant.value = montant_amort/100;
|
||||||
case_montant.innerText = montant_amort/100;
|
case_montant.innerText = montant_amort;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSelectorYear(button_names, f_years_selector)
|
function setSelectorYear(button_names, f_years_selector)
|
||||||
|
|
@ -249,7 +249,7 @@ function computeTotal(id_total, id_url) {
|
||||||
total[code] = getNumber(money.innerText) * 100;
|
total[code] = getNumber(money.innerText) * 100;
|
||||||
}
|
}
|
||||||
total_general += getNumber(money.innerText) * 100;
|
total_general += getNumber(money.innerText) * 100;
|
||||||
const number = line.querySelector('.num a').innerText;
|
const number = line.querySelector('.num a').innerText.slice(1);
|
||||||
transactions.push(number);
|
transactions.push(number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="amort_link"
|
type="amort_link"
|
||||||
immo_doc_id=$info_immo.id
|
immo_doc_id=$info_immo.id
|
||||||
line_id=$line.id
|
amort_line_id=$line.id
|
||||||
created=true
|
created=true
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -224,7 +224,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="exit_link"
|
type="exit_link"
|
||||||
immo_doc_id=$info_immo.id
|
immo_doc_id=$info_immo.id
|
||||||
line_id=$line.id
|
exit_line_id=$line.id
|
||||||
created=true
|
created=true
|
||||||
}}
|
}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
type="cession_link"
|
type="cession_link"
|
||||||
immo_doc_id=$info_immo.id
|
immo_doc_id=$info_immo.id
|
||||||
line_id=$line.id
|
cession_line_id=$line.id
|
||||||
created=true
|
created=true
|
||||||
}}
|
}}
|
||||||
{{:break}}
|
{{:break}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue