Eine Fehlerbehandlung bei fehlerhaften Rechnungen dazu

This commit is contained in:
holger.trampe 2021-01-18 21:03:14 +01:00
parent dbb60dbbd4
commit 987efe5f75
3 changed files with 19 additions and 15 deletions

BIN
dump.rdb

Binary file not shown.

View File

@ -1734,6 +1734,7 @@ def cronactionsbill(request, code):
unpaid_bills = AgencyBills.objects.all()
for bill in unpaid_bills:
try:
# Für jede Rechnung eine Anfrage an die LexOffice API und voucherStatus auslesen
headers = {
'Authorization': 'Bearer ' + settings.LEX_API,
@ -1750,6 +1751,8 @@ def cronactionsbill(request, code):
else:
bill.billstatus="open"
bill.save()
except:
mailstatus += "VOUCHERSTATUS ERROR ON BILL " + str(bill.pk)
# Monatliche Berechnung
@ -1916,6 +1919,7 @@ def cronactionsbill(request, code):
mailstatus,
'noreply@digitale-agentur.com',
["htrampe@gmail.com", "info@digitale-agentur.com"],
#["htrampe@gmail.com"],
fail_silently=True,
)
return JsonResponse(data)