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) {
$mail->subject($subject);
$mail->text($msg . $sender);
$mail->attachment($fname);
+ $emails .= " " . $contact['email'];
if ($mail->send()) $sent++;
} // foreach contact
unlink($fname);
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
}
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();
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();
}
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();
$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();
}
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();