From 5ce194dce54ad79dc66f21766847615655b9e1c0 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 27 Jul 2009 21:04:45 +0000 Subject: [PATCH] Bugs in sending sales orders as email. --- CHANGELOG.txt | 4 ++++ reporting/includes/pdf_report.inc | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26833f7..ea34943 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 1a0f717..81fda39 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -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) . "
"; $msg2 .= "
Filepath: " . $fname . "
Filename: " . $this->filename . "
"; } + if (!isset($myrow['reference'])) $myrow['reference'] = ''; if (!$ret) display_error(_("Sending document by email failed")); else -- 2.30.2