diff --git a/exit_step4.html b/exit_step4.html index 5bc9f23..ed7be7a 100644 --- a/exit_step4.html +++ b/exit_step4.html @@ -84,6 +84,39 @@ assign="exit_line" }} {{/select}} + + {{* lignes de l'écriture de sortie *}} + {{#select + line.label as line_label, + line.credit, + line.debit, + acc.id as account_id, + acc.code as account_code, + acc.label as account_label + FROM acc_transactions AS trans + 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 + WHERE trans.id = :exit_trans_id; + :exit_trans_id = $exit_line.trans_id + assign="trans" + }} + {{:assign var="exit_trans.%s"|args:$account_code value=$trans}} + {{/select}} + + {{:assign acc_codes=$exit_trans|keys}} + {{#foreach from=$linked_amort}} + {{if $account_code|in:$acc_codes}} + {{:assign var="exit_amort" from="exit_trans.%s.debit"|args:$account_code}} + {{:break}} + {{/if}} + {{/foreach}} + + {{if $exit_amort != $total_amort}} + {{:assign exit_amort_display=$exit_amort|money_currency:false|replace:" ":" "}} + {{:assign total_amort_display=$total_amort|money_currency:false|replace:" ":" "}} + {{:assign erreur=1}} + {{:assign message="Le montant des amortissement dans l'écriture de sortie (%s) est différent du total des amortissements associés à l'immobilisation (%s)."|args:$exit_amort_display:$total_amort_display}} + {{/if}} {{/if}} {{* @@ -225,7 +258,35 @@ -
{{$message}}
Vérifiez si vous avez correctement attaché les écritures d'amortissement.
| Numéro | +Compte | +Débit | +Crédit | +Libellé | +
| {{$line.account_code}} | +{{$line.account_label}} | +{{$line.debit|money_currency:false}} | +{{$line.credit|money_currency:false}} | +{{$line.line_label}} | +
- Vous pouvez attacher une écriture de sortie du bilan à l'immobilisation + Vous pouvez attacher une écriture de sortie de bilan à l'immobilisation
{{/if}} @@ -302,7 +363,7 @@ {{elseif $exit_line == null}} -Aucune écriture de sortie du bilan avec un +
Aucune écriture de sortie de bilan avec un
montant de {{$solde|money_currency_html:false|raw}} au crédit du
compte {{$ligne_immo.account_code}} — {{$ligne_immo.account_label}} ;
@@ -321,10 +382,10 @@