Code cleanup
[fa-stable.git] / sales / sales_order_entry.php
index 9aa99e2045ff3b2011d73b9e5f2470dce6e85f00..dfeb153279eccdc426ca84180ecf0f610f08942e 100644 (file)
@@ -16,7 +16,6 @@ include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
-
 $js = '';
 
 if ($use_popup_windows) {
@@ -189,7 +188,6 @@ function line_start_focus() {
   global       $Ajax;
 
   $Ajax->activate('items_table');
-  $Ajax->addFocus(true, '_stock_id_edit');
   set_focus('_stock_id_edit');
 }
 //--------------------------------------------------------------------------------
@@ -234,7 +232,8 @@ function can_process() {
                set_focus('delivery_date');
                return false;
        }
-       if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) {
+       //if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) {
+       if (date1_greater_date2($_POST['OrderDate'], $_POST['delivery_date'])) {
                display_error(_("The requested delivery date is before the date of the order."));
                set_focus('delivery_date');
                return false;
@@ -304,7 +303,6 @@ function handle_update_item()
                 input_num('qty'), input_num('price'),
                 input_num('Disc') / 100 );
        }
-  copy_from_cart();
   line_start_focus();
 }
 
@@ -413,12 +411,10 @@ if (isset($_POST['UpdateItem']))
 if (isset($_POST['AddItem']))
        handle_new_item();
 
-if (isset($_POST['CancelItemChanges']) || isset($_POST['UpdateItem'])) {
+if (isset($_POST['CancelItemChanges'])) {
        line_start_focus();
 }
 
-if (isset($_POST['_customer_id_update']))
-    set_focus('branch_id');
 //--------------------------------------------------------------------------------
 check_db_has_stock_items(_("There are no inventory items defined in the system."));