Added fixed asset related db changes in upgrade class.
[fa-stable.git] / sql / alter2.4rc1.php
diff --git a/sql/alter2.4rc1.php b/sql/alter2.4rc1.php
new file mode 100644 (file)
index 0000000..75ed0d0
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+
+class fa2_4rc1 extends fa_patch {
+       var $previous = '2.4.0';                // applicable database version
+       var $version = '2.4.1'; // version installed
+       var $description;
+       var $sql = ''; // 'alter2.4rc1.sql';
+       var $preconf = true;
+
+       function fa2_4rc1() {
+               parent::fa_patch();
+               $this->description = _('Upgrade from version 2.4beta to 2.4rc1');
+       }
+
+       //
+       //      Install procedure. All additional changes 
+       //      not included in sql file should go here.
+       //
+       function install($company, $force=false)
+       {
+               // key 
+               $sec_updates = array(
+                       'SA_SETUPCOMPANY' => array(
+                               'SA_ASSET', 'SA_ASSETCATEGORY', 'SA_ASSETCLASS',
+                               'SA_ASSETSTRANSVIEW','SA_ASSETTRANSFER', 'SA_ASSETDISPOSAL',
+                               'SA_DEPRECIATION', 'SA_ASSETSANALYTIC'),
+               );
+               $result = $this->update_security_roles($sec_updates);
+               return $result;
+       }
+
+       //
+       // optional procedure done after upgrade fail, before backup is restored
+       //
+       function post_fail($company)
+       {
+               $pref = $this->companies[$company]['tbpref'];
+               db_query("DROP TABLE IF EXISTS " . $pref . 'stock_fa_class');
+       }
+
+}
+
+$install = new fa2_4rc1;