Fixed bug resulting in broken line items relations after edition of multiline SO.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 6 Feb 2010 19:03:12 +0000 (19:03 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 6 Feb 2010 19:03:12 +0000 (19:03 +0000)
sales/includes/db/sales_order_db.inc

index 2d8808770fea36f018ffae4d3d919a3a20211338..79d5adc9deff3332e0314106a6eba7aa7ab7ea1c 100644 (file)
@@ -221,10 +221,11 @@ function update_sales_order($order)
                        }
                }
                $sql = "INSERT INTO ".TB_PREF."sales_order_details
-                (order_no, trans_type, stk_code,  description, unit_price, quantity,
+                (id, order_no, trans_type, stk_code,  description, unit_price, quantity,
                  discount_percent, qty_sent)
                 VALUES (";
-               $sql .= $order_no . ",".$order->trans_type.","
+               $sql .= db_escape($line->id ? $line->id : 0) . ","
+                 .$order_no . ",".$order->trans_type.","
                  .db_escape($line->stock_id) . ","
                  .db_escape($line->item_description) . ", "
                  .db_escape($line->price) . ", "