Demand was calculated double from Sales Quotation. Should be 0
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Jan 2010 22:53:22 +0000 (22:53 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Jan 2010 22:53:22 +0000 (22:53 +0000)
CHANGELOG.txt
includes/db/manufacturing_db.inc

index 2d220267e13a9c59a87c6e64e35b4e24960690f9..285978bc6d459a0b05f751cf3783b647179180a4 100644 (file)
@@ -19,6 +19,9 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+18-Jan-2010 Joe Hunt
+# Demand was calculated double from Sales Quotation. Should be 0.
+$ /includes/db/manufacturing_db.inc
 # A back link was still in Bank Transfer.
 $ /gl/bank_transfer.php
 
index 31fb3eceaf8d306d9243a3b1a9cc9dade80ac87e..ca1841d2570e131fa017b44a193f79e123982090 100644 (file)
@@ -17,7 +17,8 @@ function get_demand_qty($stock_id, $location)
                        FROM ".TB_PREF."sales_order_details,
                                        ".TB_PREF."sales_orders
                                WHERE ".TB_PREF."sales_order_details.order_no="
-                               .TB_PREF."sales_orders.order_no AND ";
+                               .TB_PREF."sales_orders.order_no AND ".TB_PREF."sales_orders.trans_type=".ST_SALESORDER." AND 
+                               ".TB_PREF."sales_orders.trans_type=".TB_PREF."sales_order_details.trans_type AND ";
        if ($location != "")
                $sql .= TB_PREF."sales_orders.from_stk_loc =".db_escape($location)." AND ";
        $sql .= TB_PREF."sales_order_details.stk_code = ".db_escape($stock_id);