|
@@ 50-54 (lines=5) @@
|
| 47 |
|
$scan_in_contact_id = $this->context->getKernel()->getSetting()->get('intranet', 'debtor.scan_in_contact'); |
| 48 |
|
|
| 49 |
|
$contact = new Contact($this->context->getKernel(), $scan_in_contact_id); |
| 50 |
|
if (!$contact->get('id') > 0) { |
| 51 |
|
throw new Exception('Der er ikke angivet nogen kontakt at sende de elektroniske fakturaer til'); |
| 52 |
|
} elseif (!$contact->address->get('email')) { |
| 53 |
|
throw new Exception('Der er ikke angivet nogen e-mail til Læs-Ind bureauet'); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
if ($debtor->contact->get('preferred_invoice') <> 3) { // elektronisk faktura |
| 57 |
|
throw new Exception('Kunden foretrækker ikke elektronisk faktura!'); |
|
@@ 56-60 (lines=5) @@
|
| 53 |
|
throw new Exception('Der er ikke angivet nogen e-mail til Læs-Ind bureauet'); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
if ($debtor->contact->get('preferred_invoice') <> 3) { // elektronisk faktura |
| 57 |
|
throw new Exception('Kunden foretrækker ikke elektronisk faktura!'); |
| 58 |
|
} elseif (!$debtor->contact->address->get('ean')) { |
| 59 |
|
throw new Exception('EAN-nummeret er ikke sat'); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
$subject = 'Elektronisk faktura'; |
| 63 |
|
$body = 'Hermed faktura #' . $debtor->get('number') . ' til at læse ind'; |