X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=purchasing%2Fsupplier_trans_gl.php;h=64dc49aa561d4d143c7dc83cf3f46dde155d61c2;hb=3e2a432dd72688dbac39a07716201b2b00c16c8b;hp=b2b827fee00d90de7efd34df97af26b89e4628c2;hpb=6183e9450dcd7e4c747889c10903f6ff1b0add33;p=fa-stable.git
diff --git a/purchasing/supplier_trans_gl.php b/purchasing/supplier_trans_gl.php
index b2b827fe..64dc49aa 100644
--- a/purchasing/supplier_trans_gl.php
+++ b/purchasing/supplier_trans_gl.php
@@ -21,27 +21,32 @@ if (!isset($_SESSION['supp_trans']))
}
//------------------------------------------------------------------------------------------------
-
function clear_fields()
{
+ global $Ajax;
+
unset($_POST['gl_code']);
unset($_POST['dimension_id']);
unset($_POST['dimension2_id']);
unset($_POST['amount']);
unset($_POST['memo_']);
- unset($_POST['AcctSelection']);
unset($_POST['AddGLCodeToTrans']);
+ $Ajax->activate('gl_ctrls');
+ set_focus('gl_code');
}
-
//------------------------------------------------------------------------------------------------
+// GL postings are often entered in the same form to two accounts
+// so fileds are cleared only on user demand.
+//
+if (isset($_POST['ClearFields']))
+{
+ clear_fields();
+}
if (isset($_POST['AddGLCodeToTrans'])){
+ $Ajax->activate('gl_items');
$input_error = false;
- if (!isset($_POST['gl_code']))
- {
- $_POST['gl_code'] = $_POST['AcctSelection'];
- }
$sql = "SELECT account_code, account_name FROM ".TB_PREF."chart_master WHERE account_code='" . $_POST['gl_code'] . "'";
$result = db_query($sql,"get account information");
@@ -68,24 +73,27 @@ if (isset($_POST['AddGLCodeToTrans'])){
$_SESSION['supp_trans']->add_gl_codes_to_trans($_POST['gl_code'], $gl_act_name,
$_POST['dimension_id'], $_POST['dimension2_id'],
input_num('amount'), $_POST['memo_']);
- clear_fields();
+ set_focus('gl_code');
}
}
//------------------------------------------------------------------------------------------------
-if (isset($_GET['Delete']))
+$id = find_submit('Delete');
+if ($id != -1)
{
- $_SESSION['supp_trans']->remove_gl_codes_from_trans($_GET['Delete']);
+ $_SESSION['supp_trans']->remove_gl_codes_from_trans($id);
clear_fields();
+ $Ajax->activate('gl_items');
}
//------------------------------------------------------------------------------------------------
display_heading($_SESSION['supp_trans']->supplier_name);
+start_form(false,true);
display_gl_items($_SESSION['supp_trans'], 1);
-
+end_form();
echo "
";
if ($_SESSION['supp_trans']->is_invoice == true)
@@ -106,11 +114,12 @@ start_form(false, true);
display_heading2(_("Enter a GL Line"));
+div_start('gl_ctrls');
start_table($table_style2);
$accs = get_supplier_accounts($_SESSION['supp_trans']->supplier_id);
-$_POST['AcctSelection'] = $accs['purchase_account'];
-gl_all_accounts_list_row(_("GL Account Selection:"), 'AcctSelection', $_POST['AcctSelection']);
+$_POST['gl_code'] = $accs['purchase_account'];
+gl_all_accounts_list_row(_("GL Account Selection:"), 'gl_code', null);
$dim = get_company_pref('use_dimension');
if ($dim >= 1)
dimensions_list_row(_("Dimension")." 1", 'dimension_id', null, true, " ", false, 1);
@@ -124,13 +133,15 @@ amount_row( _("Amount:"), 'amount');
textarea_row(_("Memo:"), "memo_", null, 40, 2);
-end_table();;
-
-submit_center('AddGLCodeToTrans', _("Add GL Line"));
-
+end_table();
+div_end();
+echo '
';
+submit_center_first('AddGLCodeToTrans', _("Add GL Line"), '', true);
+submit_center_last('ClearFields', _('Reset'), _("Clear all GL entry fields"), true);
end_form();
//------------------------------------------------------------------------------------------------
+echo '
';
+end_page(false, true);
-end_page();
?>