From dd1da8ab2e1d9ce46d2eb6b7addb09fc413528bc Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 4 Aug 2009 08:18:17 +0000 Subject: [PATCH] [0000145] Email sales order doesn't work if no email on branch but on customer --- CHANGELOG.txt | 3 +++ reporting/rep109.php | 2 ++ sales/includes/db/sales_order_db.inc | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fab8cb13..ea2b6a0b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,9 @@ $ -> Affected files 04-Aug-2009 Joe Hunt # [0000150] Logo on printed papers is placed on top of the adress rule nr 1 $ /reporting/includes/header2.inc +# [0000145] Email sales order doesn't work if no email on branch but on customer +$ /sales/includes/db/sales_order_db.inc + /reporting/rep109.php ------------------------------- Release 2.1.4 ---------------------------------- 30-Jul-2009 Joe Hunt diff --git a/reporting/rep109.php b/reporting/rep109.php index 00b06d2e..31a769df 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -161,6 +161,8 @@ function print_sales_orders() if ($myrow['contact_email'] == '') { $myrow['contact_email'] = $branch['email']; + if ($myrow['contact_email'] == '') + $myrow['contact_email'] = $myrow['master_email']; $myrow['DebtorName'] = $branch['br_name']; } $myrow['reference'] = $i; diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index f48cbcf1..28aebb36 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -256,6 +256,7 @@ function get_sales_order_header($order_no) $sql = "SELECT ".TB_PREF."sales_orders.*, " .TB_PREF."debtors_master.name, " .TB_PREF."debtors_master.curr_code, " + .TB_PREF."debtors_master.email AS master_email, " .TB_PREF."locations.location_name, " .TB_PREF."debtors_master.payment_terms, " .TB_PREF."debtors_master.discount, " -- 2.30.2