diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 6272edd..1854a62 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 a68710b..18db81d 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -1,6 +1,6 @@ from django import template from django.contrib.auth.models import Group, User -from users.models import AgencyGroup, Agency, AgencyNetwork, AgencyNetworkPreperation, UserTime, UserYearAbsenceInfo +from users.models import AgencyGroup, Agency, AgencyNetwork, AgencyNetworkPreperation, UserTime, UserYearAbsenceInfo, AgencyBills from standards.models import Standards, StandardCommentRate, StandardComments from timemanagement.models import Workday, FreeDays, Absence from message.models import Message @@ -858,22 +858,35 @@ def getAgencyBillStatus(agency): returnvalue = 20 else: today = date.today() + bills = AgencyBills.objects.filter(agency=agency) + + activeBill = False + + for bill in bills: + if bill.end <= today and bill.billstatus == "paid": + activeBill = True + + + + # Tage, die zwischen Registrierung und heute liegen daysbetween = (today - regdate).days if agency.paymentplan == 0 and daysbetween <= 30: returnvalue = 0 - elif agency.paymentplan == 0 and daysbetween > 30 and daysbetween < 45: + elif agency.paymentplan == 0 and daysbetween > 30 and daysbetween <= 45: returnvalue = 1 elif agency.paymentplan == 0 and daysbetween > 45 and daysbetween <= 60: returnvalue = 2 elif agency.paymentplan == 0 and daysbetween > 60: returnvalue = 3 - elif agency.paymentplan == 1: + elif agency.paymentplan == 1 and activeBill == True: returnvalue = 10 + elif agency.paymentplan == 1 and activeBill == False: + returnvalue = 11 #paymentplan = models.IntegerField(default=0, null=True, blank=True) #payment_address = models.EmailField(default=None, blank=True, null=True) - + return returnvalue diff --git a/users/templates/users/base.html b/users/templates/users/base.html index a6e5bc1..be4a2a0 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -997,6 +997,93 @@ $(document).ready(function(){ }); }); +{% elif billstatus == 2 %} +