show transactions in lightgreen if they are older than one year

for tax reasons
This commit is contained in:
2022-07-05 17:11:09 +02:00
parent b21d794b87
commit 13e14c6bb3
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -15,3 +15,6 @@ div.tab-pane h4 {
font-size: 14px;
font-weight: 600;
}
.green {
background: lightgreen;
}
+1 -1
View File
@@ -27,7 +27,7 @@
<td colspan="5">{{ transaction.description }}:</td>
</tr>
{% endif %}
<tr>
<tr {% if transaction.date_valid|date:"Y-m-d" < tax_limit_day|date:"Y-m-d" %}class="green"{% endif %}>
<td>{{ transaction.date_valid }}</td>
<td><span title="{% if transaction.crypto_fee and transaction.crypto_fee > 0 %}Fee: {{ transaction.crypto_fee }}{% else %}{{ transaction.crypto_total }}{% endif %}">
{{ transaction.crypto_total|floatformat:3 }}
+4 -1
View File
@@ -5,6 +5,7 @@ from apps.transactions.forms import TransactionForm
from apps.transactions.forms import ImportForm
from apps.transactions.models import Transaction
from apps.transactions.importbtcde import ImportBtcDe
import datetime
import socket
import xlwt
from django.http import HttpResponse
@@ -66,7 +67,9 @@ def show(request):
tr.fiat_total += float(tr.fiat_amount)
if tr.fiat_fee:
tr.fiat_total += float(tr.fiat_fee)
return render(request,"show.html",{'transactions':transactions, 'crypto': crypto})
return render(request,"show.html",{'transactions':transactions,
'tax_limit_day': datetime.datetime.now() - datetime.timedelta(days=1*365),
'crypto': crypto})
@login_required