Default Receival Days implemented. Maintained in System and GL Setup.
[fa-stable.git] / gl / gl_journal.php
index bc3e15e963286245665aec8bcee31404c28b80cf..107c6d6328a21813fcb7186d0b4233139918a450 100644 (file)
@@ -41,6 +41,7 @@ page($_SESSION['page_title'], false, false,'', $js);
 function line_start_focus() {
   global       $Ajax;
 
+  unset($_POST['Index']);
   $Ajax->activate('items_table');
   set_focus('_code_id_edit');
 }
@@ -58,6 +59,8 @@ if (isset($_GET['AddedID']))
        reset_focus();
        hyperlink_params($_SERVER['PHP_SELF'], _("Enter &New Journal Entry"), "NewJournal=Yes");
 
+       hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), "filterType=$trans_type&trans_no=$trans_no");
+
        display_footer_exit();
 } elseif (isset($_GET['UpdatedID'])) 
 {
@@ -97,6 +100,7 @@ function create_cart($type=0, $trans_no=0)
                unset ($_SESSION['journal_items']);
        }
 
+       check_is_closed($type, $trans_no);
        $cart = new items_cart($type);
     $cart->order_id = $trans_no;
 
@@ -108,7 +112,7 @@ function create_cart($type=0, $trans_no=0)
                                if ($row['amount'] == 0) continue;
                                $date = $row['tran_date'];
                                $cart->add_gl_item($row['account'], $row['dimension_id'], 
-                                       $row['dimension2_id'], $row['amount'], $row['memo_']);
+                                       $row['dimension2_id'], $row['amount'], $row['memo_'], '', $row['person_id']);
                        }
                }
                $cart->memo_ = get_comments_string($type, $trans_no);
@@ -157,7 +161,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;
        } 
@@ -265,7 +269,7 @@ function handle_update_item()
                $amount = -input_num('AmountCredit');
 
        $_SESSION['journal_items']->update_gl_item($_POST['Index'], $_POST['code_id'], 
-           $_POST['dimension_id'], $_POST['dimension2_id'], $amount, $_POST['LineMemo']);
+           $_POST['dimension_id'], $_POST['dimension2_id'], $amount, $_POST['LineMemo'], '', get_post('person_id'));
     }
        line_start_focus();
 }
@@ -291,7 +295,7 @@ function handle_new_item()
                $amount = -input_num('AmountCredit');
        
        $_SESSION['journal_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'],
-               $_POST['dimension2_id'], $amount, $_POST['LineMemo']);
+               $_POST['dimension2_id'], $amount, $_POST['LineMemo'], '', get_post('person_id'));
        line_start_focus();
 }