Fixed edition of purchase order (bug #0000001)
[fa-stable.git] / gl / gl_deposit.php
index 3c0fc97ac3f5948b8e1206c73d78380d6db3f481..cdc4910bede9554a6b4c5be5eaa86f30ec2fdb7d 100644 (file)
@@ -17,7 +17,7 @@ if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if ($use_date_picker)
        $js .= get_js_date_picker();
-set_focus('CodeID2');
+
 page(_("Bank Account Deposit Entry"), false, false, '', $js);
 
 //-----------------------------------------------------------------------------------------------
@@ -207,21 +207,30 @@ function handle_new_item()
 }
 
 //-----------------------------------------------------------------------------------------------
-
-if (isset($_GET['Delete']) || isset($_GET['Edit']))
+if (isset($_GET['Edit'])) {
+       copy_from_py();
+       set_focus('dimension_id');
+}
+if (isset($_GET['Delete'])) {
        copy_from_py();
-
-if (isset($_GET['Delete']))
        handle_delete_item();
-
-if (isset($_POST['AddItem']) || isset($_POST['UpdateItem']))
+       set_focus('_code_id_edit');
+}
+if (isset($_POST['AddItem'])) {
        copy_to_py();
-
-if (isset($_POST['AddItem']))
        handle_new_item();
-
-if (isset($_POST['UpdateItem']))
+       set_focus('_code_id_edit');
+}
+if (isset($_POST['UpdateItem'])) {
+       copy_to_py();
        handle_update_item();
+       set_focus('_code_id_edit');
+}
+if (isset($_POST['CancelItemChanges']))
+       set_focus('_code_id_edit');
+
+if (isset($_POST['EditItem']))
+       set_focus('dimension_id');
 
 //-----------------------------------------------------------------------------------------------