// displays value of inactive field as checkbox cell.
// Also updates database record after status change.
//
-function inactive_status_cell($id, $value, $table, $key)
+function inactive_control_cell($id, $value, $table, $key)
{
global $Ajax;
//
// Displays controls for optional display of inactive records
//
-function show_inactive_row($th) {
+function inactive_control_row($th) {
echo "<tr><td colspan=".(count($th)).">"
."<div style='float:left;'>"
. checkbox(null, 'show_inactive', null, true). _("Show also Inactive")
. submit('Update', _('Update'), false, '', null)
."</div></td></tr>";
}
-
+//
+// Inserts additional column header when display of inactive records is on.
+//
+function inactive_control_column(&$th) {
+ global $Ajax;
+
+ if (check_value('show_inactive'))
+ array_insert($th, count($th)-2 , _("Inactive"));
+ if (get_post('_show_inactive_update')) {
+ $Ajax->activate('_page_body');
+ }
+}
?>
\ No newline at end of file
{
global $all_items;
- $sql = "SELECT stock_id, s.description, c.description, inactive
+ $sql = "SELECT stock_id, s.description, c.description, s.inactive
FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c WHERE s.category_id=c.category_id";
return combo_input($name, $selected_id, $sql, 'stock_id', 's.description',
global $all_items;
// all sales codes
$sql = "SELECT i.item_code, i.description, c.description, count(*)>1 as kit,
- inactive
+ i.inactive
FROM
".TB_PREF."item_codes i
LEFT JOIN
{
global $all_items;
- $sql = "SELECT stock_id, s.description, c.description, inactive
+ $sql = "SELECT stock_id, s.description, c.description, s.inactive
FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c WHERE
s.category_id=c.category_id";
$cells=false, $all_option=false, $submit_on_change=false)
{
if ($skip_bank_accounts)
- $sql = "SELECT chart.account_code, chart.account_name, type.name, inactive
+ $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive
FROM (".TB_PREF."chart_master chart,".TB_PREF."chart_types type) "
."LEFT JOIN ".TB_PREF."bank_accounts acc "
."ON chart.account_code=acc.account_code
WHERE acc.account_code IS NULL
AND chart.account_type=type.id";
else
- $sql = "SELECT chart.account_code, chart.account_name, type.name, inactive
+ $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive
FROM ".TB_PREF."chart_master chart,".TB_PREF."chart_types type
WHERE chart.account_type=type.id";