Bug Rechnung und Abwesenheitscheck done

This commit is contained in:
holger.trampe 2020-12-13 14:32:15 +01:00
parent 28fe4eaf44
commit 9179e97be7
13 changed files with 34 additions and 11 deletions

View File

@ -25,7 +25,7 @@
<td><a href="{% url 'ag-getbillpdf' ele.pk %}" target="_blank">{{ele.billnumber}}</a></td>
<td>{{ele.billdate}}</td>
<td>
{% loadFinalMoney user as fm %}
{% loadFinalMoneyByAgency ele.agency as fm %}
{{fm|floatformat:2|intcomma}} €
</td>
<td>

View File

@ -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',

Binary file not shown.

Binary file not shown.

View File

@ -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
django-simple-captcha==0.5.13

View File

@ -184,11 +184,20 @@
<div id="stgroups_content" class="collapse" aria-labelledby="st_groups" data-parent="#additionalStandardInfos">
<div class="card-body">
{% for g in agencygroups %}
{% for g in agencygroups %}
{% if g.agencygroupname == "Notfallhilfe" %}
{% if request.user.profile.agency.module_recoverdir %}
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input groupclass" onclick="javascript:groupsChange({{g.pk}}, this.checked)" name="group_{{g.pk}}" id="group_{{g.pk}}" {% if g in standard.visibleby.all %} checked {% endif %}>
<label class="custom-control-label" for="group_{{g.pk}}" >{{g.agencygroupname}}</label>
</div>
{% endif %}
{% else %}
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" class="custom-control-input groupclass" onclick="javascript:groupsChange({{g.pk}}, this.checked)" name="group_{{g.pk}}" id="group_{{g.pk}}" {% if g in standard.visibleby.all %} checked {% endif %}>
<label class="custom-control-label" for="group_{{g.pk}}" >{{g.agencygroupname}}</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>

View File

@ -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):

BIN
users/.DS_Store vendored

Binary file not shown.

BIN
users/static/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -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 = {