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 @@ -

Écriture de sortie du bilan attachée à l'immobilisation

+{{if $erreur}} +

{{$message}}
Vérifiez si vous avez correctement attaché les écritures d'amortissement.

+ + + + + + + + + + + + + {{#foreach from=$exit_trans key="account_code" item="line"}} + {{:assign account_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$line.account_id:$line.id_year}} + + + + + + + + {{/foreach}} + +
Détails de l'écriture de sortie de bilan
NuméroCompteDébitCréditLibellé
{{$line.account_code}}{{$line.account_label}}{{$line.debit|money_currency:false}}{{$line.credit|money_currency:false}}{{$line.line_label}}
+{{/if}} + +

Écriture de sortie de bilan attachée à l'immobilisation

{{if $exit_line != null}} {{:assign exit_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$exit_line.trans_id}} @@ -262,7 +323,7 @@
{{elseif $exit_lines}}

- 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 @@

{{:button type="submit" name="backward" label="Revenir à l'étape précédente" shape="left" class="main"}} - {{if $exit_line}} + {{if $exit_line && ! $erreur}} {{:button type="submit" name="validate" label="Terminer" shape="check" class="main"}} {{else}} - {{:button type="submit" name="finish" label="Terminer" shape="export" class="main"}} + {{:button type="submit" name="finish" label="Annuler" shape="delete" class="main"}} {{/if}}

diff --git a/style.css b/style.css index 9811b17..c4b7591 100644 --- a/style.css +++ b/style.css @@ -74,6 +74,15 @@ table.list tbody tr.ignored:nth-child(even) { font-style: italic; background: rgba(255, 255, 200, 0.5); } + +table.error { + background-color: #fcc; +} +table.error tr, table.error td, table.error thead td { + background-image : none; + background-color: #fcc; +} + html.dark table.list tbody tr.ignored:nth-child(odd) { font-style: italic; background: rgba(100, 100, 0, 0.4);