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,7 +35,7 @@ def incvar():
@register.filter(name="has_group_byname") @register.filter(name="has_group_byname")
def has_group_byname(user, groupname): def has_group_byname(user, groupname):
in_group = False in_group = False
if(user.profile.agency.module_recoverdir): #if(user.profile.agency.module_recoverdir):
agroup = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname=groupname)[0] agroup = AgencyGroup.objects.filter(agency=user.profile.agency, agencygroupname=groupname)[0]
for g in user.groups.all(): for g in user.groups.all():
if g.name == agroup.group.name: if g.name == agroup.group.name:
@ -866,6 +866,13 @@ def getAgencyBillStatus(agency):
for bill in bills: for bill in bills:
if bill.end >= today: if bill.end >= today:
activeBill = True 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 # Tage, die zwischen Registrierung und heute liegen
daysbetween = (today - regdate).days daysbetween = (today - regdate).days

View File

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