Merged changes from stable branch up to 2.3.12
[fa-stable.git] / gl / gl_bank.php
index 3c8897c4299ddb11fae598939d679cead4f6651c..8c8860d0c47dbf405d7521eb43b8b2033d029571 100644 (file)
@@ -48,6 +48,9 @@ page($_SESSION['page_title'], false, false, '', $js);
 //-----------------------------------------------------------------------------------------------
 check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
 
+if (isset($_GET['ModifyDeposit']) || isset($_GET['ModifyPayment']))
+       check_is_editable($_SESSION['pay_items']->trans_type, $_SESSION['pay_items']->order_id);
+
 //----------------------------------------------------------------------------------------
 if (list_updated('PersonDetailID')) {
        $br = get_branch(get_post('PersonDetailID'));
@@ -144,8 +147,6 @@ function create_cart($type, $trans_no)
                unset ($_SESSION['pay_items']);
        }
 
-       check_is_closed($type, $trans_no);
-
        $cart = new items_cart($type);
     $cart->order_id = $trans_no;
 
@@ -280,6 +281,8 @@ if (isset($_POST['Process']))
                set_focus('person_id');
                $input_error = 1;
        }
+       if (!db_has_currency_rates(get_bank_account_currency($_POST['bank_account']), $_POST['date_'], true))
+               $input_error = 1;
 
        if ($input_error == 1)
                unset($_POST['Process']);