Changed so voiding and view/print is working with the new Sales Order/Sales Quotation
[fa-stable.git] / sales / includes / db / sales_order_db.inc
index 1a11323e7330a6b5ebe2854891c9a60e36001ec5..f51ba11ab17b0a885ddda3039629070d0b680453 100644 (file)
@@ -375,7 +375,7 @@ function read_sales_order($order_no, &$order, $trans_type)
 function sales_order_has_deliveries($order_no)
 {
        $sql = "SELECT SUM(qty_sent) FROM ".TB_PREF.
-       "sales_order_details WHERE order_no=$order_no";
+       "sales_order_details WHERE order_no=$order_no AND trans_type=30";
 
        $result = db_query($sql, "could not query for sales order usage");
 
@@ -392,7 +392,7 @@ function close_sales_order($order_no)
        $sql = "UPDATE ".TB_PREF."sales_order_details
                SET quantity = qty_sent,
                        type = 0,
-                       WHERE order_no = $order_no";
+                       WHERE order_no = $order_no AND trans_type=30";
 
        db_query($sql, "The sales order detail record could not be updated");
 }