X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.5.php;fp=sql%2Falter2.5.php;h=1d511e14e862e362bb94cbaf64c51a190735411e;hb=8eb8e44cb90ab144f0849d1ecd2153175b619786;hp=f79dde51f9b6f41a01b3b60d5de67c506d6696f1;hpb=5866801d02b8007f74ea5bfd15a8ecac7c1c58c1;p=fa-stable.git diff --git a/sql/alter2.5.php b/sql/alter2.5.php index f79dde51..1d511e14 100644 --- a/sql/alter2.5.php +++ b/sql/alter2.5.php @@ -22,18 +22,51 @@ class fa2_5 extends fa_patch { $this->description = _('Upgrade from version 2.4 to 2.5'); } - // - // Install procedure. All additional changes - // not included in sql file should go here. - // + /* + Shows parameters to be selected before upgrade (if any) + */ + function show_params($company) + { + + display_note(_('Check upgrade parameters below and start upgrade.')); + start_table(TABLESTYLE); + table_section(1); + table_section_title(_("Shipments category default settings")); + text_row(_("Category Name:"), 'shipping_cat_description', _('Shippment'), 30, 30); + item_tax_types_list_row(_('Item Tax Type:'), 'shipping_tax_type'); + stock_units_list_row(_('Unit of measure:'), 'shipping_units'); + gl_all_accounts_list_row(_("Sales Account:"), 'shipping_sales_act', get_company_pref('freight_act')); + gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'shipping_cogs_act', get_company_pref('default_cogs_act')); + end_table(); + br(); + + } + + /* + Fetch & check upgrade parameters, check additional upgrade pre-conditions, set SQL variables. + This function is run after successfull switching to target database connection, before sql upgrade script is run. + */ + function prepare() + { + // set upgrade script parameters + foreach( array('shipping_cat_description', 'shipping_tax_type', 'shipping_units', 'shipping_sales_act', 'shipping_cogs_act') as $name) + db_query("SET @$name=".db_escape(get_post($name))); + return true; + } + + + /* + Install procedure. All additional changes + not included in sql file should go here. + */ function install($company, $force=false) { return true; } - // - // optional procedure done after upgrade fail, before backup is restored - // + /* + Optional procedure done after upgrade fail, before backup is restored + */ function post_fail($company) { }