X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.1.php;h=9d932c9fdb39a44ba0332746c17e3a2c22819995;hb=d61fc6be5aaa0b100f3059a6f85b1ed602dfb2e3;hp=371c3d6a33ec12a3ec562df3a37b6b6459c12c2a;hpb=a5242af68e65661edb7175412444dce536a7f311;p=fa-stable.git diff --git a/sql/alter2.1.php b/sql/alter2.1.php index 371c3d6a..9d932c9f 100644 --- a/sql/alter2.1.php +++ b/sql/alter2.1.php @@ -11,7 +11,7 @@ ***********************************************************************/ class fa2_1 { var $version = '2.1'; // version installed - var $description = 'Version 2.1'; + var $description = _('Upgrade from version 2.0 to 2.1'); var $sql = 'alter2.1.sql'; // // Install procedure. All additional changes @@ -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; } };