From d96d85e01d70b9b2516bc95379c6f7771f97f6e8 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 11 Feb 2010 08:28:17 +0000 Subject: [PATCH] [0000204] GRN Valuation Report shows wrong data --- CHANGELOG.txt | 4 ++++ reporting/rep305.php | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a04ad2cb..d841ce96 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +11-Feb-2010 Joe Hunt/Chaitanya +# [0000204] GRN Valuation Report shows wrong data +$ /reporting/rep305.php + 10-Feb-2010 Janusz Dobrowolski # [0000201] Cannot change item type when item is edited $ /inventory/manage/items.php diff --git a/reporting/rep305.php b/reporting/rep305.php index b752c6ef..bfbaf6b0 100644 --- a/reporting/rep305.php +++ b/reporting/rep305.php @@ -33,18 +33,20 @@ function getTransactions($from, $to) { $from = date2sql($from); $to = date2sql($to); - $sql = "SELECT ".TB_PREF."grn_batch.delivery_date, ".TB_PREF."grn_batch.supplier_id, - ".TB_PREF."purch_order_details.*, - ".TB_PREF."stock_master.description - FROM ".TB_PREF."stock_master, - ".TB_PREF."purch_order_details, - ".TB_PREF."grn_batch - WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."purch_order_details.item_code - AND ".TB_PREF."grn_batch.purch_order_no=".TB_PREF."purch_order_details.order_no - AND ".TB_PREF."purch_order_details.quantity_received>0 - AND ".TB_PREF."grn_batch.delivery_date>='$from' - AND ".TB_PREF."grn_batch.delivery_date<='$to' - ORDER BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."grn_batch.delivery_date"; + + $sql = "SELECT DISTINCT ".TB_PREF."grn_batch.supplier_id, + ".TB_PREF."purch_order_details.*, + ".TB_PREF."stock_master.description + FROM ".TB_PREF."stock_master, + ".TB_PREF."purch_order_details, + ".TB_PREF."grn_batch + WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."purch_order_details.item_code + AND ".TB_PREF."grn_batch.purch_order_no=".TB_PREF."purch_order_details.order_no + AND ".TB_PREF."purch_order_details.quantity_received>0 + AND ".TB_PREF."grn_batch.delivery_date>='$from' + AND ".TB_PREF."grn_batch.delivery_date<='$to' + ORDER BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."grn_batch.delivery_date"; + return db_query($sql,"No transactions were returned"); } -- 2.30.2