From: Joe Hunt Date: Fri, 4 May 2007 22:37:40 +0000 (+0000) Subject: Database error when updating more than one item row in Sales Orders. X-Git-Tag: 2.3-final~1539 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=848db51d96df4ad8b3cac1c67b0b828d29737ddc;p=fa-stable.git Database error when updating more than one item row in Sales Orders. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8cf61f6f..da033eb8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index ee32a37f..58c98999 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -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");