From 6c7615033b01cce21a088dcfdb20e874533cc921 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 17 Jun 2009 07:27:01 +0000 Subject: [PATCH] [0000136] view_po on invoices and credits shows transactions from other suppliers --- CHANGELOG.txt | 4 ++++ config.php | 3 ++- purchasing/includes/db/invoice_db.inc | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d7327d61..601a4165 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/config.php b/config.php index 20a08974..1259de24 100644 --- a/config.php +++ b/config.php @@ -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; diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 2ccafc4c..7a07e2ed 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -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"); -- 2.30.2