Rechnungen weiter checken

This commit is contained in:
holger.trampe 2020-12-06 12:11:51 +01:00
parent 8c34f91033
commit 28fe4eaf44
3 changed files with 17 additions and 10 deletions

View File

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

View File

@ -973,7 +973,7 @@ $("#chatButton").click(function(){
<!-- Billstatus -->
<!-- Billarea -->
{% getAgencyBillStatus request.user.profile.agency as billstatus %}
{% if billstatus == 3 %}
{% if billstatus == 3 and request.user|has_group_byname:"Administratoren" %}
<!-- All close -->
<div class="modal fade show" tabindex="-1" role="dialog" data-backdrop="static" id="noaccess">
<div class="modal-dialog" role="document">
@ -997,7 +997,7 @@ $(document).ready(function(){
});
});
</script>
{% elif billstatus == 2 %}
{% elif billstatus == 2 and request.user|has_group_byname:"Administratoren" %}
<div class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" id="noaccess">
<div class="modal-dialog" role="document">
<div class="modal-content">
@ -1028,7 +1028,7 @@ $(document).ready(function(){
});
</script>
{% elif billstatus == 1 %}
{% elif billstatus == 1 and request.user|has_group_byname:"Administratoren" %}
<div class="modal fade show" tabindex="-1" role="dialog" data-backdrop="static" id="noaccess">
<div class="modal-dialog" role="document">
<div class="modal-content">
@ -1055,7 +1055,7 @@ $(document).ready(function(){
}
});
</script>
{% elif billstatus == 11%}
{% elif billstatus == 11 and request.user|has_group_byname:"Administratoren" %}
<div class="modal fade show" tabindex="-1" role="dialog" data-backdrop="static" id="noaccess">
<div class="modal-dialog" role="document">
<div class="modal-content">