From 7729c70dcdc39b2d776f27cd12bd4631c93251b7 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 26 Dec 2011 10:16:11 +0100 Subject: [PATCH] Multiple email accounts on contacts didn't work in sales documents --- reporting/includes/pdf_report.inc | 6 ++++-- reporting/rep107.php | 2 +- reporting/rep109.php | 2 +- reporting/rep110.php | 2 +- reporting/rep111.php | 2 +- reporting/rep113.php | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index e4b4c3a6..ee79d43e 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -980,6 +980,7 @@ class FrontReport extends Cpdf display_error(_("You have no email contact defined for this type of document")); } else { $sent = $try = 0; + $emails = ""; if(!$subject) $subject = $this->formData['document_name'] . ' '. $this->formData['document_number']; foreach($this->contactData as $contact) { @@ -1018,6 +1019,7 @@ class FrontReport extends Cpdf $mail->subject($subject); $mail->text($msg . $sender); $mail->attachment($fname); + $emails .= " " . $contact['email']; if ($mail->send()) $sent++; } // foreach contact unlink($fname); @@ -1026,10 +1028,10 @@ class FrontReport extends Cpdf display_error(_("There is no contact email set for this document type.")); } elseif (!$sent) display_error($this->title . " " . $this->formData['document_number'] . ". " - . _("Sending document by email failed") . ". " . _("Email:") . " " . $contact['email']); + . _("Sending document by email failed") . ". " . _("Email:") . $emails); else display_notification($this->title . " " . $this->formData['document_number'] . " " - . _("has been sent by email to destination.") . " " . _("Email:") . " " . $contact['email']); + . _("has been sent by email to destination.") . " " . _("Email:") . $emails); } } else diff --git a/reporting/rep107.php b/reporting/rep107.php index 17fbd69d..62dc0f2c 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -92,7 +92,7 @@ function print_invoices() } else $rep->title = _('INVOICE'); - $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no']); + $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], false); $baccount['payment_service'] = $pay_service; $rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_SALESINVOICE, $contacts); $rep->NewPage(); diff --git a/reporting/rep109.php b/reporting/rep109.php index 181a0344..51697c3c 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -98,7 +98,7 @@ function print_sales_orders() else $rep->title = ($print_as_quote==1 ? _("QUOTE") : _("SALES ORDER")); - $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no']); + $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], false); $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESORDER, $contacts); $rep->NewPage(); diff --git a/reporting/rep110.php b/reporting/rep110.php index bcb89665..4b4fec83 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -101,7 +101,7 @@ function print_deliveries() } else $rep->title = _('DELIVERY NOTE'); - $contacts = get_branch_contacts($branch['branch_code'], 'delivery', $branch['debtor_no']); + $contacts = get_branch_contacts($branch['branch_code'], 'delivery', $branch['debtor_no'], false); $rep->SetCommonData($myrow, $branch, $sales_order, '', ST_CUSTDELIVERY, $contacts); $rep->NewPage(); diff --git a/reporting/rep111.php b/reporting/rep111.php index 80b6b712..07fbd41f 100644 --- a/reporting/rep111.php +++ b/reporting/rep111.php @@ -84,7 +84,7 @@ function print_sales_quotations() $rep->Info($params, $cols, null, $aligns); } $rep->title = _("SALES QUOTATION"); - $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no']); + $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], false); $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESQUOTE, $contacts); //$rep->headerFunc = 'Header2'; $rep->NewPage(); diff --git a/reporting/rep113.php b/reporting/rep113.php index 7a612243..aec634e2 100644 --- a/reporting/rep113.php +++ b/reporting/rep113.php @@ -94,7 +94,7 @@ function print_credits() } else $rep->title = _('CREDIT NOTE'); - $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no']); + $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], false); $rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_CUSTCREDIT, $contacts); $rep->NewPage(); -- 2.30.2