alt_table_row_color($k);
label_cell($myrow["cid"]);
- label_cell($myrow['class_name']);
+ label_cell('<a href="./gl_account_types.php?cid='.$myrow["cid"].'">'.$myrow['class_name'].'</a>');
if (isset($SysPrefs->use_oldstyle_convert) && $SysPrefs->use_oldstyle_convert == 1)
{
$myrow['ctype'] = ($myrow["ctype"] >= CL_ASSETS && $myrow["ctype"] < CL_INCOME ? 1 : 0);
include($path_to_root . "/includes/ui.inc");
+if (isset($_GET["cid"]))
+ $_POST["cid"] = $_GET["cid"];
+
simple_page_mode(false);
//-----------------------------------------------------------------------------------
unset($_POST['class_id']);
}
//-----------------------------------------------------------------------------------
-
-$result = get_account_types(check_value('show_inactive'));
+$filter_cid = (isset($_POST["cid"]));
+if ($filter_cid)
+ $result = get_account_types(check_value('show_inactive'), $_POST["cid"]);
+else
+ $result = get_account_types(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE);
}
label_cell($myrow["id"]);
- label_cell($myrow["name"]);
+ label_cell('<a href="./gl_accounts.php?id='.$myrow["id"].'">'.$myrow["name"].'</a>');
label_cell($parent_text);
label_cell($bs_text);
inactive_control_cell($myrow["id"], $myrow["inactive"], 'chart_types', 'id');
gl_account_types_list_row(_("Subgroup Of:"), 'parent', null, _("None"), true);
-class_list_row(_("Class:"), 'class_id', null);
+if ($filter_cid)
+ class_list_row(_("Class:"), 'class_id', $_POST['cid']);
+else
+ class_list_row(_("Class:"), 'class_id', null);
end_table(1);
check_db_has_gl_account_groups(_("There are no account groups defined. Please define at least one account group before entering accounts."));
+if (isset($_GET["id"]))
+ $_POST["id"] = $_GET["id"];
+
//-------------------------------------------------------------------------------------
if (isset($_POST['_AccountList_update']))
}
//-------------------------------------------------------------------------------------
+$filter_id = (isset($_POST["id"]));
start_form();
{
start_table(TABLESTYLE_NOBORDER);
start_row();
- gl_all_accounts_list_cells(null, 'AccountList', null, false, false,
- _('New account'), true, check_value('show_inactive'));
+ if ($filter_id)
+ gl_all_accounts_list_cells(null, 'AccountList', null, false, false, _('New account'), true, check_value('show_inactive'), $_POST['id']);
+ else
+ gl_all_accounts_list_cells(null, 'AccountList', null, false, false, _('New account'), true, check_value('show_inactive'));
check_cells(_("Show inactive:"), 'show_inactive', null, true);
end_row();
end_table();
$_POST['account_code'] = $_POST['account_code2'] = '';
$_POST['account_name'] = $_POST['account_type'] = '';
$_POST['inactive'] = 0;
+ if ($filter_id) $_POST['account_type'] = $_POST['id'];
}
text_row_ex(_("Account Code:"), 'account_code', 15);
}
//-----------------------------------------------------------------------------------------------
function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=false,
- $cells=false, $all_option=false, $submit_on_change=false, $all=false)
+ $cells=false, $all_option=false, $submit_on_change=false, $all=false, $type_id=false)
{
if ($skip_bank_accounts)
$sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive, type.id
$sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive, type.id
FROM ".TB_PREF."chart_master chart,".TB_PREF."chart_types type
WHERE chart.account_type=type.id";
+ if ($type_id ) $sql .= " AND chart.account_type=".db_escape($type_id);
return combo_input($name, $selected_id, $sql, 'chart.account_code', 'chart.account_name',
array(
function gl_all_accounts_list_cells($label, $name, $selected_id=null,
$skip_bank_accounts=false, $cells=false, $all_option=false,
- $submit_on_change=false, $all=false)
+ $submit_on_change=false, $all=false, $type_id=false)
{
if ($label != null)
echo "<td>$label</td>\n";
echo "<td>";
echo gl_all_accounts_list($name, $selected_id,
- $skip_bank_accounts, $cells, $all_option, $submit_on_change, $all);
+ $skip_bank_accounts, $cells, $all_option, $submit_on_change, $all, $type_id);
echo "</td>\n";
}
function gl_all_accounts_list_row($label, $name, $selected_id=null,
- $skip_bank_accounts=false, $cells=false, $all_option=false)
+ $skip_bank_accounts=false, $cells=false, $all_option=false, $type_id=false)
{
echo "<tr><td class='label'>$label</td>";
gl_all_accounts_list_cells(null, $name, $selected_id,
- $skip_bank_accounts, $cells, $all_option);
+ $skip_bank_accounts, $cells, $all_option, $type_id);
echo "</tr>\n";
}