# -*- coding: utf-8 -*- 
# This file is part of k4ever, a point-of-sale system
#   Contact............  <k4ever@lists.someserver.de>
#   Website............  http://k4ever.someserver.de/
#   Bug tracker........  http://k4ever.someserver.de/report
#
# Licensed under GNU Affero General Public License v3 or later

from models import Transaction, TransactionType, VirtualTransaction
from django.contrib import admin

class TransactionAdmin(admin.ModelAdmin):
	list_filter = ('transactionType','checked','user')
	#actions = ['really_delete_selected']
	list_display = ('user', 'transactionType', 'amount', 'dateTime', 'checked')
	list_display_links = ('user', 'transactionType')
	search_fields = ['user__username','user__first_name','user__last_name']
	date_hierarchy = 'dateTime'
	ordering = ['-dateTime']

class VirtualTransactionAdmin(admin.ModelAdmin):
	list_display = ('user','recipient','amount','dateTime','comment')
	list_display_links = ('user','recipient')
	list_filter = ('user','recipient')
	search_fields = ['user__username','recipient__username','comment']
	date_hierarchy = 'dateTime'
	ordering = ['-dateTime']

admin.site.register(Transaction, TransactionAdmin)
admin.site.register(TransactionType)
admin.site.register(VirtualTransaction, VirtualTransactionAdmin)
