X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fgl_journal.php;h=063dd8aed39165f77e39d3f3ac6088cb69f27f31;hb=0b63d898491b6577a5a5bf90e771dca0dcbbcf1f;hp=035de8ac0c22fe4990911eb3496ccd09aac087a0;hpb=279d7962a249da9cbc3074360e3a68a23a31145e;p=fa-stable.git diff --git a/gl/gl_journal.php b/gl/gl_journal.php index 035de8ac..063dd8ae 100644 --- a/gl/gl_journal.php +++ b/gl/gl_journal.php @@ -21,6 +21,7 @@ include_once($path_to_root . "/includes/data_checks.inc"); include_once($path_to_root . "/gl/includes/ui/gl_journal_ui.inc"); include_once($path_to_root . "/gl/includes/gl_db.inc"); include_once($path_to_root . "/gl/includes/gl_ui.inc"); +include_once($path_to_root . "/taxes/db/tax_types_db.inc"); $js = ''; if ($use_popup_windows) @@ -36,11 +37,13 @@ if (isset($_GET['ModifyGL'])) { $_SESSION['page_title'] = _($help_context = "Journal Entry"); 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 +61,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'])) { @@ -77,14 +82,17 @@ if (isset($_GET['AddedID'])) if (isset($_GET['NewJournal'])) { create_cart(0,0); -} +} elseif (isset($_GET['ModifyGL'])) { + check_is_editable($_GET['trans_type'], $_GET['trans_no']); + if (!isset($_GET['trans_type']) || $_GET['trans_type']!= 0) { display_error(_("You can edit directly only journal entries created via Journal Entry page.")); hyperlink_params("$path_to_root/gl/gl_journal.php", _("Entry &New Journal Entry"), "NewJournal=Yes"); display_footer_exit(); } + create_cart($_GET['trans_type'], $_GET['trans_no']); } @@ -108,7 +116,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 +165,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 +273,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 +299,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(); } @@ -321,7 +329,7 @@ start_form(); display_order_header($_SESSION['journal_items']); -start_table("$table_style2 width=90%", 10); +start_table(TABLESTYLE2, "width=90%", 10); start_row(); echo ""; display_gl_items(_("Rows"), $_SESSION['journal_items']);