- $n = 15; // 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--;
- if (!check_table($pref, 'tags')) $n--;
- return $n == 0 ? true : 15 - $n;
+ $n = 1; // number of patches to be installed
+ $patchcnt = 0;
+ if (!$this->beta) {
+ $n = 16;
+ if (check_table($pref, 'company', 'custom1_name')) $patchcnt++;
+ if (!check_table($pref, 'company', 'profit_loss_year_act')) $patchcnt++;
+ if (!check_table($pref, 'company', 'login_tout')) $patchcnt++;
+ if (!check_table($pref, 'stock_category', 'dflt_no_sale')) $patchcnt++;
+ if (!check_table($pref, 'users', 'sticky_doc_date')) $patchcnt++;
+ if (!check_table($pref, 'users', 'startup_tab')) $patchcnt++;
+ if (!check_table($pref, 'cust_branch', 'inactive')) $patchcnt++;
+ if (!check_table($pref, 'chart_class', 'ctype')) $patchcnt++;
+ if (!check_table($pref, 'audit_trail')) $patchcnt++;
+ if (!check_table($pref, 'currencies', 'auto_update')) $patchcnt++;
+ if (!check_table($pref, 'stock_master','no_sale')) $patchcnt++;
+ if (!check_table($pref, 'suppliers', 'supp_ref')) $patchcnt++;
+ if (!check_table($pref, 'users', 'role_id')) $patchcnt++;
+ if (!check_table($pref, 'sales_orders', 'reference')) $patchcnt++;
+ if (!check_table($pref, 'tags')) $patchcnt++;
+ }
+ if (!check_table($pref, 'useronline')) $patchcnt++;
+
+ $n -= $patchcnt;
+ return $n == 0 ? true : $patchcnt;