Bugs in sending sales orders as email.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 27 Jul 2009 21:04:45 +0000 (21:04 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 27 Jul 2009 21:04:45 +0000 (21:04 +0000)
CHANGELOG.txt
reporting/includes/pdf_report.inc

index 26833f772ddf1950279af2dc2bbf8deecd7c5ba2..ea349432da236c1f23fc497630dc37e8a477e689 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+27-Jul-2009 Joe Hunt
+# Bugs in sending sales orders as email.
+$ /reporting/includes/pdf_report.inc
+
 18-Jul-2009 Joe Hunt
 # When saving a Payment to a Customer in Bank Payments (normally payment to suppliers) it was saved with wrong sign in debtor_trans (very rare).
 $ /sales/includes/db/cust_trans_db.inc
index 1a0f7174fc215543428aca5048a172398bacd150..81fda39f8ccdf2c744b1566254011e064a3ac19e 100644 (file)
@@ -422,11 +422,11 @@ class FrontReport extends Cpdf
                                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'];
+                               if (!isset($myrow['email']) || $myrow['email'] == '') $myrow['email'] = $myrow['contact_email'];
                        $to = $myrow['DebtorName'] . " <" . $myrow['email'] . ">";
                        $msg = $doc_Dear_Sirs . " " . $myrow['DebtorName'] . ",\n\n" . $doc_AttachedFile . " " . $subject .
                                "\n\n";
-                               if ($myrow['dimension_id'] > 0 && $doctype == 10) // helper for payment links
+                               if (isset($myrow['dimension_id']) && $myrow['dimension_id'] > 0 && $doctype == 10) // helper for payment links
                                {
                                        if ($myrow['dimension_id'] == 1)
                                        {
@@ -458,6 +458,7 @@ class FrontReport extends Cpdf
                                $msg2 .= nl2br($sender) . "<br>";
                                $msg2 .= "<br>Filepath: " . $fname . "<br>Filename: " . $this->filename . "<br>";
                        }
+                       if (!isset($myrow['reference'])) $myrow['reference'] = '';
                                if (!$ret)
                                        display_error(_("Sending document by email failed"));
                                else