X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.1.php;h=2d5be22d86e656f551f81ee5a19e91263e0cb525;hb=c31829537f02787dd94654820dd74168c054b8c4;hp=ddfb6fe2a6506fd5414779c37c4db929e00261c8;hpb=871bc1f187ad6e5622a80c7dd8aadc48d8ea70fd;p=fa-stable.git diff --git a/sql/alter2.1.php b/sql/alter2.1.php index ddfb6fe2..2d5be22d 100644 --- a/sql/alter2.1.php +++ b/sql/alter2.1.php @@ -1,13 +1,13 @@ . + See the License here . ***********************************************************************/ class fa2_1 { var $version = '2.1'; // version installed @@ -146,13 +146,14 @@ class fa2_1 { // Test if patch was applied before. // function installed($pref) { - if (check_table($pref, 'item_codes')) return false; - if (check_table($pref, 'company', 'foreign_codes')) return false; - if (check_table($pref, 'suppliers', 'credit_limit')) return false; - if (check_table($pref, 'bank_trans', 'reconciled', - array('Type'=>'date'))) return false; - if (check_table($pref, 'trans_tax_details')) return false; - return true; + $n = 5; // number of features to be installed + if (!check_table($pref, 'item_codes')) $n--; + if (!check_table($pref, 'company', 'foreign_codes')) $n--; + if (!check_table($pref, 'suppliers', 'credit_limit')) $n--; + if (!check_table($pref, 'bank_trans', 'reconciled', + array('Type'=>'date'))) $n--; + if (!check_table($pref, 'trans_tax_details')) $n--; + return $n == 0 ? true : 5 - $n; } };