X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fpdf_report.inc;h=1a0f7174fc215543428aca5048a172398bacd150;hb=b558c8b9d4f710ffb1c3d2722a850fd394f4d939;hp=8c5d5727d42d1d6e11b41f327451c2369c39f1de;hpb=d567a10b7925c8bb97c734e213d6651a979af29d;p=fa-stable.git diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 8c5d5727..1a0f7174 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -54,7 +54,7 @@ class FrontReport extends Cpdf { switch ($size) { - + default: case 'A4': case 'a4': $this->pageWidth=595; @@ -419,11 +419,12 @@ class FrontReport extends Cpdf { include("doctext.inc"); } - require_once($path_to_root . "reporting/includes/class.mail.inc"); + require_once($path_to_root . "/reporting/includes/class.mail.inc"); $mail = new email($this->company['coy_name'], $this->company['email']); $from = $this->company['coy_name'] . " <" . $this->company['email'] . ">"; + if ($myrow['email'] == '') $myrow['email'] = $myrow['contact_email']; $to = $myrow['DebtorName'] . " <" . $myrow['email'] . ">"; - $msg = $doc_Dear_Sirs . ",\n\n" . $doc_AttachedFile . " " . $subject . + $msg = $doc_Dear_Sirs . " " . $myrow['DebtorName'] . ",\n\n" . $doc_AttachedFile . " " . $subject . "\n\n"; if ($myrow['dimension_id'] > 0 && $doctype == 10) // helper for payment links { @@ -438,7 +439,7 @@ class FrontReport extends Cpdf } } $msg .= $doc_Kindest_regards . "\n\n"; - $sender = $this->user . "\n" . $this->company['coy_name']; + $sender = $this->user . "\n" . $this->company['coy_name'] . "\n" . $this->company['postal_address'] . "\n" . $this->company['email'] . "\n" . $this->company['phone']; $mail->to($to); $mail->subject($subject); $mail->text($msg . $sender); @@ -457,14 +458,11 @@ class FrontReport extends Cpdf $msg2 .= nl2br($sender) . "
"; $msg2 .= "
Filepath: " . $fname . "
Filename: " . $this->filename . "
"; } - if ($ret) - $str = "
" . $this->title . " " . $myrow['reference'] . " " . _("sent to") . " "; - else - $str = "
" . $this->title . " " . $myrow['reference'] . " " . _("NOT sent to") . " "; - $msg2 .= $str . $myrow['DebtorName'] . " - " . $myrow['email']; - echo ""; - echo $msg2; - echo ""; + if (!$ret) + display_error(_("Sending document by email failed")); + else + display_notification($this->title . " " . $myrow['reference'] . " " + . _("has been sent by email.")); } else {