[0000136] view_po on invoices and credits shows transactions from other suppliers
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 17 Jun 2009 07:27:01 +0000 (07:27 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 17 Jun 2009 07:27:01 +0000 (07:27 +0000)
CHANGELOG.txt
config.php
purchasing/includes/db/invoice_db.inc

index d7327d61ea3f4ea1d28590bb514b9dedebea25c1..601a41657768ff55adbcbac9d27091d83b057887 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+17-Jun-2009 Joe Hunt/Tu Nguyen
+# [0000136] view_po on invoices and credits shows transactions from other suppliers
+$ /purchasing/includes/db/invoice_db.inc
+
 16-Jun-2009 Janusz Dobrowolski
 ! Added error logging to file or syslog.
 $ /config.php
index 20a08974b440d51621f4ddc960e516852544efa0..1259de248adfe95af50a0061ae9e8912a83d0e8a 100644 (file)
@@ -23,7 +23,8 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        // Log file for error/warning messages. Should be set to any location
        // writable by www server. When set to empty string logging is switched off. 
        // Special value 'syslog' can be used for system logger usage (see php manual).
-       $error_logfile = dirname(__FILE__).'/tmp/errors.log';
+       $error_logfile = '';
+       //$error_logfile = dirname(__FILE__).'/tmp/errors.log';
        $debug                  = 1;
        $show_sql               = 0;
        $go_debug               = 0;
index 2ccafc4ced877cfe7db8642fd8b6be8c17de3878..7a07e2edda809fe5ca6e7b5de22790cbab0e3d27 100644 (file)
@@ -330,9 +330,10 @@ function get_po_invoices_credits($po_number)
        $sql = "SELECT DISTINCT ".TB_PREF."supp_trans.trans_no, ".TB_PREF."supp_trans.type,
                ov_amount+ov_discount+ov_gst AS Total,
                ".TB_PREF."supp_trans.tran_date
-               FROM ".TB_PREF."supp_trans, ".TB_PREF."supp_invoice_items, ".TB_PREF."purch_order_details
+               FROM ".TB_PREF."supp_trans, ".TB_PREF."supp_invoice_items, ".TB_PREF."purch_order_details, ".TB_PREF."purch_orders
                WHERE ".TB_PREF."supp_invoice_items.supp_trans_no = ".TB_PREF."supp_trans.trans_no
                AND ".TB_PREF."supp_invoice_items.po_detail_item_id = ".TB_PREF."purch_order_details.po_detail_item
+               AND ".TB_PREF."purch_orders.supplier_id = ".TB_PREF."supp_trans.supplier_id
                AND ".TB_PREF."purch_order_details.order_no = $po_number";
 
        return db_query($sql, "The invoices/credits for the po $po_number could not be retreived");