Removed not used yet ajax stuff, added combo class binding and setFocus()
[fa-stable.git] / gl / bank_transfer.php
index 83d2750afe2430b7414f9a3c85e69c034daae978..5f5a783b98ca16f9b8ee9b6d459cc5c5d3814c4a 100644 (file)
@@ -14,6 +14,8 @@ include_once($path_to_root . "/gl/includes/gl_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
+if ($use_date_picker)
+       $js .= get_js_date_picker();
 page(_("Transfer between Bank Accounts"), false, false, "", $js);
 
 check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
@@ -102,14 +104,9 @@ function check_valid_entries()
                return false;
        }
 
-       if (!is_numeric($_POST['amount'])) 
+       if (!check_num('amount', 0)) 
        {
-               display_error(_("The entered amount is invalid."));
-               return false;
-       }
-       if ($_POST['amount'] <= 0) 
-       {
-               display_error(_("The entered amount must be a positive number."));
+               display_error(_("The entered amount is invalid or less than zero."));
                return false;
        }
 
@@ -141,7 +138,7 @@ function handle_add_deposit()
        global $path_to_root;
 
        $trans_no = add_bank_transfer($_POST['FromBankAccount'], $_POST['ToBankAccount'],
-               $_POST['DatePaid'], $_POST['amount'],
+               $_POST['DatePaid'], input_num('amount'),
                $_POST['TransferType'], $_POST['ref'], $_POST['memo_']);
 
        meta_forward($_SERVER['PHP_SELF'], "AddedID=$trans_no");