CItem Cost Update will also regulate the stock moves standard cost to mirror correct GL.
[fa-stable.git] / sales / includes / db / cust_trans_db.inc
index efb6b25f97fa0139177d3e57309fd140de6474a1..d458e8c88c9c1b30678e25fd7f74fb2a73d6d315 100644 (file)
@@ -361,7 +361,7 @@ function get_sql_for_customer_inquiry()
        return $sql;
 }
 
-function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null)
+function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null, $customer_id=ALL_TEXT)
 {
        $sql = "SELECT trans.trans_no,
                        debtor.name,
@@ -415,6 +415,9 @@ function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_i
 
                if (isset($_POST['StockLocation']) && $_POST['StockLocation'] != ALL_TEXT)
                        $sql .= " AND sorder.from_stk_loc = ".db_escape($_POST['StockLocation'])." ";
+               
+               if ($customer_id != ALL_TEXT)
+                       $sql .= " AND trans.debtor_no = ".db_escape($customer_id);              
 
                $sql .= " GROUP BY trans.trans_no ";