[0000145] Email sales order doesn't work if no email on branch but on customer
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 Aug 2009 08:18:17 +0000 (08:18 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 Aug 2009 08:18:17 +0000 (08:18 +0000)
CHANGELOG.txt
reporting/rep109.php
sales/includes/db/sales_order_db.inc

index fab8cb1381b31fd9a9d557a0c7f4f829662c5809..ea2b6a0bd57484664e8ad7aa3602d9afa32fc96e 100644 (file)
@@ -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
index 00b06d2ef1f2c513bcf288a527f8e419f9fe6162..31a769df1114bb1ff4dc68558119897c2bd8d621 100644 (file)
@@ -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;
index f48cbcf140d31a606e06beb4064f0c6aa08df8c6..28aebb36edeb564b7c9e078269e28fdd9d1ee7e4 100644 (file)
@@ -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, "