diff --git a/k4ever/media/css/img/cashIn.png b/k4ever/media/css/img/cashIn.png new file mode 100644 index 0000000..09c5198 Binary files /dev/null and b/k4ever/media/css/img/cashIn.png differ diff --git a/k4ever/media/css/img/cashOut.png b/k4ever/media/css/img/cashOut.png new file mode 100644 index 0000000..c766cbe Binary files /dev/null and b/k4ever/media/css/img/cashOut.png differ diff --git a/k4ever/media/css/style.css b/k4ever/media/css/style.css index e7a4241..5fcf6f6 100644 --- a/k4ever/media/css/style.css +++ b/k4ever/media/css/style.css @@ -611,6 +611,12 @@ table.itemListContainer > tbody > tr:first-child ~ tr > td { .icon.transfer { background-image: url("img/transfer.png"); } +.icon.cashIn { + background-image: url("img/cashIn.png"); +} +.icon.cashOut { + background-image: url("img/cashOut.png"); +} .transaction { padding: 0 30px; } diff --git a/k4ever/media/css/style.less b/k4ever/media/css/style.less index 0fa0ecb..4122c88 100644 --- a/k4ever/media/css/style.less +++ b/k4ever/media/css/style.less @@ -630,6 +630,14 @@ table.itemListContainer { &.transfer { background-image: url("@{fldImages}/transfer.png"); } + + &.cashIn { + background-image: url("@{fldImages}/cashIn.png"); + } + + &.cashOut { + background-image: url("@{fldImages}/cashOut.png"); + } } .transaction { @@ -680,4 +688,4 @@ table.itemListContainer { background: #E6EFC2; color: #264409; border-color: #C6D880; -} \ No newline at end of file +} diff --git a/k4ever/transaction/templates/transaction/overview.html b/k4ever/transaction/templates/transaction/overview.html index c1f40dd..f202645 100644 --- a/k4ever/transaction/templates/transaction/overview.html +++ b/k4ever/transaction/templates/transaction/overview.html @@ -87,4 +87,51 @@ + +

Vergangene virtuelle Transaktionen

+ + + + + + + + + + + + + + + {% for transaction in vhistory %} + + + + + + + + + + {% endfor %} + + + + + + + + + + + + + +
DatumUhrzeitBetragSenderTypRecipientComment
{{ transaction.dateTime|date:"j. F Y" }}{{ transaction.dateTime|date:"H:i" }} Uhr{{ transaction.amount|floatformat:2 }}€{{ transaction.user }}{{ transaction.recipient }}{{ transaction.comment }}
DatumUhrzeitBetragSenderTypRecipientComment
{% endblock %} diff --git a/k4ever/transaction/views.py b/k4ever/transaction/views.py index 3c801db..07c300d 100644 --- a/k4ever/transaction/views.py +++ b/k4ever/transaction/views.py @@ -1,6 +1,7 @@ from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required +from django.db.models import Q from django.http import HttpResponseRedirect from models import Transaction, TransactionType, VirtualTransaction from forms import TransactionForm, VirtualTransactionForm @@ -11,7 +12,7 @@ def overview(request): """ Creates an overview over the users transactions, also handles adding and transfering money. """ # create history history = Transaction.objects.filter(user=request.user).order_by("-dateTime") - + vhistory = VirtualTransaction.objects.filter(Q(user=request.user) | Q(recipient=request.user)).order_by("-dateTime") # create forms form = TransactionForm() vform = VirtualTransactionForm() @@ -39,5 +40,5 @@ def overview(request): vtransacted = True else: error = True - return render_to_response("transaction/overview.html", {'history': history, 'form': form, 'transacted': transacted, 'error': error, 'vform': vform, 'vtransacted': vtransacted, 'verror': verror}, RequestContext(request)) + return render_to_response("transaction/overview.html", {'history': history, 'vhistory': vhistory, 'form': form, 'transacted': transacted, 'error': error, 'vform': vform, 'vtransacted': vtransacted, 'verror': verror}, RequestContext(request))