Additional fixes to app options reorganization.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 28 Dec 2014 22:12:20 +0000 (23:12 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 28 Dec 2014 22:12:20 +0000 (23:12 +0100)
admin/display_prefs.php
sales/sales_order_entry.php
sql/alter2.4.php
sql/alter2.4.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 85406a8c3b7aeaee4c4fcfc62714f49de21444d6..9b60dc55949b2fd56575bc12e42655058c8e006d 100644 (file)
@@ -76,9 +76,9 @@ number_list_row(_("Quantities:"), 'qty_dec', user_qty_dec(), 0, 10);
 number_list_row(_("Exchange Rates:"), 'rates_dec', user_exrate_dec(), 0, 10);
 number_list_row(_("Percentages:"), 'percent_dec', user_percent_dec(), 0, 10);
 
-table_section_title(_("Dateformat and Separators"));
+table_section_title(_("Date Format and Separators"));
 
-dateformats_list_row(_("Dateformat:"), "date_format", user_date_format());
+dateformats_list_row(_("Date Format:"), "date_format", user_date_format());
 
 dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep());
 
index add2b7094175387a9fc74fca106b46940910bf32..30fdc0d4858991fd128c5135ab673e717e80c09c 100644 (file)
@@ -514,7 +514,7 @@ function check_item_data()
                display_error( _("The item could not be updated because you are attempting to set the quantity ordered to less than 0, or the discount percent to more than 100."));
                set_focus('qty');
                return false;
