diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 0490dba..57dfc97 100644 Binary files a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc and b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc differ diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index 0ea3d68..dc3d68d 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -35,11 +35,11 @@ def incvar(): @register.filter(name="has_group_byname") def has_group_byname(user, groupname): in_group = False - if(user.profile.agency.module_recoverdir): - agroup = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname=groupname)[0] - for g in user.groups.all(): - if g.name == agroup.group.name: - in_group = True + #if(user.profile.agency.module_recoverdir): + agroup = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname=groupname)[0] + for g in user.groups.all(): + if g.name == agroup.group.name: + in_group = True return in_group @@ -866,6 +866,13 @@ def getAgencyBillStatus(agency): for bill in bills: if bill.end >= today: activeBill = True + # TASK: Unbezahlte Rechnungen prüfen? + # Check, ob die aktuelle Rechnung innerhalb von zwei Wochen bezahlt ist + #billend = bill.start.relativedelta(days=14) + #if billend <= today and bill.billstatus == "open": + # activeBill = False + + # Tage, die zwischen Registrierung und heute liegen daysbetween = (today - regdate).days @@ -882,7 +889,7 @@ def getAgencyBillStatus(agency): returnvalue = 10 elif agency.paymentplan == 1 and activeBill == False: returnvalue = 11 - + return returnvalue diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 805bea7..e6db06c 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -973,7 +973,7 @@ $("#chatButton").click(function(){ {% getAgencyBillStatus request.user.profile.agency as billstatus %} -{% if billstatus == 3 %} +{% if billstatus == 3 and request.user|has_group_byname:"Administratoren" %}