From a7df4f0b55feab93085f80b53420f46bf07ffceb Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 8 Sep 2009 15:50:58 +0000 Subject: [PATCH] Changed so voiding and view/print is working with the new Sales Order/Sales Quotation --- CHANGELOG.txt | 8 ++++++++ admin/db/voiding_db.inc | 5 +++++ admin/view_print_transaction.php | 2 +- admin/void_transaction.php | 4 ++++ sales/includes/db/sales_order_db.inc | 4 ++-- sales/view/view_sales_order.php | 2 ++ 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fdb36e1a..26318b67 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,14 @@ Legend: ! -> Note $ -> Affected files +08-Sep-2009 Joe Hunt +! Changed so voiding and view/print is working with the new Sales Order/Sales Quotation +$ /admin/view_print_transaction.php + /admin/void_transaction.php + /admin/db/voiding_db.inc + /sales/includes/db/sales_order_db.inc + /sales/view/view_sales_order.php + 08-Sep-2009 Janusz Dobrowolski + Added detection of partial db upgrade. $ /admin/inst_upgrade.php diff --git a/admin/db/voiding_db.inc b/admin/db/voiding_db.inc index 1447bd9b..cb433def 100644 --- a/admin/db/voiding_db.inc +++ b/admin/db/voiding_db.inc @@ -66,6 +66,7 @@ function void_transaction($type, $type_no, $date_, $memo_) void_stock_adjustment($type_no); break; + case 18 : // it's a PO case 25 : // it's a GRN return false; case 20 : // it's a suppler invoice @@ -95,6 +96,10 @@ function void_transaction($type, $type_no, $date_, $memo_) void_work_order_produce($type_no); break; + case 30: // it's a sales order + case 32: // it's a sales quotation + return false; + case systypes::cost_update() : // it's a stock cost update return false; break; diff --git a/admin/view_print_transaction.php b/admin/view_print_transaction.php index f46f2053..93ae00cd 100644 --- a/admin/view_print_transaction.php +++ b/admin/view_print_transaction.php @@ -120,7 +120,7 @@ function handle_search() $print_type = $_POST['filterType']; $print_out = ($print_type == 10 || $print_type == 11 || $print_type == systypes::cust_dispatch() || - $print_type == systypes::po() || $print_type == systypes::sales_order()); + $print_type == systypes::po() || $print_type == systypes::sales_order() || $print_type == systypes::sales_quotation()); $cols = array( _("#"), diff --git a/admin/void_transaction.php b/admin/void_transaction.php index e0d22ef7..c28c916b 100644 --- a/admin/void_transaction.php +++ b/admin/void_transaction.php @@ -66,6 +66,7 @@ function exist_transaction($type, $type_no) return false; break; + case 18 : // it's a PO case 25 : // it's a GRN return false; case 20 : // it's a suppler invoice @@ -90,6 +91,9 @@ function exist_transaction($type, $type_no) return false; break; + case 30: // it's a sales order + case 32: // it's a sales quotation + return false; case systypes::cost_update() : // it's a stock cost update return false; break; diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index 1a11323e..f51ba11a 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -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"); } diff --git a/sales/view/view_sales_order.php b/sales/view/view_sales_order.php index 40902e44..920b1fc7 100644 --- a/sales/view/view_sales_order.php +++ b/sales/view/view_sales_order.php @@ -191,6 +191,8 @@ if ($_GET['trans_type'] != 32) end_table(); } echo "
"; +if ($_SESSION['View']->so_type == 1) + display_note(_("This Sales Order is used as a Template."), 0, 0, "class='currentfg'"); display_heading2(_("Line Details")); start_table("colspan=9 width=95% $table_style"); -- 2.30.2