Ajout totaux dans les onglets Amortissables, Amorties et En cours
This commit is contained in:
parent
900b0f5a47
commit
4f02f8c7d7
3 changed files with 101 additions and 4 deletions
|
|
@ -31,7 +31,6 @@
|
||||||
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
|
||||||
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
|
||||||
INNER JOIN acc_transactions_lines AS line2 ON line.debit = line2.credit
|
INNER JOIN acc_transactions_lines AS line2 ON line.debit = line2.credit
|
||||||
INNER JOIN acc_transactions AS trans2 ON trans2.id = line2.id_transaction
|
INNER JOIN acc_transactions AS trans2 ON trans2.id = line2.id_transaction
|
||||||
INNER JOIN acc_accounts AS acc2 ON acc2.id = line2.id_account
|
INNER JOIN acc_accounts AS acc2 ON acc2.id = line2.id_account
|
||||||
|
|
@ -61,10 +60,15 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{:assign nb_immo=0}}
|
{{:assign nb_immo=0}}
|
||||||
|
{{:assign total_immo = 0}}
|
||||||
|
{{:assign total_cessions = 0}}
|
||||||
{{#foreach from=$immo_archivees}}
|
{{#foreach from=$immo_archivees}}
|
||||||
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
{{:assign trans_url="%s/acc/transactions/details.php?id=%s"|args:$admin_url:$trans_id}}
|
||||||
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
{{:assign compte_url="%s/acc/accounts/journal.php?id=%s&year=%s"|args:$admin_url:$account_id:$trans_id_year}}
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||||
|
{{:assign total_immo="%d+%d"|math:$total_immo:$debit}}
|
||||||
|
{{:assign var="montant" from="sommes_immo.%s"|args:$account_code}}
|
||||||
|
{{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$debit}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
|
|
@ -77,10 +81,58 @@
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{* voir s'il y a une écriture de cession associée à cette immo *}}
|
||||||
|
{{#select
|
||||||
|
trans.id,
|
||||||
|
trans.label,
|
||||||
|
trans.date,
|
||||||
|
line.id,
|
||||||
|
line.debit,
|
||||||
|
acc.code,
|
||||||
|
acc.label
|
||||||
|
FROM acc_transactions_links AS link
|
||||||
|
INNER JOIN acc_transactions AS trans ON (CASE
|
||||||
|
WHEN link.id_transaction = :trans_id THEN link.id_related
|
||||||
|
WHEN link.id_related = :trans_id THEN link.id_transaction
|
||||||
|
END) = 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
|
||||||
|
WHERE (link.id_transaction = :trans_id OR link.id_related = :trans_id) AND acc.code = 462
|
||||||
|
;
|
||||||
|
:trans_id = $trans_id
|
||||||
|
}}
|
||||||
|
{{:assign var="montant" from="montant_cessions.%d"|args:$account_code}}
|
||||||
|
{{:assign var="montant_cessions.%d"|args:$account_code value="%d+%d"|math:$montant:$debit}}
|
||||||
|
{{:assign total_cessions="%d+%d"|math:$total_cessions:$debit}}
|
||||||
|
{{/select}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{if $nb_immo == 0}}
|
{{if $nb_immo == 0}}
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
<p class="block alert">Aucune immobilisation</p>
|
||||||
|
{{else}}
|
||||||
|
<aside class="describe totals">
|
||||||
|
<h3 class="ruler">Totaux</h3>
|
||||||
|
{{if $total_immo != 0}}
|
||||||
|
<dl class="describe">
|
||||||
|
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
|
||||||
|
<dt>Total du compte {{$code}}</dt>
|
||||||
|
<dd>{{$value|money}}
|
||||||
|
{{/foreach}}
|
||||||
|
<dt>Montant total des immobilisations</dt>
|
||||||
|
<dd><span class="strong">{{$total_immo|money}}</span></dd>
|
||||||
|
</dl>
|
||||||
|
{{/if}}
|
||||||
|
{{if $total_cessions != 0}}
|
||||||
|
<dl class="describe">
|
||||||
|
{{#foreach from=$montant_cessions|ksort key="code" item="value"}}
|
||||||
|
<dt>Cessions du compte {{$code}}</dt>
|
||||||
|
<dd>{{$value|money}}
|
||||||
|
{{/foreach}}
|
||||||
|
<dt>Montant total des cessions</dt>
|
||||||
|
<dd><span class="strong">{{$total_cessions|money}}</span></dd>
|
||||||
|
</dl>
|
||||||
|
{{/if}}
|
||||||
|
</aside>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
{{:assign condition=$condition|cat:" AND "|cat:$filter_condition}}
|
{{:assign condition=$condition|cat:" AND "|cat:$filter_condition}}
|
||||||
|
|
||||||
{{:assign nb_immo=0}}
|
{{:assign nb_immo=0}}
|
||||||
|
{{:assign total_immo = 0}}
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
trans.label as trans_label,
|
trans.label as trans_label,
|
||||||
|
|
@ -148,11 +149,14 @@
|
||||||
{{if $type_immo == "amortized" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
{{if $type_immo == "amortized" && $amort_amount < $debit && $status != "amortized"}}{{:continue}}{{/if}}
|
||||||
|
|
||||||
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
{{:assign nb_immo="%d+1"|math:$nb_immo}}
|
||||||
|
{{:assign total_immo="%d+%d"|math:$total_immo:$debit}}
|
||||||
|
{{:assign var="montant" from="sommes_immo.%s"|args:$account_code}}
|
||||||
|
{{:assign var="sommes_immo.%s"|args:$account_code value="%d+%d"|math:$montant:$debit}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
<td class="num"><a href={{$trans_url}}>#{{$trans_id}}</a></td>
|
||||||
<td>{{$trans_date|date_short}}</td>
|
<td>{{$trans_date|date_short}}</td>
|
||||||
<td>{{$trans_label}}</td>
|
<td>{{$trans_label}}</td>
|
||||||
<td class="money">{{"%f"|math:$debit|money}}</td>
|
<td class="money">{{$debit|money}}</td>
|
||||||
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
<td class="money">{{if $duration != null}}{{$duration}}{{/if}}</td>
|
||||||
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
<td><a href={{$compte_url}}>{{$account_code}}</a></td>
|
||||||
<td>{{$account_label}}</td>
|
<td>{{$account_label}}</td>
|
||||||
|
|
@ -184,5 +188,19 @@
|
||||||
</table>
|
</table>
|
||||||
{{if $nb_immo == 0}}
|
{{if $nb_immo == 0}}
|
||||||
<p class="block alert">Aucune immobilisation</p>
|
<p class="block alert">Aucune immobilisation</p>
|
||||||
|
{{else}}
|
||||||
|
<aside class="describe totals">
|
||||||
|
<h3 class="ruler">Totaux</h3>
|
||||||
|
{{if $total_immo != 0}}
|
||||||
|
<dl class="describe">
|
||||||
|
{{#foreach from=$sommes_immo|ksort key="code" item="value"}}
|
||||||
|
<dt>Total du compte {{$code}}</dt>
|
||||||
|
<dd>{{$value|money}}
|
||||||
|
{{/foreach}}
|
||||||
|
<dt>Montant total des immobilisations</dt>
|
||||||
|
<dd><span class="strong">{{$total_immo|money}}</span></dd>
|
||||||
|
</dl>
|
||||||
|
{{/if}}
|
||||||
|
</aside>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
29
style.css
29
style.css
|
|
@ -39,7 +39,6 @@ h2[class="aide"], h3[class="aide"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
.informations dl.describe > dd {
|
.informations dl.describe > dd {
|
||||||
margin-left: 0;
|
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,3 +51,31 @@ fieldset.shortFormLeft div.informations {
|
||||||
background: rgba(var(--gSecondColor), 0.2);
|
background: rgba(var(--gSecondColor), 0.2);
|
||||||
border-radius: .5em;
|
border-radius: .5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside.totals {
|
||||||
|
float : left;
|
||||||
|
width : 30em;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside.totals dl.describe {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside.totals dl.describe dt {
|
||||||
|
text-align : right;
|
||||||
|
flex : 0 0 20rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside.totals dl.describe dt::after {
|
||||||
|
content: ' : ';
|
||||||
|
}
|
||||||
|
|
||||||
|
aside.totals dl.describe dd {
|
||||||
|
flex : 0 0 calc(100% - 25rem);
|
||||||
|
text-align : right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue