Wrong email-adress field taken when emailing documents [0000035].
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 8 Aug 2008 08:38:26 +0000 (08:38 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 8 Aug 2008 08:38:26 +0000 (08:38 +0000)
CHANGELOG.txt
sales/includes/db/cust_trans_db.inc

index 73e24bbe0620b04d9a492629f72ecf409f587d9c..f9925b5578786b5f57f08af2102feac4d2b0ff98 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+08-Aug-2008 Joe Hunt
+# Wrong email-adress field taken when emailing documents [0000035].
+$ /sales/includes/db/cust_trans_db.inc
+
 02-Aug-2008 Joe Hunt
 # Use Item Sales Account as default when creating new branch. Customer Branch Sales Account overrides Item Sales Accounts.
 $ /sales/manage/customer_branches.php
index bcd41dba3d3b2e61a125c13bb38838e1f7c7a2bb..d347dbbfb2903069b45aadfc5e461f95aa274c8e 100644 (file)
@@ -126,7 +126,7 @@ function get_customer_trans($trans_id, $trans_type)
 {
        $sql = "SELECT ".TB_PREF."debtor_trans.*,
                ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,
-               ".TB_PREF."debtors_master.name AS DebtorName, ".TB_PREF."debtors_master.address, ".TB_PREF."debtors_master.email,
+               ".TB_PREF."debtors_master.name AS DebtorName, ".TB_PREF."debtors_master.address, ".TB_PREF."debtors_master.email AS email2,
                ".TB_PREF."debtors_master.curr_code, ".TB_PREF."debtors_master.tax_id, ".TB_PREF."debtors_master.payment_terms ";
 
        if ($trans_type == systypes::cust_payment()) {
@@ -192,7 +192,10 @@ function get_customer_trans($trans_id, $trans_type)
                exit;
        }
 
-       return db_fetch($result);
+       //return db_fetch($result);
+       $row = db_fetch($result);
+       $row['email'] = $row['email2'];
+       return $row;
 }
 
 //----------------------------------------------------------------------------------------