From 13e14c6bb3ab70c16f04d7af34e3bac9065da683 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Tue, 5 Jul 2022 17:11:09 +0200 Subject: [PATCH] show transactions in lightgreen if they are older than one year for tax reasons --- apps/core/static/css/style.css | 3 +++ apps/transactions/templates/show.html | 2 +- apps/transactions/views.py | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/core/static/css/style.css b/apps/core/static/css/style.css index c0dd613..003b30b 100644 --- a/apps/core/static/css/style.css +++ b/apps/core/static/css/style.css @@ -15,3 +15,6 @@ div.tab-pane h4 { font-size: 14px; font-weight: 600; } +.green { + background: lightgreen; +} diff --git a/apps/transactions/templates/show.html b/apps/transactions/templates/show.html index feb139b..ae23840 100644 --- a/apps/transactions/templates/show.html +++ b/apps/transactions/templates/show.html @@ -27,7 +27,7 @@ {{ transaction.description }}: {% endif %} - + {{ transaction.date_valid }} {{ transaction.crypto_total|floatformat:3 }} diff --git a/apps/transactions/views.py b/apps/transactions/views.py index 58f2d75..c84e104 100644 --- a/apps/transactions/views.py +++ b/apps/transactions/views.py @@ -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