Changed so voiding and view/print is working with the new Sales Order/Sales Quotation
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 8 Sep 2009 15:50:58 +0000 (15:50 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 8 Sep 2009 15:50:58 +0000 (15:50 +0000)
CHANGELOG.txt
admin/db/voiding_db.inc
admin/view_print_transaction.php
admin/void_transaction.php
sales/includes/db/sales_order_db.inc
sales/view/view_sales_order.php

index fdb36e1a14a6abf69038c30032a122132a1f4539..26318b67eea7a38815a548ec168303be1dcaacd0 100644 (file)
@@ -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
index 1447bd9b2b1c8d2e074f466a17867ee14331a178..cb433def442527e3682e50edd33c60d4ca8aef87 100644 (file)
@@ -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;
index f46f2053be199c81df6e8290f05eaabed76f208e..93ae00cd3ec97136e570cdbcb921c25f1ae58789 100644 (file)
@@ -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(
                        _("#"), 
index e0d22ef71c7ed0fa8eb56e794e8efd3270853793..c28c916b48ea15d7b70639f9ccb21c4393081061 100644 (file)
@@ -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;
index 1a11323e7330a6b5ebe2854891c9a60e36001ec5..f51ba11ab17b0a885ddda3039629070d0b680453 100644 (file)
@@ -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");
 }
index 40902e445cd759d8486c870a0e0fbd688cf1dd27..920b1fc7d4cd65e4f3e7c229a569e28c99aafd0c 100644 (file)
@@ -191,6 +191,8 @@ if ($_GET['trans_type'] != 32)
        end_table();
 }
 echo "<center>";
+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");