Missing details on Purchase Order when emailing and printing
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 2 May 2007 15:50:00 +0000 (15:50 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 2 May 2007 15:50:00 +0000 (15:50 +0000)
CHANGELOG.txt
reporting/rep209.php

index 89d88b012a6fa65e3ad99f5ed687e7dd48155327..29510e0cbdf190380d687f8e815edb57fb34c866 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+02-May-2007 Joe Hunt
+ # Missing details on Purchase Order when emailing and printing
+ $ /reporting/rep209.php
 -------------------- 1.1 Stable Released ----------------------
 02-May-2007 Joe Hunt
  + Enabled module addons and all the below bugfixes. No changes in database structure.
index 947dd64d325cf762e8610ae5d8b50241e2445d90..1f9f5697b921c225c476efccef340934318157d8 100644 (file)
@@ -23,7 +23,8 @@ print_po();
 function get_po($order_no)
 {
        $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name, 
-               ".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."locations.location_name 
+               ".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."locations.location_name,
+               ".TB_PREF."suppliers.email, ".TB_PREF."suppliers.address 
                FROM ".TB_PREF."purch_orders, ".TB_PREF."suppliers, ".TB_PREF."locations 
                WHERE ".TB_PREF."purch_orders.supplier_id = ".TB_PREF."suppliers.supplier_id
                AND ".TB_PREF."locations.loc_code = into_stock_location 
@@ -90,7 +91,7 @@ function print_po()
                        $rep = new FrontReport("", "", user_pagesize());
                        $rep->currency = $cur;
                        $rep->Font();
-                       $rep->title = _('PURCHASE_ORDER');
+                       $rep->title = _('PURCHASE ORDER');
                        $rep->filename = "PurchaseOrder" . $i . ".pdf";
                        $rep->Info($params, $cols, null, $aligns);
                }
@@ -147,12 +148,10 @@ function print_po()
                $rep->Font();   
                if ($email == 1)
                {
-                       if ($myrow['contact_email'] == '')
-                       {
-                               $myrow['contact_email'] = $branch['email'];
-                               $myrow['DebtorName'] = $branch['br_name'];
-                       }
-                       $rep->End($email, $doc_Invoice_no . " " . $myrow['reference'], $myrow);
+                       $myrow['contact_email'] = $myrow['email'];
+                       $myrow['DebtorName'] = $myrow['supp_name'];
+                       $myrow['reference'] = $myrow['order_no'];
+                       $rep->End($email, $doc_Order_no . " " . $myrow['reference'], $myrow);
                }       
        }
        if ($email == 0)