better counting

This commit is contained in:
2022-04-01 12:26:34 +02:00
parent 6b005cb5b6
commit 7e55e5097f
5 changed files with 94 additions and 35 deletions
+19 -11
View File
@@ -3,7 +3,7 @@
{% block title %}Tax summary{% endblock %}
{% block body %}
<div class="row justify-content-md-center" style="margin-top: 150px;">
<div class="row justify-content-md-center" >
<div class="col col-md-6">
{% if taxes %}
<table class="table table-dark table-striped">
@@ -11,22 +11,30 @@
<tr>
<th>L.p.</th>
<th>Country</th>
<th>Value</th>
<th>Income</th>
<th>Cost</th>
<th>Tax</th>
</tr>
</thead>
<tbody>
{% for tax in taxes %}
<tr {% if tax.country is not defined %}class="table-success"{% endif %}>
{% if tax.country is defined %}
{% for tax in taxes %}
{% if tax.country is defined %}
{% if tax.income > 0 %}
<tr class="{% if tax.taxLoss < 0 %}table-danger{% else %}table-success{% endif %}">
<td>{{ loop.index }}</td>
<td>{{ tax.country }}</td>
<td>{{ tax.value }}zł</td>
{% else %}
<td colspan="2">Summary:</td>
<td>{{ tax }}</td>
{% endif %}
<td>{{ tax.income }}zł</td>
<td>{{ tax.cost }}zł</td>
<td>{% if tax.taxLoss < 0 %} {{ tax.taxLoss }} {% else %} {{ tax.tax }}{% endif %}</td>
</tr>
{% endif %}
{% else %}
<tr class="">
<td colspan="4">Summary:</td>
<td>{{ tax }}zł</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% endif %}