1
+ # -*- coding: utf-8 -*-
1
2
import logging
2
3
from decimal import Decimal
3
- from django . utils import timezone
4
+
4
5
from django .conf import settings
5
- from holviapp .utils import list_invoices
6
- from holviapi .utils import barcode as bank_barcode
7
- from .models import NotificationSent
8
6
from django .core .mail import EmailMessage
9
7
from django .template import Context
10
8
from django .template .loader import get_template
9
+ from django .utils import timezone
10
+ from holviapi .utils import barcode as bank_barcode
11
+ from holviapp .utils import list_invoices
12
+
13
+ from .models import NotificationSent
11
14
12
15
logger = logger .getLogger ()
13
16
17
+
14
18
class HolviOverdueInvoicesHandler (object ):
15
19
def process_overdue (self , send = False ):
16
20
barcode_iban = settings .HOLVI_BARCODE_IBAN
@@ -36,8 +40,8 @@ def process_overdue(self, send=False):
36
40
barcode = bank_barcode (barcode_iban , invoice .rf_reference , Decimal (invoice .due_sum ))
37
41
38
42
mail = EmailMessage ()
39
- mail .subject = subject_template .render (Context ({ "invoice" : invoice , "barcode" : barcode })).strip ()
40
- mail .body = body_template .render (Context ({ "invoice" : invoice , "barcode" : barcode }))
43
+ mail .subject = subject_template .render (Context ({"invoice" : invoice , "barcode" : barcode })).strip ()
44
+ mail .body = body_template .render (Context ({"invoice" : invoice , "barcode" : barcode }))
41
45
mail .to = [invoice .receiver .email ]
42
46
if send :
43
47
try :
0 commit comments