Rerun. Update material cost when quantity on hand is zero. @notrinos.
[fa-stable.git] / gl / gl_bank.php
index 3d3f86e64e33643671549e348713a60ad0a0e7fd..2d44653179c3e0e72c54c914a610f727a0663081 100644 (file)
@@ -60,11 +60,15 @@ if (list_updated('PersonDetailID')) {
 
 //--------------------------------------------------------------------------------------------------
 function line_start_focus() {
-  global       $Ajax;
-
-  $Ajax->activate('items_table');
-  $Ajax->activate('footer');
-  set_focus('_code_id_edit');
+       global  $Ajax;
+
+    unset($_POST['amount']);
+    unset($_POST['dimension_id']);
+    unset($_POST['dimension2_id']);
+    unset($_POST['LineMemo']);
+       $Ajax->activate('items_table');
+       $Ajax->activate('footer');
+       set_focus('_code_id_edit');
 }
 
 //-----------------------------------------------------------------------------------------------
@@ -185,7 +189,6 @@ function create_cart($type, $trans_no)
                                        // so we have to restore it from original gl amounts
                                        $ex_rate = $bank_trans['amount']/$row['amount'];
                                } else {
-                                       $date = $row['tran_date'];
                                        $cart->add_gl_item( $row['account'], $row['dimension_id'],
                                                $row['dimension2_id'], $row['amount'], $row['memo_']);
                                }
@@ -381,7 +384,7 @@ if (isset($_POST['AddItem']))
 if (isset($_POST['UpdateItem']))
        handle_update_item();
 
-if (isset($_POST['CancelItemChanges']))
+if (isset($_POST['CancelItemChanges']) || isset($_POST['Index']))
        line_start_focus();
 
 if (isset($_POST['go']))