- if (check_table($pref, 'company', 'login_tout')) return false;
- if (check_table($pref, 'stock_category', 'dflt_dim2')) return false;
- if (check_table($pref, 'users', 'sticky_doc_date')) return false;
- if (check_table($pref, 'audit_trail')) return false;
- if (check_table($pref, 'stock_master','no_sale')) return false;
- if (check_table($pref, 'users', 'role_id')) return false;
- return true;
+ $n = 14; // number of features to be installed
+ if (check_table($pref, 'company', 'custom1_name')) $n--;
+ if (!check_table($pref, 'company', 'profit_loss_year_act')) $n--;
+ if (!check_table($pref, 'company', 'login_tout')) $n--;
+ if (!check_table($pref, 'stock_category', 'dflt_no_sale')) $n--;
+ if (!check_table($pref, 'users', 'sticky_doc_date')) $n--;
+ if (!check_table($pref, 'users', 'startup_tab')) $n--;
+ if (!check_table($pref, 'cust_branch', 'inactive')) $n--;
+ if (!check_table($pref, 'chart_class', 'ctype')) $n--;
+ if (!check_table($pref, 'audit_trail')) $n--;
+ if (!check_table($pref, 'currencies', 'auto_update')) $n--;
+ if (!check_table($pref, 'stock_master','no_sale')) $n--;
+ if (!check_table($pref, 'suppliers', 'supp_ref')) $n--;
+ if (!check_table($pref, 'users', 'role_id')) $n--;
+ if (!check_table($pref, 'sales_orders', 'reference')) $n--;
+ return $n == 0 ? true : 14 - $n;