better counting
This commit is contained in:
@@ -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 }}zł</td>
|
||||
{% endif %}
|
||||
<td>{{ tax.income }}zł</td>
|
||||
<td>{{ tax.cost }}zł</td>
|
||||
<td>{% if tax.taxLoss < 0 %} {{ tax.taxLoss }} {% else %} {{ tax.tax }} zł{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<tr class="">
|
||||
<td colspan="4">Summary:</td>
|
||||
<td>{{ tax }}zł</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user