Database error when updating more than one item row in Sales Orders.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 4 May 2007 22:37:40 +0000 (22:37 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 4 May 2007 22:37:40 +0000 (22:37 +0000)
CHANGELOG.txt
sales/includes/db/sales_order_db.inc

index 8cf61f6f4a633d24412b86cb797243736a780430..da033eb827118caff8e46f86deeeaf46f9244629 100644 (file)
@@ -20,7 +20,9 @@ Legend:
 $ -> Affected files
 
 04-May-2007 Joe Hunt
- # Database error hen inserting work order issues. Fixed.
+ # Database error when updating more than one item row in Sales Orders.
+ $ /sales/includes/db/sales_order_db.inc
+ # Database error when inserting work order issues. Fixed.
  $ /manufacturing/includes/db/work_order_issues_db.inc
  
 03-May-2007 Joe Hunt
index ee32a37fa5d6687ae51430e2519b8e10ffb6a40b..58c98999064c0d3d43c1a3a753fc424c426b9c43 100644 (file)
@@ -86,11 +86,11 @@ function update_sales_order($order_no, $order)
 
        db_query($sql, "Old order Cannot be Deleted");
 
-       $sql = "INSERT INTO ".TB_PREF."sales_order_details (order_no, stk_code,  description, unit_price, quantity, discount_percent, qty_invoiced) VALUES (";
-
        foreach ($order->line_items as $stock_item) 
        {
 
+               $sql = "INSERT INTO ".TB_PREF."sales_order_details (order_no, stk_code,  description, unit_price, quantity, discount_percent, qty_invoiced) VALUES (";
+               
                $sql .= $order_no . ",'" . $stock_item->stock_id . "','" . $stock_item->item_description . "', " . $stock_item->price . ", " . $stock_item->quantity . ", " . $stock_item->discount_percent . ", " . $stock_item->qty_inv . " )";
 
                db_query($sql, "Old order Cannot be Inserted");