diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 41c5513..6272edd 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 e9c00e9..a68710b 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -845,12 +845,36 @@ def getHistoryClassOfObject(value): 2 - Keine Rechnung, keinen Plan, Freiraum um mehr als 14 Tage überschritten 3 - Keine Rechnung, keinen Plan, Freiraum um mehr als 30 Tage überschritten - AGENTUR SPERREN! 10 - Plan erstellt! + 20 - KOSTENLOS ''' @register.simple_tag def getAgencyBillStatus(agency): - print(agency) - return True + returnvalue = 0 + regdate = agency.registerdate + + # Agentur normal, prüfen, was bezahlt werden muss + if agency.paymentstatus == 1: + returnvalue = 20 + else: + today = date.today() + # 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: + 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: + returnvalue = 10 + #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/signals.py b/users/signals.py index 4b5b1f2..c293063 100644 --- a/users/signals.py +++ b/users/signals.py @@ -33,12 +33,6 @@ from channels_presence.signals import presence_changed from organizer.models import * from chat.models import ChatMessage -@receiver(signal=request_started) -def requestStart(**kwargs): - pass - # TASK: Hier AuditLog implementieren - - def loadingFreeDays(plz, year): # Getting land file_path = os.path.join(settings.STATIC_ROOT, 'users/extra/plz_short.csv') diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 1d27881..dd2a11b 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -970,3 +970,57 @@ $("#chatButton").click(function(){ + + +{% getAgencyBillStatus request.user.profile.agency as billstatus %} +{% if billstatus == 3 %} + + + +{% endif %} + + + + + + + + + + + + + + + + + + + diff --git a/users/templates/users/dashboard.html b/users/templates/users/dashboard.html index e3ce0a6..8afbc75 100644 --- a/users/templates/users/dashboard.html +++ b/users/templates/users/dashboard.html @@ -1,4 +1,5 @@ {% extends "users/base.html" %} +{% load counter_tag %} {% block content %}

Willkommen, {{request.user.first_name}} {{request.user.last_name}}!

@@ -197,4 +198,6 @@ $(document).ready(function(){
+ + {% endblock content %}