-       } elseif (!check_num('price', 0) && (!SysPrefs->$allow_negative_prices() || $is_inventory_item)) {
+       } elseif (!check_num('price', 0) && (!$SysPrefs->allow_negative_prices() || $is_inventory_item)) {
                display_error( _("Price for inventory item must be entered and can not be less than 0"));
                set_focus('price');
                return false;
index 0a2584d346a77ebd6f7dc3294959224d081e7f53..481ea817756507284cb1c66328abc1402b61b21f 100644 (file)
@@ -32,54 +32,20 @@ class fa2_4 {
                if (get_company_pref('grn_clearing_act') === null) { // available form 2.3.1, can be not defined on pre-2.4 installations
                        set_company_pref('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, 0);
                }
-               if (get_company_pref('default_receival_required') === null) { // new in 2.4 installations
-                       set_company_pref('default_receival_required', 'glsetup.purchase', 'smallint', 6, 10);
-               }
                if (get_company_pref('default_quote_valid_days') === null) { // new in 2.3.23 installations
                        set_company_pref('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, 30);
                }
-               if (get_company_pref('no_zero_lines_amount') === null) { // new in 2.4 installations
-                       set_company_pref('no_zero_lines_amount', 'glsetup.sales', 'tinyint', 1, '1');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('show_po_item_codes') === null) { // new in 2.4 installations
-                       set_company_pref('show_po_item_codes', 'glsetup.purchase', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('accounts_alpha') === null) { // new in 2.4 installations
-                       set_company_pref('accounts_alpha', 'glsetup.general', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('loc_notification') === null) { // new in 2.4 installations
-                       set_company_pref('loc_notification', 'glsetup.inventory', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('print_invoice_no') === null) { // new in 2.4 installations
-                       set_company_pref('print_invoice_no', 'glsetup.sales', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('allow_negative_prices') === null) { // new in 2.4 installations
-                       set_company_pref('allow_negative_prices', 'glsetup.inventory', 'tinyint', 1, '1');
-                       refresh_sys_prefs();
-               }
-               if (get_company_pref('print_item_images_on_quote') === null) { // new in 2.4 installations
-                       set_company_pref('print_item_images_on_quote', 'glsetup.inventory', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
-               }
                if (get_company_pref('bcc_email') === null) { // available from 2.3.14, can be not defined on pre-2.4 installations
                        set_company_pref('bcc_email', 'setup.company', 'varchar', 100, '');
-                       refresh_sys_prefs();
                }
                if (get_company_pref('alternative_tax_include_on_docs') === null) { // available from 2.3.14, can be not defined on pre-2.4 installations
                        set_company_pref('alternative_tax_include_on_docs', 'setup.company', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
                }
                if (get_company_pref('suppress_tax_rates') === null) { // available from 2.3.14, can be not defined on pre-2.4 installations
                        set_company_pref('suppress_tax_rates', 'setup.company', 'tinyint', 1, '0');
-                       refresh_sys_prefs();
                }
 
-$result = $this->update_workorders()  && $this->update_grn_rates() && $this->switch_database_to_utf($pref);
+               $result = $this->update_workorders()  && $this->update_grn_rates() && $this->switch_database_to_utf($pref);
 
                if ($result)
                        $result = $this->do_cleanup();
index dd300d2cd5c474d9aa043122811dc4e4da0239e5..e8c2d3d02909bcc52a6a6f56cb26614b5d7af75e 100644 (file)
@@ -88,3 +88,12 @@ ALTER TABLE `0_users` ADD `save_report_selections` SMALLINT( 6 ) NOT NULL defaul
 ALTER TABLE `0_users` ADD `use_date_picker` TINYINT(1) NOT NULL default '1' COMMENT 'Use Date Picker for all Date Values' AFTER `save_report_selections`;
 ALTER TABLE `0_users` ADD `def_print_destination` TINYINT(1) NOT NULL default '0' COMMENT 'Default Report Destination' AFTER `use_date_picker`;
 ALTER TABLE `0_users` ADD `def_print_orientation` TINYINT(1) NOT NULL default '0' COMMENT 'Default Report Orientation' AFTER `def_print_destination`;
+
+INSERT INTO `0_sys_prefs` VALUES('no_zero_lines_amount', 'glsetup.sales', 'tinyint', 1, '1');
+INSERT INTO `0_sys_prefs` VALUES('show_po_item_codes', 'glsetup.purchase', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('accounts_alpha', 'glsetup.general', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('loc_notification', 'glsetup.inventory', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('print_invoice_no', 'glsetup.sales', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('allow_negative_prices', 'glsetup.inventory', 'tinyint', 1, '1');
+INSERT INTO `0_sys_prefs` VALUES('print_item_images_on_quote', 'glsetup.inventory', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
index fcef56ab510178b332bfb213359ec7f6cea9c829..f067dbe54c9b69cebdc368cf93bd1255fe57a540 100644 (file)
@@ -2341,10 +2341,10 @@ CREATE TABLE IF NOT EXISTS `0_users` (
   `sticky_doc_date` tinyint(1) default '0',
   `startup_tab` varchar(20) NOT NULL default '',
   `transaction_days` smallint(6) NOT NULL default '30',
-  'save_report_selections' smallint(6) NOT NULL default '0',
-  'use_date_picker' tinyint(1) NOT NULL default '1',
-  'def_print_destination' tinyint(1) NOT NULL default '0',
-  'def_print_orientation' tinyint(1) NOT NULL default '0',
+  `save_report_selections` smallint(6) NOT NULL default '0',
+  `use_date_picker` tinyint(1) NOT NULL default '1',
+  `def_print_destination` tinyint(1) NOT NULL default '0',
+  `def_print_orientation` tinyint(1) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `user_id` (`user_id`)
index d46b8906441ea849e0be04fe896d4f5ae105ea4f..a83dbc2674a8cef4a053e180849689ecb55a7935 100644 (file)
@@ -2090,10 +2090,10 @@ CREATE TABLE IF NOT EXISTS `0_users` (
   `sticky_doc_date` tinyint(1) default '0',
   `startup_tab` varchar(20) NOT NULL default '',
   `transaction_days` smallint(6) NOT NULL default '30',
-  'save_report_selections' smallint(6) NOT NULL default '0',
-  'use_date_picker' tinyint(1) NOT NULL default '1',
-  'def_print_destination' tinyint(1) NOT NULL default '0',
-  'def_print_orientation' tinyint(1) NOT NULL default '0',
+  `save_report_selections` smallint(6) NOT NULL default '0',
+  `use_date_picker` tinyint(1) NOT NULL default '1',
+  `def_print_destination` tinyint(1) NOT NULL default '0',
+  `def_print_orientation` tinyint(1) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `user_id` (`user_id`)