Aktive Rechnungen inkl. Meldung hinzufgefügt

This commit is contained in:
holger.trampe 2020-12-06 11:54:34 +01:00
parent a33db3ba6c
commit 8c34f91033
3 changed files with 12 additions and 13 deletions

View File

@ -845,6 +845,7 @@ 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!
11 - Plan erstellt und Rechungen für den aktuellen Zeitraum vorhanden
20 - KOSTENLOS
'''
@ -863,14 +864,12 @@ def getAgencyBillStatus(agency):
activeBill = False
for bill in bills:
if bill.end <= today and bill.billstatus == "paid":
if bill.end >= today:
activeBill = True
# 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:
@ -883,10 +882,7 @@ def getAgencyBillStatus(agency):
returnvalue = 10
elif agency.paymentplan == 1 and activeBill == False:
returnvalue = 11
#paymentplan = models.IntegerField(default=0, null=True, blank=True)
#payment_address = models.EmailField(default=None, blank=True, null=True)
return returnvalue

View File

@ -1056,15 +1056,14 @@ $(document).ready(function(){
});
</script>
{% elif billstatus == 11%}
{% if request.user|usergperm:"agencyinfo" %}
<div class="modal fade show" tabindex="-1" role="dialog" data-backdrop="static" id="noaccess">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Offene Rechnungen</h5>
<h5 class="modal-title">Keine aktuellen Rechnungen</h5>
</div>
<div class="modal-body">
Ihre Agentur hat offene Rechnungen! Bitte begleichen Sie die Rechnungen innerhalb von maximal zwei Wochen.
Ihre Rechnungen sind ausgelaufen bzw. nicht bezahlt. Bitte prüfen Sie Ihren Abo-Status und aktuelle Rechnungen! Wenden Sie sich bei Fragen an den Support.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Schliessen</button>
@ -1083,9 +1082,13 @@ $(document).ready(function(){
}
});
</script>
{% endif %}
{% endif %}
<script type="text/javascript">
console.log("{{billstatus}}");
</script>