diff --git a/adm/templates/adm/adm_bills.html b/adm/templates/adm/adm_bills.html index e748658..bbd0ad6 100644 --- a/adm/templates/adm/adm_bills.html +++ b/adm/templates/adm/adm_bills.html @@ -25,7 +25,7 @@ {{ele.billnumber}} {{ele.billdate}} - {% loadFinalMoney user as fm %} + {% loadFinalMoneyByAgency ele.agency as fm %} {{fm|floatformat:2|intcomma}} € diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 67f397b..b25f367 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index 9cc2733..bbfdfe0 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -58,6 +58,7 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Application definition INSTALLED_APPS = [ + 'django.contrib.contenttypes', 'notificsys.apps.NotificsysConfig', 'users.apps.UsersConfig', 'dasettings.apps.DASettingsConfig', @@ -80,7 +81,6 @@ INSTALLED_APPS = [ 'mathfilters', 'django.contrib.humanize', 'django.contrib.auth', - 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', diff --git a/recoverdir/templates/.DS_Store b/recoverdir/templates/.DS_Store index 90c316d..1c04afc 100644 Binary files a/recoverdir/templates/.DS_Store and b/recoverdir/templates/.DS_Store differ diff --git a/recoverdir/templates/recoverdir/.DS_Store b/recoverdir/templates/recoverdir/.DS_Store index 75078b0..e8154f3 100644 Binary files a/recoverdir/templates/recoverdir/.DS_Store and b/recoverdir/templates/recoverdir/.DS_Store differ diff --git a/requirements.txt b/requirements.txt index 915f131..8a2e962 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ django-crispy-forms==1.8.1 django-js-asset==1.2.2 django-jsonfield==1.3.1 idna==2.8 -mysqlclient==1.4.6 +mysqlclient==2.0.1 Pillow==6.2.1 pytz==2019.3 requests==2.22.0 @@ -32,4 +32,4 @@ django-simple-history==2.11.0 django-encrypted-filefield==0.2.2 more-itertools==8.5.0 django-passwords==0.3.12 -django-simple-captcha=0.5.13 \ No newline at end of file +django-simple-captcha==0.5.13 diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index efe8327..306d3dc 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -184,11 +184,20 @@
- {% for g in agencygroups %} + {% for g in agencygroups %} + {% if g.agencygroupname == "Notfallhilfe" %} + {% if request.user.profile.agency.module_recoverdir %}
+ {% endif %} + {% else %} +
+ + +
+ {% endif %} {% endfor %}
diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 57dfc97..5d25341 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 dc3d68d..8e8d408 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -747,6 +747,18 @@ def loadFinalMoney(user): finalMoney = (21.0 + usercount*3) * 1.16 return finalMoney +@register.simple_tag +def loadFinalMoneyByAgency(agency): + usercount = len(User.objects.filter(profile__agency=agency)) + + if(usercount < 4): + usercount = 0 + else: + usercount = usercount - 3 + + finalMoney = (21.0 + usercount*3) * 1.16 + return finalMoney + @register.simple_tag def loadUserCountMoney(user): diff --git a/users/.DS_Store b/users/.DS_Store index f12733d..073fc41 100644 Binary files a/users/.DS_Store and b/users/.DS_Store differ diff --git a/users/static/.DS_Store b/users/static/.DS_Store index 9e8af30..9e7fc3a 100644 Binary files a/users/static/.DS_Store and b/users/static/.DS_Store differ diff --git a/users/static/users/.DS_Store b/users/static/users/.DS_Store index 7beb557..b047b89 100644 Binary files a/users/static/users/.DS_Store and b/users/static/users/.DS_Store differ diff --git a/users/views.py b/users/views.py index 4805ec1..548a292 100644 --- a/users/views.py +++ b/users/views.py @@ -146,6 +146,8 @@ def toUpdate(request): Auszubildender ''' + + agencyjobsobject = AgencyJob.objects.filter(agency__pk=request.user.profile.agency.pk) if(len(agencyjobsobject) == 0): defaultAgencyJobs = ['Agenturleiter', 'Außendienst', 'Innendienst', 'Auszubildender'] @@ -155,7 +157,7 @@ def toUpdate(request): agencygroups = AgencyGroup.objects.filter(agency__pk=request.user.profile.agency.pk) if(len(agencygroups) == 0): - #print("default groups not existing - creating") + print("default groups not existing - creating") # MITARBEITER letters = string.ascii_lowercase temgroup_mitarbeiter = Group(name=str(request.user.profile.agency.pk) + "_" + randomString(8)) @@ -226,6 +228,7 @@ def toUpdate(request): #print("MAIN ROOT DIR FOUND - FILESMODULE READY") # CHECK IF AGENCY DIRS EXIST + path = settings.MEDIA_ROOT + "/agencydata/agency_" + str(request.user.profile.agency.pk) if(os.path.isdir(path) == False): # CREATE AGENCY DEFAULT DIRS @@ -233,10 +236,10 @@ def toUpdate(request): os.mkdir(os.path.join(settings.MEDIA_ROOT + "/agencydata/", "agency_" + str(request.user.profile.agency.pk) + "/files")) os.mkdir(os.path.join(settings.MEDIA_ROOT + "/agencydata/", "agency_" + str(request.user.profile.agency.pk) + "/agencystats")) os.mkdir(os.path.join(settings.MEDIA_ROOT + "/agencydata/", "agency_" + str(request.user.profile.agency.pk) + "/agencystats/profilepics")) - + # DEF STANDARD DIR defstandard = DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk) - + if(len(defstandard) == 0): #print("NO DEF STANDARD FOUND - CREATE") rootdir = list(DataDir.objects.filter(is_root=True, agency__pk=request.user.profile.agency.pk))[0] @@ -256,7 +259,7 @@ def toUpdate(request): m2m_changed.connect(adjust_group_notifications_permission, sender=Group.permissions.through) - + # USER TIME MODEL usersofagency = User.objects.filter(profile__agency=request.user.profile.agency) @@ -500,8 +503,7 @@ def dashboard(request): # UPDATE FUNCTIONS BY NEW MODEL-CHANGES FOR COPIEN SOME DATA toUpdate(request) - - + #storageinfo = sys.getfilesystemencoding() context = {