Stable merged into unstable again (due to failure on binary file during previous...
[fa-stable.git] / gl / gl_bank.php
index 97f67ddcb9815f7d123358d9ede77175a8467ded..58479d5bee8bed7f6ccd39efda69f8227fa64251 100644 (file)
@@ -144,6 +144,8 @@ 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;
 
@@ -194,7 +196,7 @@ function create_cart($type, $trans_no)
                // apply exchange rate
                foreach($cart->gl_items as $line_no => $line)
                        $cart->gl_items[$line_no]->amount *= $ex_rate;
-               
+
        } else {
                $cart->reference = $Refs->get_next($cart->trans_type);
                $cart->tran_date = new_doc_date();
@@ -264,7 +266,7 @@ if (isset($_POST['Process']))
        }
        elseif (!is_date_in_fiscalyear($_POST['date_']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                $input_error = 1;
        } 
@@ -294,7 +296,7 @@ if (isset($_POST['Process']))
                $_SESSION['pay_items']->trans_type, $_SESSION['pay_items']->order_id, $_POST['bank_account'],
                $_SESSION['pay_items'], $_POST['date_'],
                $_POST['PayType'], $_POST['person_id'], get_post('PersonDetailID'),
-               $_POST['ref'], $_POST['memo_'], true);
+               $_POST['ref'], $_POST['memo_'], false);
 
        $trans_type = $trans[0];
        $trans_no = $trans[1];