X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.3.php;h=c568245962f3a648890ebd5b1dd9c278f93a2c15;hb=87af4ea9405a74c0e4be19b9076f6d6d64b20e29;hp=0b1c230c4df1fa2c17d2dafd317de5d00390dd70;hpb=cc9b86a602234f71634f3b975b7757b25a660f11;p=fa-stable.git diff --git a/sql/alter2.3.php b/sql/alter2.3.php index 0b1c230c..c5682459 100644 --- a/sql/alter2.3.php +++ b/sql/alter2.3.php @@ -138,14 +138,15 @@ class fa2_3 { include_once("$path_to_root/sales/includes/cart_class.inc"); include_once("$path_to_root/purchasing/includes/po_class.inc"); $cart = new cart(ST_SALESORDER); - $sql = "SELECT order_no FROM {$pref}sales_orders"; + $sql = "SELECT order_no, trans_type FROM {$pref}sales_orders"; $orders = db_query($sql); if (!$orders) return false; - - while ($order_no = db_fetch($orders)) { - read_sales_order($order_no[0], $cart, ST_SALESORDER); - $result = db_query("UPDATE {$pref}sales_orders SET total=".$cart->get_trans_total()); + while ($order = db_fetch($orders)) { + read_sales_order($order['order_no'], $cart, $order['trans_type']); + $result = db_query("UPDATE {$pref}sales_orders + SET total=".$cart->get_trans_total() + ." WHERE order_no=".$order[0]); unset($cart->line_items); } unset($cart);