Removed many global variables from config.default.php to GL Setup, Company Setup...
authorJoe <unknown>
Sun, 28 Dec 2014 15:17:10 +0000 (16:17 +0100)
committerJoe <unknown>
Sun, 28 Dec 2014 15:17:10 +0000 (16:17 +0100)
84 files changed:
admin/company_preferences.php
admin/display_prefs.php
admin/fiscalyears.php
admin/gl_setup.php
admin/void_transaction.php
config.default.php
dimensions/dimension_entry.php
dimensions/inquiry/search_dimensions.php
dimensions/view/view_dimension.php
gl/accruals.php
gl/bank_account_reconcile.php
gl/bank_transfer.php
gl/gl_bank.php
gl/gl_journal.php
gl/inquiry/balance_sheet.php
gl/inquiry/bank_inquiry.php
gl/inquiry/gl_account_inquiry.php
gl/inquiry/gl_trial_balance.php
gl/inquiry/journal_inquiry.php
gl/inquiry/profit_loss.php
gl/inquiry/tax_inquiry.php
gl/manage/close_period.php
gl/manage/exchange_rates.php
gl/manage/gl_accounts.php
gl/manage/revaluate_currencies.php
includes/current_user.inc
includes/prefs/sysprefs.inc
includes/prefs/userprefs.inc
includes/ui/db_pager_view.inc
includes/ui/ui_input.inc
includes/ui/ui_lists.inc
includes/ui/ui_view.inc
inventory/adjustments.php
inventory/includes/db/items_adjust_db.inc
inventory/includes/db/items_transfer_db.inc
inventory/inquiry/stock_movements.php
inventory/manage/items.php
inventory/transfers.php
manufacturing/work_order_add_finished.php
manufacturing/work_order_costs.php
manufacturing/work_order_entry.php
manufacturing/work_order_issue.php
manufacturing/work_order_release.php
purchasing/inquiry/po_search.php
purchasing/inquiry/po_search_completed.php
purchasing/inquiry/supplier_allocation_inquiry.php
purchasing/inquiry/supplier_inquiry.php
purchasing/manage/suppliers.php
purchasing/po_entry_items.php
purchasing/po_receive_items.php
purchasing/supplier_credit.php
purchasing/supplier_invoice.php
purchasing/supplier_payment.php
reporting/includes/doctext.inc
reporting/includes/pdf_report.inc
reporting/includes/reporting.inc
reporting/includes/reports_classes.inc
reporting/prn_redirect.php
reporting/rep107.php
reporting/rep109.php
reporting/rep110.php
reporting/rep111.php
reporting/rep113.php
reporting/rep209.php
reporting/reports_main.php
sales/create_recurrent_invoices.php
sales/credit_note_entry.php
sales/customer_credit_invoice.php
sales/customer_delivery.php
sales/customer_invoice.php
sales/customer_payments.php
sales/includes/db/sales_order_db.inc
sales/inquiry/customer_allocation_inquiry.php
sales/inquiry/customer_inquiry.php
sales/inquiry/sales_deliveries_view.php
sales/inquiry/sales_orders_view.php
sales/manage/customers.php
sales/manage/recurrent_invoices.php
sales/sales_order_entry.php
sql/alter2.4.php
sql/alter2.4.sql
sql/en_US-demo.sql
sql/en_US-new.sql
taxes/db/tax_groups_db.inc

index c747669b3e63848d8a00142a6f22a15ab76b2212..cb8d1014f96935ea67c20a9aa5b1d3804b2eb40a 100644 (file)
@@ -23,9 +23,7 @@ include_once($path_to_root . "/admin/db/company_db.inc");
 
 if (isset($_POST['update']) && $_POST['update'] != "")
 {
-
        $input_error = 0;
-
        if (!check_num('login_tout', 10))
        {
                display_error(_("Login timeout must be positive number not less than 10."));
@@ -109,7 +107,7 @@ if (isset($_POST['update']) && $_POST['update'] != "")
                                'no_item_list' => 0, 'no_customer_list' => 0, 
                                'no_supplier_list' =>0, 'base_sales', 
                                'time_zone' => 0, 'add_pct', 'round_to', 'login_tout', 'auto_curr_reval',
-                               'bcc_email'))
+                               'bcc_email', 'alternative_tax_include_on_docs', 'suppress_tax_rates'))
                );
 
                $_SESSION['wa_current_user']->timeout = $_POST['login_tout'];
@@ -124,8 +122,17 @@ if (get_company_pref('bcc_email') === null) { // available from 2.3.14, can be n
        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();
+}
 
 start_form(true);
+
 $myrow = get_company_prefs();
 
 $_POST['coy_name'] = $myrow["coy_name"];
@@ -156,6 +163,8 @@ $_POST['round_to'] = $myrow['round_to'];
 $_POST['auto_curr_reval'] = $myrow['auto_curr_reval']; 
 $_POST['del_coy_logo']  = 0;
 $_POST['bcc_email']  = $myrow["bcc_email"];
+$_POST['alternative_tax_include_on_docs']  = $myrow["alternative_tax_include_on_docs"];
+$_POST['suppress_tax_rates']  = $myrow["suppress_tax_rates"];
 
 start_outer_table(TABLESTYLE2);
 
@@ -174,10 +183,11 @@ email_row_ex(_("BCC Address for all outgoing mails:"), 'bcc_email', 50, 55);
 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
 text_row_ex(_("GSTNo:"), 'gst_no', 25);
 
-currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
 fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
 text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, '', null, null, _('Months.'));
 text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, '', null, null, _('Months back.'));
+check_row(_("Put alternative Tax Include on Docs"), 'alternative_tax_include_on_docs', null);
+check_row(_("Suppress Tax Rates on Docs"), 'suppress_tax_rates', null);
 
 table_section(2);
 
@@ -197,6 +207,7 @@ check_row(_("Search Item List"), 'no_item_list', null);
 check_row(_("Search Customer List"), 'no_customer_list', null);
 check_row(_("Search Supplier List"), 'no_supplier_list', null);
 label_row("", "&nbsp;");
+currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
 check_row(_("Automatic Revaluation Currency Accounts"), 'auto_curr_reval', $_POST['auto_curr_reval']);
 check_row(_("Time Zone on Reports"), 'time_zone', $_POST['time_zone']);
 text_row_ex(_("Login Timeout:"), 'login_tout', 10, 10, '', null, null, _('seconds'));
index e4a69f75c456d51b57680523c7bad9b6199d128e..85406a8c3b7aeaee4c4fcfc62714f49de21444d6 100644 (file)
@@ -42,7 +42,8 @@ if (isset($_POST['setprefs']))
                        'theme', 'page_size', 'language', 'startup_tab',
                        'show_gl' => 0, 'show_codes'=> 0, 'show_hints' => 0,
                        'rep_popup' => 0, 'graphic_links' => 0, 'sticky_doc_date' => 0,
-                       'query_size' => 10.0, 'transaction_days' => 30)));
+                       'query_size' => 10.0, 'transaction_days' => 30, 'save_report_selections' => 0,
+                       'use_date_picker' => 0, 'def_print_destination' => 0, 'def_print_orientation' => 0)));
 
                if ($chg_lang)
                        $_SESSION['language']->set_language($_POST['language']);
@@ -93,14 +94,24 @@ decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep());
 
 /* The array $decseps is set up in config.php for modifications
 possible separators can be added by modifying the array definition by editing that file */
+
+check_row(_("Use Date Picker"), 'use_date_picker', user_use_date_picker());
+
 if (!isset($_POST['language']))
        $_POST['language'] = $_SESSION['language']->code;
 
-table_section_title(_("Language"));
+table_section_title(_("Reports"));
 
-languages_list_row(_("Language:"), 'language', $_POST['language']);
+text_row_ex(_("Save Report Selection Days:"), 'save_report_selections', 5, 5, '', user_save_report_selections());
+
+yesno_list_row(_("Default Report Destination:"), 'def_print_destination', user_def_print_destination(), 
+       $name_yes=_("Excel"), $name_no=_("PDF/Printer"));
+
+yesno_list_row(_("Default Report Orientation:"), 'def_print_orientation', user_def_print_orientation(), 
+       $name_yes=_("Landscape"), $name_no=_("Portrait"));
 
 table_section(2);
+
 table_section_title(_("Miscellaneous"));
 
 check_row(_("Show hints for new users:"), 'show_hints', user_hints());
@@ -133,13 +144,17 @@ check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup
 check_row(_("Use icons instead of text links:"), 'graphic_links', user_graphic_links(),
        false, _('Set this option to on for using icons instead of text links'));
 
-text_row_ex(_("Query page size:"), 'query_size',  5, 5, '', user_query_size());
-
 check_row(_("Remember last document date:"), 'sticky_doc_date', sticky_doc_date(),
        false, _('If set document date is remembered on subsequent documents, otherwise default is current date'));
 
+text_row_ex(_("Query page size:"), 'query_size',  5, 5, '', user_query_size());
+
 text_row_ex(_("Transaction days:"), 'transaction_days', 5, 5, '', user_transaction_days());
 
+table_section_title(_("Language"));
+
+languages_list_row(_("Language:"), 'language', $_POST['language']);
+
 end_outer_table(1);
 
 submit_center('setprefs', _("Update"), true, '',  'default');
index 5db546b1aef3f09245dcd7efaf97d7b098a8495e..6cd4ae3787fff3d774e3eb5ec948df8013c81974 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc");
 include_once($path_to_root . "/admin/db/maintenance_db.inc");
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Fiscal Years"), false, false, "", $js);
 
index a160f4488b100ecdc523afacd929db251323dfee..9367d65d94d590aecd83d66ef5e5098770cd2904 100644 (file)
@@ -47,7 +47,10 @@ function can_process()
        }
 
        $grn_act = get_company_pref('grn_clearing_act');
-       if ((get_post('grn_clearing_act') != $grn_act) && db_num_rows(get_grn_items(0, '', true)))
+       $post_grn_act = get_post('grn_clearing_act');
+       if ($post_grn_act == null)
+               $post_grn_act = 0;
+       if (($post_grn_act != $grn_act) && db_num_rows(get_grn_items(0, '', true)))
        {
                display_error(_("Before GRN Clearing Account can be changed all GRNs have to be invoiced"));
                $_POST['grn_clearing_act'] = $grn_act;
@@ -73,6 +76,8 @@ if (isset($_POST['submit']) && can_process())
                'default_adj_act', 'default_inv_sales_act', 'default_assembly_act', 'legal_text',
                'past_due_days', 'default_workorder_required', 'default_dim_required', 'default_receival_required',
                'default_delivery_required', 'default_quote_valid_days', 'grn_clearing_act', 'tax_algorithm',
+               'no_zero_lines_amount', 'show_po_item_codes', 'accounts_alpha', 'loc_notification', 'print_invoice_no',
+               'allow_negative_prices', 'print_item_images_on_quote', 
                'allow_negative_stock'=> 0, 'accumulate_shipping'=> 0,
                'po_over_receive' => 0.0, 'po_over_charge' => 0.0, 'default_credit_limit'=>0.0
 )));
@@ -103,6 +108,41 @@ if (get_company_pref('default_quote_valid_days') === null) { // available from 2
        refresh_sys_prefs();
 }
 
+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();
+}
+
 $myrow = get_company_prefs();
 
 $_POST['retained_earnings_act']  = $myrow["retained_earnings_act"];
@@ -143,6 +183,13 @@ $_POST['default_dim_required'] = $myrow['default_dim_required'];
 $_POST['default_delivery_required'] = $myrow['default_delivery_required'];
 $_POST['default_receival_required'] = $myrow['default_receival_required'];
 $_POST['default_quote_valid_days'] = $myrow['default_quote_valid_days'];
+$_POST['no_zero_lines_amount'] = $myrow['no_zero_lines_amount'];
+$_POST['show_po_item_codes'] = $myrow['show_po_item_codes'];
+$_POST['accounts_alpha'] = $myrow['accounts_alpha'];
+$_POST['loc_notification'] = $myrow['loc_notification'];
+$_POST['print_invoice_no'] = $myrow['print_invoice_no'];
+$_POST['allow_negative_prices'] = $myrow['allow_negative_prices'];
+$_POST['print_item_images_on_quote'] = $myrow['print_item_images_on_quote'];
 
 //---------------
 
@@ -151,6 +198,8 @@ table_section_title(_("General GL"));
 
 text_row(_("Past Due Days Interval:"), 'past_due_days', $_POST['past_due_days'], 6, 6, '', "", _("days"));
 
+accounts_type_list_row(_("Accounts Type:"), 'accounts_alpha', $_POST['accounts_alpha']); 
+
 gl_all_accounts_list_row(_("Retained Earnings:"), 'retained_earnings_act', $_POST['retained_earnings_act']);
 
 gl_all_accounts_list_row(_("Profit/Loss Year:"), 'profit_loss_year_act', $_POST['profit_loss_year_act']);
@@ -167,8 +216,12 @@ table_section_title(_("Customers and Sales"));
 
 text_row(_("Default Credit Limit:"), 'default_credit_limit', $_POST['default_credit_limit'], 12, 12);
 
+yesno_list_row(_("Invoice Identification:"), 'print_invoice_no', $_POST['print_invoice_no'], $name_yes=_("Number"), $name_no=_("Reference"));
+
 check_row(_("Accumulate batch shipping:"), 'accumulate_shipping', null);
 
+check_row(_("Print Item Image on Quote:"), 'print_item_images_on_quote', null);
+
 textarea_row(_("Legal Text on Invoice:"), 'legal_text', $_POST['legal_text'], 32, 4);
 
 gl_all_accounts_list_row(_("Shipping Charged Account:"), 'freight_act', $_POST['freight_act']);
@@ -219,11 +272,19 @@ gl_all_accounts_list_row(_("GRN Clearing Account:"), 'grn_clearing_act', get_pos
 
 text_row(_("Receival Required By:"), 'default_receival_required', $_POST['default_receival_required'], 6, 6, '', "", _("days"));
 
+check_row(_("Show PO item codes:"), 'show_po_item_codes', null);
+
 table_section_title(_("Inventory"));
 
 check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null);
 label_row(null, _("Warning:  This may cause a delay in GL postings"), "", "class='stockmankofg' colspan=2"); 
 
+check_row(_("No zero-amounts (Service):"), 'no_zero_lines_amount', null);
+
+check_row(_("Location Notifications:"), 'loc_notification', null);
+
+check_row(_("Allow Negative Prices:"), 'allow_negative_prices', null);
+
 table_section_title(_("Items Defaults"));
 gl_all_accounts_list_row(_("Sales Account:"), 'default_inv_sales_act', $_POST['default_inv_sales_act']);
 
@@ -241,7 +302,6 @@ table_section_title(_("Manufacturing Defaults"));
 
 text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
 
-
 //----------------
 
 end_outer_table(1);
index 474217a0c32a942cccea23ed0225b8d865884327..7e3019ab5000902a81bbeb0e0e1a46e0f4d846a3 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/admin/db/transactions_db.inc");
 
 include_once($path_to_root . "/admin/db/voiding_db.inc");
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
index 2588a81e30e348063c466966579c36f3553ab922..1275e2fb67bbe184d75dd6213d0353077523f421 100644 (file)
@@ -71,24 +71,15 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        /* No check on edit conflicts. Maybe needed to be set to 1 in certains Windows Servers */
        $no_check_edit_conflicts = 0;
        
-       /* Do not print zero lines amount of 0.00 in Sales Documents if service item. 1 = do not */
-       $no_zero_lines_amount = 1;
-
        /* Use icon for editkey (=true) right of combobox. 1 = use, 0 = do not use */
        $use_icon_for_editkey = 0;
 
        /* Creates automatic a default branch with contact. Value 0 do not create auto branch */
        $auto_create_branch = 1;
 
-       /* Save Report selections (a value > 0 means days to save. 0 = no save) */
-       $save_report_selections = 0;
-
        /* use popup windows for views */
        $use_popup_windows = 1;
 
-       /* use date picker for all date fields */
-       $use_date_picker = 1;
-
        /* use Audit Trails in GL */
        /* This variable is deprecated. Setting this to 1, will stamp the user name in the memo fields in GL */
        /* This has been superseded with built in Audit Trail */
@@ -103,15 +94,6 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        /* show users online discretely in the footer */
        $show_users_online = 0;
 
-       /* show item codes on purchase order */
-       $show_po_item_codes = 0;
-
-       /* default print destination. 0 = PDF/Printer, 1 = Excel */
-       $def_print_destination = 0;
-
-       /* default print orientation. 0 = Portrait, 1 = Landscape */
-       $def_print_orientation = 0;
-
        // Wiki context help configuration
        // If your help wiki use translated page titles uncomment next line
        // $old_style_help = 1; // this setting is depreciated and subject to removal in next FA versions
@@ -126,26 +108,10 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        /* per user data/cache directory */
        $comp_path = $path_to_root.'/company';
 
-       /* allow alpha characters in accounts. 0 = numeric, 1 = alpha numeric, 2 = uppercase alpha numeric */
-       $accounts_alpha = 0;
-
        /* Date systems. 0 = traditional, 1 = Jalali used by Iran, nabour countries, Afghanistan and some other Central Asian nations,
        2 = Islamic used by other arabic nations. 3 = traditional, but where non-workday is Friday and start of week is Saturday */
        $date_system = 0;
 
-       /* email stock location if order below reorder-level */
-       /* Remember to set an email on the Location(s). */
-       $loc_notification = 0;
-
-       /* print_invoice_no. 0 = print reference number, 1 = print invoice number */
-       $print_invoice_no = 0;
-
-       /* 1 = print Subtotal tax excluded, tax and Total tax included */
-       $alternative_tax_include_on_docs = 0;
-
-       /* suppress tax rates on documents. 0 = no, 1 = yes. */
-       $suppress_tax_rates = 0;
-
        /* allow reopening closed transactions */
        $allow_gl_reopen = 0;
 
@@ -179,9 +145,6 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        /* Show average costed values instead of fixed standard cost in report, Inventory Valuation Report */
        $use_costed_values = 0; 
        
-       /* Allow negative prices for dummy/service items. To be moved to GL db settings */
-       $allow_negative_prices = 1;
-
        /* Show menu category icons in core themes */
        $show_menu_category_icons = 1;
        
@@ -195,9 +158,6 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
     /* Whether to allow sending new password by e-mail */
     $allow_password_reset = false;
 
-    /* Print Item Images on Sales Quotations. Set to 1 if so. */
-    $print_item_images_on_quote = 0;
-
        /* for uploaded item pictures */
        $pic_width              = 80;
        $pic_height     = 50;
index 8ee8fb8a90e45ec0171fffd93854f89aba5b158c..aebbc648ae97f53b4378ba5c507b6eaf708d1728 100644 (file)
@@ -22,7 +22,7 @@ include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
 include_once($path_to_root . "/dimensions/includes/dimensions_ui.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Dimension Entry"), false, false, "", $js);
 
index ccf72adaa055717e005ec5e30ff49c31f42eb085..8a3330467cde2bf1e85509625c61f3db5f177a89 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/includes/ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 if (isset($_GET['outstanding_only']) && $_GET['outstanding_only'])
index b13420d99db4d71cae909fde7484411d0a94321e..efef3763b3ea05c6c1b537fe505859b162233067 100644 (file)
@@ -15,7 +15,7 @@ $path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "View Dimension"), true, false, "", $js);
 
index 4bfc923b10517901bb401cb78c08f8e5867262e1..8a05f80ca3e4f7ca9ff320c5f9920bd4959e5cd2 100644 (file)
@@ -11,7 +11,7 @@ include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/gl/includes/db/gl_db_trans.inc");
 
 $js = get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 // Begin the UI
index eda80cd1454eebfaac3752e063279e5e9a15baad..5769af7defca833cde617d93ff58251bf78cf480 100644 (file)
@@ -25,7 +25,7 @@ include_once($path_to_root . "/includes/banking.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 add_js_file('reconcile.js');
index e56726f5eb005da7337e7ceec68b5ac59e31ad2c..1bffb9cbb5cc91ca08de179bc90269c5ec632742 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/gl/includes/gl_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Transfer between Bank Accounts"), false, false, "", $js);
 
index 14a8518d1ecf81b00a2f37ebdbfa4c99f3dd641e..b73f1c0ec14717eae6b106ec0e355dac7385a687 100644 (file)
@@ -27,7 +27,7 @@ include_once($path_to_root . "/admin/db/attachments_db.inc");
 $js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 if (isset($_GET['NewPayment'])) {
index 063dd8aed39165f77e39d3f3ac6088cb69f27f31..b68d247fa0e1b9a8d4fe505e9e75ae9c7744aa6d 100644 (file)
@@ -26,7 +26,7 @@ include_once($path_to_root . "/taxes/db/tax_types_db.inc");
 $js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 if (isset($_GET['ModifyGL'])) {
index 01dc3c1e328c1c9db42636bfb9352b2131a15b18..2d764d32ef093dcaa95d14bf7ea59c88622330e3 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/gl/includes/gl_db.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js = get_js_date_picker();
 
 page(_($help_context = "Balance Sheet Drilldown"), false, false, "", $js);
index c667c8873641321b2b36ddd685967189aa2fd4f9..4c25ddd270f782477c6ba2fb36e850e6a39b5653 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/includes/banking.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Bank Statement"), isset($_GET['bank_account']), false, "", $js);
 
index bf10abf055ccd51ec50c14ec1d259fad3264de25..9ba25a53ce495cc8c3c3f5e62548360d2b9bed17 100644 (file)
@@ -25,7 +25,7 @@ $js = '';
 set_focus('account');
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "General Ledger Inquiry"), false, false, '', $js);
index bfb6a5477b2ba862a0c1361934c472a6304d1cc2..27c38dac7b68338cd838ab30fc0ca3d0655142a8 100644 (file)
@@ -22,7 +22,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/gl/includes/gl_db.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js = get_js_date_picker();
 
 page(_($help_context = "Trial Balance"), false, false, "", $js);
index 2d9eaabc93e32715f000b502fe905132bf526a1c..5d6064e81ae4d928e05bfb2ef3f54e8b4f415ece 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/includes/ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Journal Inquiry"), false, false, "", $js);
index 8d9144d61c12f624fd19079ae3eedd6e8d9f63d7..4022e968f7ccb89a2082b90cf2bb377f445b6225 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/gl/includes/gl_db.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js = get_js_date_picker();
 
 page(_($help_context = "Profit & Loss Drilldown"), false, false, "", $js);
index e1e7c853070f02c3eaa5f779c59f35c591a1364e..91b111d9f199bf6aa077329b2ee3d0f2ad49a19f 100644 (file)
@@ -24,7 +24,7 @@ $js = '';
 set_focus('account');
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Tax Inquiry"), false, false, '', $js);
index fc057c25827bb85c22e91ad5837dc3994ab7ddbb..563e40b6c359883fd45b638762b4ebfee0cbb491 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/includes/banking.inc");
 include_once($path_to_root . "/admin/db/fiscalyears_db.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Closing GL Transactions"), false, false, "", $js);
 
index 49e924f6b41d0841d0d30239a3c9a21aaa531ebe..4ce1673cded0ba8d5675ef9a938dd34efc10ff7a 100644 (file)
@@ -19,7 +19,7 @@ include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Exchange Rates"), false, false, "", $js);
 
index 99d2a8aba073f3c8ebb60f56222217dbc1100bb7..a6b58f4244d0c9eaf11534e0847593b938cc0a85 100644 (file)
@@ -59,7 +59,7 @@ if (isset($_POST['add']) || isset($_POST['update']))
                display_error( _("The account name cannot be empty."));
                set_focus('account_name');
        } 
-       elseif (!$accounts_alpha && !is_numeric($_POST['account_code'])) 
+       elseif (!$SysPrefs->accounts_alpha() && !is_numeric($_POST['account_code'])) 
        {
            $input_error = 1;
            display_error( _("The account code must be numeric."));
@@ -67,7 +67,7 @@ if (isset($_POST['add']) || isset($_POST['update']))
        }
        if ($input_error != 1)
        {
-               if ($accounts_alpha == 2)
+               if ($SysPrefs->accounts_alpha() == 2)
                        $_POST['account_code'] = strtoupper($_POST['account_code']);
 
                if (!isset($_POST['account_tags']))
index 050637d5f26cfee6b9646dc0420bec6a28a24130..749c0f4df9438189ae0012d9fbf05584026572b6 100644 (file)
@@ -18,7 +18,7 @@ include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
 
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Revaluation of Currency Accounts"), false, false, "", $js);
 
index 5dd2c197e02a52587af77ce1fd31b78b8feff9d4..26b288a1e884463a22dd677521f04f205c041a25 100644 (file)
@@ -547,6 +547,25 @@ function user_transaction_days()
     return $_SESSION["wa_current_user"]->prefs->transaction_days();
 }
 
+function user_save_report_selections()
+{
+    return $_SESSION["wa_current_user"]->prefs->save_report_selections();
+}
+
+function user_use_date_picker()
+{
+    return $_SESSION["wa_current_user"]->prefs->use_date_picker();
+}
+
+function user_def_print_destination()
+{
+    return $_SESSION["wa_current_user"]->prefs->def_print_destination();
+}
+
+function user_def_print_orientation()
+{
+    return $_SESSION["wa_current_user"]->prefs->def_print_orientation();
+}
 
 function user_check_access($sec_area)
 {
index 426d3a78fcbd3512ca4996a38911f02f11d3be21..f5063382fa390bc4824de562824644355661bdf3 100644 (file)
@@ -86,7 +86,51 @@ class sys_prefs
                global $config_allocation_settled_allowance;
                return $config_allocation_settled_allowance;
        }
-       
+
+       function no_zero_lines_amount() 
+       {
+               return $this->prefs['no_zero_lines_amount'];
+       }
+
+       function show_po_item_codes() 
+       {
+               return $this->prefs['show_po_item_codes'];
+       }
+
+       function accounts_alpha() 
+       {
+               return $this->prefs['accounts_alpha'];
+       }
+
+       function loc_notification() 
+       {
+               return $this->prefs['loc_notification'];
+       }
+
+       function print_invoice_no() 
+       {
+               return $this->prefs['print_invoice_no'];
+       }
+
+       function allow_negative_prices() 
+       {
+               return $this->prefs['allow_negative_prices'];
+       }
+
+       function print_item_images_on_quote() 
+       {
+               return $this->prefs['print_item_images_on_quote'];
+       }
+
+       function alternative_tax_include_on_docs() 
+       {
+               return $this->prefs['alternative_tax_include_on_docs'];
+       }
+
+       function suppress_tax_rates() 
+       {
+               return $this->prefs['suppress_tax_rates'];
+       }
 }
 
 ?>
\ No newline at end of file
index bd72d6670627c4a2725eb7dd9071fda3bc03a2b0..80a3a62f2286068e22d3d6f137550553ae5379f6 100644 (file)
@@ -35,7 +35,11 @@ class user_prefs
        var $graphic_links; // use graphic links
        var $sticky_date;       // save date on subsequent document entry
        var $startup_tab;  // default start-up menu tab
-       var $transaction_days; // transaction days in inquiries.
+       var $transaction_days; // transaction days in inquiries
+       var $save_report_selection; // save report selections days 0...
+       var $use_date_picker; // use date picker for all date fields
+       var $def_print_destination; // default print destination. 0 = PDF/Printer, 1 = Excel
+       var $def_print_orientation; // default print orientation. 0 = Portrait. 1 = Landscape
 
        function user_prefs($user=null)
        {
@@ -51,6 +55,10 @@ class user_prefs
                        $this->language = $dflt_lang;
                        $this->theme = 'default';
                        $this->transaction_days = -30;
+                       $this->save_report_selections = 0;
+                       $this->use_date_picker = 1;
+                       $this->def_print_destination = 0;
+                       $this->def_print_orientation = 0;
 
                } else {
                        global $path_to_root;
@@ -86,6 +94,10 @@ class user_prefs
                                $this->startup_tab = "orders";
                        }
                        $this->transaction_days = $user['transaction_days'];
+                       $this->save_report_selections = $user['save_report_selections'];
+                       $this->use_date_picker = $user['use_date_picker'];
+                       $this->def_print_destination = $user['def_print_destination'];
+                       $this->def_print_orientation = $user['def_print_orientation'];
 
                        if (!file_exists("$path_to_root/themes/$this->theme"))
                                $this->theme = "default";
@@ -114,7 +126,11 @@ class user_prefs
                        'query_size' => $this->query_size,
                        'graphic_links' => $this->graphic_links,
                        'sticky_doc_date' => $this->sticky_date,
-                       'startup_tab' => $this->startup_tab);
+                       'startup_tab' => $this->startup_tab,
+                       'save_report_selections' => $this->save_report_selections,
+                       'use_date_picker' => $this->use_date_picker,
+                       'def_print_destination' => $this->def_print_destination,
+                       'def_print_orientation' => $this->def_print_orientation);
        }
        
        function language() 
@@ -240,6 +256,26 @@ class user_prefs
         return $this->transaction_days;
     }
 
+    function save_report_selections() 
+    {
+        return $this->save_report_selections;
+    }
+
+    function use_date_picker() 
+    {
+        return $this->use_date_picker;
+    }
+
+    function def_print_destination() 
+    {
+        return $this->def_print_destination;
+    }
+
+    function def_print_orientation() 
+    {
+        return $this->def_print_orientation;
+    }
+
        function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes) 
        {
                $this->price_dec = $price_dec;
index e8718c636deaecff11ab7472df32d85ec57b75fc..6c0a8d7fccc34afd2e7e6a72f3d27a3625940396 100644 (file)
@@ -40,7 +40,7 @@ function navi_button_cell($name, $value, $enabled=true, $align='left') {
 //    Sql paged table view. Call this function inside form.
 //
 function display_db_pager(&$pager) {
-    global     $use_popup_windows, $use_date_picker, $path_to_root;
+    global     $use_popup_windows, $path_to_root;
 
        $pager->select_records();
 
index a6537a83c8bd2a06ae407c980154ecaf1a6f3a6a..c1091b3702c63a76df24ae2e5c621167fd64578a 100644 (file)
@@ -606,7 +606,7 @@ function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
 function date_cells($label, $name, $title = null, $check=null, $inc_days=0, 
        $inc_months=0, $inc_years=0, $params=null, $submit_on_change=false)
 {
-       global $use_date_picker, $path_to_root, $Ajax;
+       global $path_to_root, $Ajax;
 
        if (!isset($_POST[$name]) || $_POST[$name] == "")
        {
@@ -624,7 +624,7 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
                        $_POST[$name] = $dd;
                }
        }
-       if ($use_date_picker)
+       if (user_use_date_picker())
        {
                $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ? 
                        "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
index 7b21ec09a272e4fe6274ae71529bb4f072543279..3d9babeba4aba21b8046757f4cc6d0f80e55a8d3 100644 (file)
@@ -2451,3 +2451,15 @@ function subledger_list_row($label, $name, $selected_id=null, $all_option = fals
        echo subledger_list($name, $account, $selected_id);
        echo "</td>\n</tr>\n";
 }
+
+function accounts_type_list_row($label, $name, $selected_id=null)
+{
+       echo "<tr>";
+       if ($label != null)
+               echo "<td class='label'>$label</td>\n";
+       echo "<td>";
+       $sel = array(_("Numeric"), _("Alpha Numeric"), _("ALPHA NUMERIC"));
+       echo array_selector($name, $selected_id, $sel); 
+       echo "</td></tr>\n";
+}
+
index f16e72f7cd809c585bed941447b3ddee9c87735d..8c8bae8db127b0e5982b3b46c392593debad1336 100644 (file)
@@ -423,7 +423,7 @@ function display_debit_or_credit_cells($value, $bold=false)
 
 function display_customer_trans_tax_details($tax_items, $columns)
 {
-       global $alternative_tax_include_on_docs, $suppress_tax_rates;
+       global $SysPrefs;
        $first = true;
     while ($tax_item = db_fetch($tax_items))
     {
@@ -431,13 +431,13 @@ function display_customer_trans_tax_details($tax_items, $columns)
                continue;
 
        $tax = number_format2($tax_item['amount'],user_price_dec());
-               if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+               if ($SysPrefs->suppress_tax_rates() == 1)
                        $tax_type_name = $tax_item['tax_type_name'];
                else
                        $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
        if ($tax_item['included_in_price'])
        {
-                       if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                       if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                        {
                                if ($first)
                                        label_row(_("Total Tax Excluded"), number_format2($tax_item['net_amount'], user_price_dec()),
index 94e10b30d09b9c09d71a296d3d422d94e50d10ae..7d86faa63beaf027740550b214070a792fa7ad7c 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Item Adjustments Note"), false, false, "", $js);
 
index 6e95c2574fe781978a9cdcf6dc700bf639b0bf92..57c4b33c40b3133c5b6d3f3ff00940b90d4b18da 100644 (file)
@@ -13,7 +13,7 @@
 
 function add_stock_adjustment($items, $location, $date_, $type, $increase, $reference, $memo_)
 {
-       global $loc_notification, $path_to_root, $Refs;
+       global $SysPrefs, $path_to_root, $Refs;
 
        begin_transaction();
        $args = func_get_args();
@@ -24,7 +24,7 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe
 
        $adj_id = get_next_trans_no(ST_INVADJUST);
 
-       if ($loc_notification == 1 && !$increase)
+       if ($SysPrefs->loc_notification() == 1 && !$increase)
        {
                include_once($path_to_root . "/inventory/includes/inventory_db.inc");
                $st_ids = array();
@@ -35,7 +35,7 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe
        foreach ($items as $line_item)
        {
 
-               if ($loc_notification == 1 && !$increase)
+               if ($SysPrefs->loc_notification() == 1 && !$increase)
                        $loc = calculate_reorder_level($location, $line_item, $st_ids, $st_names, $st_num, $st_reorder); 
 
                if (!$increase)
@@ -53,7 +53,7 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe
        $args->trans_no = $adj_id;
        hook_db_postwrite($args, ST_INVADJUST);
        commit_transaction();
-       if ($loc_notification == 1 && !$increase && count($st_ids) > 0)
+       if ($SysPrefs->loc_notification() == 1 && !$increase && count($st_ids) > 0)
                send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
 
        return $adj_id;
index 0acd090081c006b3cd9324e8af25a23cc8c5b295..8448ae8968b71a5bde2598f6c32c724952675201 100644 (file)
@@ -13,7 +13,7 @@
 
 function add_stock_transfer($Items, $location_from, $location_to, $date_, $type, $reference, $memo_)
 {
-       global $loc_notification, $path_to_root, $Refs;
+       global $SysPrefs, $path_to_root, $Refs;
 
        begin_transaction();
        $args = func_get_args();
@@ -24,7 +24,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
 
        $transfer_id = get_next_trans_no(ST_LOCTRANSFER);
 
-       if ($loc_notification == 1)
+       if ($SysPrefs->loc_notification() == 1)
        {
                include_once($path_to_root . "/inventory/includes/inventory_db.inc");
                $st_ids = array();
@@ -34,7 +34,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
        }
        foreach ($Items as $line_item)
        {
-               if ($loc_notification == 1)
+               if ($SysPrefs->loc_notification() == 1)
                        $loc = calculate_reorder_level($location_from, $line_item, $st_ids, $st_names, $st_num, $st_reorder); 
                add_stock_transfer_item($transfer_id, $line_item->stock_id, $location_from,
                        $location_to, $date_, $type, $reference, $line_item->quantity);
@@ -50,7 +50,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
 
        commit_transaction();
        
-       if ($loc_notification == 1 && count($st_ids) > 0)
+       if ($SysPrefs->loc_notification() == 1 && count($st_ids) > 0)
                send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
 
        return $transfer_id;
index 2c2e0974225965cbc2764b141a2835308c051a17..6021f1ee71082f92c30896424dd3b4123e4eefc8 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/includes/ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Inventory Item Movement"), @$_GET['popup'], false, "", $js);
 //------------------------------------------------------------------------------------------------
index 71e2f2b9e623b61a37285244d101c40eee731adf..46fb1469df7a62b634399003e52a13f5bde6ca0e 100644 (file)
@@ -16,7 +16,7 @@ include($path_to_root . "/includes/session.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Items"), @$_REQUEST['popup'], false, "", $js);
index 0da6d7559f6da5f200e46b46b2bd27489411caf1..40277211c56b18e1ee655725af534477fdf19136 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Inventory Location Transfers"), false, false, "", $js);
 
index 35c731767554c36f9f1c24bef773a12bd66604dc..ec2dca663d9ceb83500cbf084ce72a6fede8d00a 100644 (file)
@@ -24,7 +24,7 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Produce or Unassemble Finished Items From Work Order"), false, false, "", $js);
 
index 4054fcbdc1cf6889cf8251e6e23ec922264a5db2..ddb0d1ea60dfbc548c1cf7435bffcc2e4d0f9fc8 100644 (file)
@@ -24,7 +24,7 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Work Order Additional Costs"), false, false, "", $js);
 
index 06e82837a1ade8614b23d621281f7a4666abba9d..5c27369bbe1846796f821b36cddaed9930a8af88 100644 (file)
@@ -24,7 +24,7 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Work Order Entry"), false, false, "", $js);
 
@@ -63,7 +63,7 @@ if (isset($_GET['AddedID']))
                submenu_print(_("&Email This Work Order"), ST_WORKORDER, $id, null, 1);
        display_note(get_gl_view_str($stype, $id, _("View the GL Journal Entries for this Work Order")), 1);
        $ar = array('PARAM_0' => $_GET['date'], 'PARAM_1' => $_GET['date'], 'PARAM_2' => $stype, 'PARAM_3' => '',
-               'PARAM_4' => (isset($def_print_orientation) && $def_print_orientation == 1 ? 1 : 0)); 
+               'PARAM_4' => (user_def_print_orientation() == 1 ? 1 : 0)); 
        display_note(print_link(_("Print the GL Journal Entries for this Work Order"), 702, $ar), 1);
                hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), "filterType=$stype&trans_no=$id");
        }
index d2344f6f76962dcba885ad42232b7d586d08ae6e..abc518deb2f2db83a9c3fc7cece7bff2e5bf1cd8 100644 (file)
@@ -25,7 +25,7 @@ include_once($path_to_root . "/manufacturing/includes/work_order_issue_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Issue Items to Work Order"), false, false, "", $js);
index 10044b7b01f6f6542399bc5501cfe99b6f341063..dbdb8b46d58c8da38e2a339ae769d26919519ed3 100644 (file)
@@ -22,7 +22,7 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Work Order Release to Manufacturing"), false, false, "", $js);
 
index 44b9b357f05139f65c9a23586c4a3c51221e47e9..399e3e8691c3199290e193a827ea0b4820c12567 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Search Outstanding Purchase Orders"), false, false, "", $js);
 
index 196de84e295c1424630927ddd1c61fe0c3adb079..31c774263c967f2a834a326f8fa21cbe02699bbc 100644 (file)
@@ -19,7 +19,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Search Purchase Orders"), false, false, "", $js);
 
index fc19aee869944fd81786071865674ae743cd0317..6e4bcf88419e7a019b2463e98eb749c29a65c377 100644 (file)
@@ -18,7 +18,7 @@ include($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Supplier Allocation Inquiry"), false, false, "", $js);
 
index 94ab527597ffec00951249db3dc8488b7c4773bc..03a5d11d6029b349d8639733bf9d50c28e8b9589 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Supplier Inquiry"), isset($_GET['supplier_id']), false, "", $js);
 
index a8c6571abda80a3c494c08db604bbeb16102779b..81a6e57b30742bfbe64ff2e24965fcdbbc747cd5 100644 (file)
@@ -16,7 +16,7 @@ include_once($path_to_root . "/includes/session.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Suppliers"), @$_REQUEST['popup'], false, "", $js);
index dd2cc3bcabd7feb880d31b1b1141c7061a73bfc5..1ab8e66309f88e2fc8a829e66f1f28aec9e929e7 100644 (file)
@@ -33,7 +33,7 @@ set_page_security( @$_SESSION['PO']->trans_type,
 $js = '';
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 if (isset($_GET['ModifyOrderNumber']) && is_numeric($_GET['ModifyOrderNumber'])) {
index d2697de9c389ea45e3ece41a09f79c49139cc5a7..57ef24a02f99cead37e69c58b8648c10acd35b7b 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Receive Purchase Order Items"), false, false, "", $js);
 
index 0d1e6c9fd75455983b2a322037187d08a3cfdc12..2b8c07b392e62e1d7d21b14c6c398aa197a7b61b 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 //----------------------------------------------------------------------------------------
index ffb5e79bd9003e15a4737951aaba813d9c8a1664..d7172ee0e412431d123a9b146ce6ba5432a0c7bb 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 //----------------------------------------------------------------------------------------
 
index 75ab908a8d257422213fb24368718e0265450b50..38ca82dcb5cfb417f0b4b0f8e2a004a8f27c4550 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 add_js_file('payalloc.js');
index 06bb7b1f7b24816dbc6adbd70475164d3790ada9..de3082a9e1eadd6dfe906313b37786ac1219ccad 100644 (file)
@@ -50,7 +50,7 @@
                        $this->title = _("SALES QUOTATION");
                        $this->formData['document_name'] =_("Quotation No.");
                        $this->formData['document_date'] = $this->formData['ord_date'];
-                       $this->formData['document_number'] = $print_invoice_no == 0 && isset($this->formData['reference'])
+                       $this->formData['document_number'] = $SysPrefs->print_invoice_no() == 0 && isset($this->formData['reference'])
                                ? $this->formData['reference'] : $this->formData['order_no'];
                        $aux_info = array(
                                _("Customer's Reference") => $this->formData["customer_ref"],
@@ -65,7 +65,7 @@
                        $this->title = ($print_as_quote==1 ? _("QUOTE") : ($this->formData['prepaid'] ? _("PREPAYMENT ORDER") : _("SALES ORDER")));
                        $this->formData['document_name'] =_("Order No.");
                        $this->formData['document_date'] = $this->formData['ord_date'];
-                       $this->formData['document_number'] = $print_invoice_no == 0 && isset($this->formData['reference'])
+                       $this->formData['document_number'] = $SysPrefs->print_invoice_no() == 0 && isset($this->formData['reference'])
                                ? $this->formData['reference'] : $this->formData['order_no'];
                        $this->formData['document_amount'] = $this->formData['order_no'];
 
@@ -84,7 +84,7 @@
                        if (@$packing_slip)
                                $Payment_Terms = '';
                        $ref = $this->formData['order_'];
-                       if ($print_invoice_no == 0)
+                       if ($SysPrefs->print_invoice_no() == 0)
                        {
                                $ref = get_reference(ST_SALESORDER, $this->formData['order_']);
                                if (!$ref)
                        $Footer[0] = _("Please quote Invoice no. when paying. All amounts stated in"). " - " . $this->formData['curr_code'];
 
                        $deliveries = get_sales_parent_numbers(ST_SALESINVOICE, $this->formData['trans_no']);
-                       if ($print_invoice_no == 0)
+                       if ($SysPrefs->print_invoice_no() == 0)
                        {
                                foreach($deliveries as $n => $delivery) {
                                        $deliveries[$n] = get_reference(ST_CUSTDELIVERY, $delivery);
                        $Addr2['name'] = $this->company['coy_name'];
                        //$Addr2['address'] = $this->company['postal_address']; No, don't destroy delivery address!
                        $this->formData['document_date'] = $this->formData['ord_date'];
-                       $this->formData['document_number'] = $print_invoice_no == 0 && isset($this->formData['reference'])
+                       $this->formData['document_number'] = $SysPrefs->print_invoice_no() == 0 && isset($this->formData['reference'])
                                ? $this->formData['reference'] : $this->formData['order_no'];
 
                        $aux_info = array(
                $this->formData['document_date'] = $this->formData['tran_date'];
 
        if (!isset($this->formData['document_number']))
-               $this->formData['document_number'] = $print_invoice_no == 0 && isset($this->formData['reference'])
+               $this->formData['document_number'] = $SysPrefs->print_invoice_no() == 0 && isset($this->formData['reference'])
                        ? $this->formData['reference'] : @$this->formData['trans_no'];
 
        // footer generic content
index 887284b9bba3516c06cd373718efb72431930a52..cb7bea9db4504a2bb3b72451f9ef4caed86b244b 100644 (file)
@@ -424,7 +424,7 @@ class FrontReport extends Cpdf
        function Header2()
        {
                global $path_to_root, $print_as_quote,
-                       $print_invoice_no, $packing_slip, $dflt_lang; // FIXME should be passed as params
+                       $SysPrefs, $packing_slip, $dflt_lang; // FIXME should be passed as params
 
                $doctype = $this->formData['doctype'];
                $header2type = true;
index 4f2e6665bf11bb1b818415de58a9357dff445b27..018da18b7030010a053726835c09905c3f28cc97 100644 (file)
 function print_document_link($doc_no, $link_text, $link=true, $type_no, 
        $icon=false, $class='printlink', $id='', $email=0, $extra=0)
 {
-       global $path_to_root, $def_print_orientation;
+       global $path_to_root;
        include_once($path_to_root . "/includes/types.inc");
 
        $url = $path_to_root.'/reporting/prn_redirect.php?';
-       $def_orientation = (isset($def_print_orientation) && $def_print_orientation == 1 ? 1 : 0);
+       $def_orientation = (user_def_print_orientation() == 1 ? 1 : 0);
 
        switch ($type_no)
        {
@@ -146,4 +146,43 @@ function print_link($link_text, $rep, $pars = array(), $dir = '',
        return "<a target='_blank' href='$url'$id$class $pars[1]>$pars[0]</a>";
 }
 
+/*
+// Purpose: Function to parse a string into parameters
+// Release Date: 2014-12-26
+// Author: ApMuthu <apmuthu@usa.net>
+// Usage:
+$str = "PPFrt#2000 CID#6378465 TaxEx#2345-038 abcde ertrgdert COD#4253 jdegtd PIN#6473654";
+$p = parse_notes_params($str);
+echo print_r($p, true);
+
+An example of usage will be in the reporting/rep110.php file at near the end just before the last $rep-Font(); statement: 
+
+
+    $notes_params = parse_notes_params($branch['notes']);
+    if ($packing_slip == 0 && array_key_exists('CID', $notes_params)) {
+        $rep->NewLine(1);
+        $rep->TextCol(1, 7, "Old Customer# : " . $notes_params['CID'], - 2);
+    }
+*/
+
+function parse_notes_params($str, $sep=" ", $delim="#") {
+    $str_params = explode($sep, $str);
+    $param_array=Array('notes' => '');
+    foreach ($str_params AS $str_param) {
+        $param_set=explode($delim, trim($str_param));
+        $key = (array_key_exists(0, $param_set) ? trim($param_set[0]) : '');
+        $val = (array_key_exists(1, $param_set) ? trim($param_set[1]) : '');
+        if (strlen($key) > 0 && strlen($val) > 0) {
+            $param_array[$key]=$val;
+        } else {
+            // stop at first missing parameter set
+            // break;
+            // Collect the rest into notes
+            $param_array['notes'] .= (" " .  $str_param);
+        }
+    }
+    $param_array['notes'] = trim($param_array['notes']);
+    return $param_array;
+}
+
 ?>
\ No newline at end of file
index d9076691cc04b0059c9dfb09968fa4ed2e31c15a..73439b95e4ceaad17ca4fdc8904b591b9e91ed95 100644 (file)
@@ -167,8 +167,8 @@ class BoxReports
        //
        function get_ctrl($name, $type)
        {
-               global $path_to_root, $use_date_picker, $pdf_debug, $print_invoice_no,
-                       $def_print_destination, $def_print_orientation, $type_shortcuts;
+               global $path_to_root, $pdf_debug, $SysPrefs,
+                       $type_shortcuts;
 
                $st = '';
                        switch ($type)
@@ -214,7 +214,7 @@ class BoxReports
                                        else // saved parameters 2010-10-16 Joe Hunt
                                                $date = $_POST[$name];
                                        $st = "<input type='text' name='$name' value='$date'>";
-                                       if ($use_date_picker)
+                                       if (user_use_date_picker())
                                        {
                                                $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ? 
                                                        "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
@@ -233,14 +233,14 @@ class BoxReports
                                case 'DESTINATION':
                                        $sel = array(_("PDF/Printer"), "Excel");
                                        $def = 0;
-                                       if (isset($def_print_destination) && $def_print_destination == 1)
+                                       if (user_def_print_destination() == 1)
                                                $def = 1;
                                        return array_selector($name, $def, $sel);
 
                                case 'ORIENTATION':
                                        $sel = array(_("Portrait"), _("Landscape"));
                                        $def = 0;
-                                       if (isset($def_print_orientation) && $def_print_orientation == 1)
+                                       if (user_def_print_orientation() == 1)
                                                $def = 1;
                                        return array_selector($name, $def, $sel);
 
@@ -314,7 +314,7 @@ class BoxReports
 
                                case 'INVOICE':
                                        $IV = $type_shortcuts[ST_SALESINVOICE];
-                                       $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                                        $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-',
                                                ".TB_PREF."debtor_trans.type) AS TNO, concat('$IV ', ".TB_PREF."debtor_trans.$ref,' ', ".TB_PREF."debtors_master.name) as IName
                                                FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE type=".ST_SALESINVOICE." AND ".TB_PREF."debtors_master.debtor_no=".TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC";
@@ -322,7 +322,7 @@ class BoxReports
 
                                case 'CREDIT':
                                        $CN = $type_shortcuts[ST_CUSTCREDIT];
-                                       $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                                        $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-',
                                                ".TB_PREF."debtor_trans.type) AS TNO, concat('$CN ', ".TB_PREF."debtor_trans.$ref,' ', ".TB_PREF."debtors_master.name) as IName
                                                FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE type=".ST_CUSTCREDIT." AND ".TB_PREF."debtors_master.debtor_no=".TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC";
@@ -339,7 +339,7 @@ class BoxReports
                                        return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
 
                                case 'ORDERS':
-                                       $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
                                        $sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.$ref, '-',
                                                ".TB_PREF."debtors_master.name) as IName
                                                FROM ".TB_PREF."debtors_master, ".TB_PREF."sales_orders WHERE ".TB_PREF."debtors_master.debtor_no=".TB_PREF."sales_orders.debtor_no 
@@ -347,7 +347,7 @@ class BoxReports
                                        return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
 
                                case 'QUOTATIONS':
-                                       $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
                                        $sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.$ref, '-',
                                                ".TB_PREF."debtors_master.name) as IName
                                                FROM ".TB_PREF."debtors_master, ".TB_PREF."sales_orders WHERE ".TB_PREF."debtors_master.debtor_no=".TB_PREF."sales_orders.debtor_no 
@@ -355,7 +355,7 @@ class BoxReports
                                        return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
 
                                case 'PO':
-                                       $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
                                        $sql = "SELECT ".TB_PREF."purch_orders.order_no, concat(".TB_PREF."purch_orders.$ref, '-',
                                                ".TB_PREF."suppliers.supp_name) as IName
                                                FROM ".TB_PREF."suppliers, ".TB_PREF."purch_orders WHERE ".TB_PREF."suppliers.supplier_id=".TB_PREF."purch_orders.supplier_id ORDER BY ".TB_PREF."purch_orders.order_no DESC";
@@ -374,7 +374,7 @@ class BoxReports
                                case 'RECEIPT':
                                        $BD = $type_shortcuts[ST_BANKDEPOSIT];
                                        $CP = $type_shortcuts[ST_CUSTPAYMENT];
-                                       $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
+                                       $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                                        $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-',
                                                ".TB_PREF."debtor_trans.type) AS TNO, concat(".TB_PREF."debtor_trans.$ref, if (type=".ST_BANKDEPOSIT.", ' $BD ', ' $CP '), ".TB_PREF."debtors_master.name) as IName
                                                FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE (type=".ST_BANKDEPOSIT." OR type=".ST_CUSTPAYMENT." OR type=".ST_CUSTCREDIT.") AND ".TB_PREF."debtors_master.debtor_no=".TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC";
index d7147a7f5c89c50097dc0c3639b84378c8c0394d..22d48cfc1580f048dc70883505e1a33887177298 100644 (file)
        print button in reporting module. 
 */
 $path_to_root = "..";
-global $page_security, $save_report_selections;
+global $page_security;
 $page_security = 'SA_OPEN';    // this level is later overriden in rep file
 include_once($path_to_root . "/includes/session.inc");
 
-if (isset($save_report_selections) && $save_report_selections > 0 && isset($_POST['REP_ID'])) {        // save parameters from Report Center
+if (user_save_report_selections() > 0 && isset($_POST['REP_ID'])) {    // save parameters from Report Center
        for($i=0; $i<12; $i++) { // 2013-01-16 Joe Hunt
                if (isset($_POST['PARAM_'.$i]) && !is_array($_POST['PARAM_'.$i])) {
                        $rep = $_POST['REP_ID'];
-                       setcookie("select[$rep][$i]", $_POST['PARAM_'.$i], time()+60*60*24*$save_report_selections); // days from $save_report_selections
+                       setcookie("select[$rep][$i]", $_POST['PARAM_'.$i], time()+60*60*24*user_save_report_selections()); // days from user_save_report_selections()
                }       
        }
 }      
index 2fea78e67e550fcfc27b1364764764d6ec7c69a5..f1d5f9fe0b90a8a4be1cf7c7e6a0c8a3ee479e9d 100644 (file)
@@ -27,9 +27,9 @@ include_once($path_to_root . "/sales/includes/sales_db.inc");
 //----------------------------------------------------------------------------------------------------
 function get_invoice_range($from, $to)
 {
-       global $print_invoice_no;
+       global $SysPrefs;
 
-       $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
+       $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
 
        $sql = "SELECT trans.trans_no, trans.reference
                FROM ".TB_PREF."debtor_trans trans 
@@ -49,7 +49,7 @@ print_invoices();
 
 function print_invoices()
 {
-       global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
+       global $path_to_root, $SysPrefs;
        
        $show_this_payment = true; // include payments invoiced here in summary
 
@@ -163,7 +163,7 @@ function print_invoices()
                                $rep->TextColLines($c++, $c, $myrow2['StockDescription'], -2);
                                $newrow = $rep->row;
                                $rep->row = $oldrow;
-                               if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
+                               if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !$SysPrefs->no_zero_lines_amount())
                                {
                                        $rep->TextCol($c++, $c, $DisplayQty, -2);
                                        $rep->TextCol($c++, $c, $myrow2['units'], -2);
@@ -242,14 +242,14 @@ function print_invoices()
                                continue;
                        $DisplayTax = number_format2($sign*$tax_item['amount'], $dec);
 
-                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                       if ($SysPrefs->suppress_tax_rates() == 1)
                                $tax_type_name = $tax_item['tax_type_name'];
                        else
                                $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                        if ($myrow['tax_included'])
                        {
-                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                {
                                        if ($first)
                                        {
index 1f7270c4840e1c1885d3b013430ee38fea7dede7..e0c577a51e66c068acbaa77660691fe456c63914 100644 (file)
@@ -33,7 +33,7 @@ $print_as_quote = 0;
 
 function print_sales_orders()
 {
-       global $path_to_root, $print_as_quote, $no_zero_lines_amount;
+       global $path_to_root, $print_as_quote, $SysPrefs;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -128,7 +128,7 @@ function print_sales_orders()
                        $rep->TextColLines(1, 2, $myrow2['description'], -2);
                        $newrow = $rep->row;
                        $rep->row = $oldrow;
-                       if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
+                       if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !$SysPrefs->no_zero_lines_amount())
                        {
                                $rep->TextCol(2, 3,     $DisplayQty, -2);
                                $rep->TextCol(3, 4,     $myrow2['units'], -2);
@@ -179,7 +179,7 @@ function print_sales_orders()
 
                        if ($myrow['tax_included'])
                        {
-                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                {
                                        if ($first)
                                        {
index f016948f2ce14248f6d244ce68f305a7d7e2aa28..52870c0426dfb58614932cadfd66d42a30589b2e 100644 (file)
@@ -34,7 +34,7 @@ print_deliveries();
 
 function print_deliveries()
 {
-       global $path_to_root, $packing_slip, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
+       global $path_to_root, $packing_slip, $SysPrefs;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -125,7 +125,7 @@ function print_deliveries()
                                $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2);
                                $newrow = $rep->row;
                                $rep->row = $oldrow;
-                               if ($Net != 0.0  || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
+                               if ($Net != 0.0  || !is_service($myrow2['mb_flag']) || !$SysPrefs->no_zero_lines_amount())
                                {
                                        $rep->TextCol(2, 3,     $DisplayQty, -2);
                                        $rep->TextCol(3, 4,     $myrow2['units'], -2);
@@ -170,14 +170,14 @@ function print_deliveries()
                                        continue;
                                $DisplayTax = number_format2($tax_item['amount'], $dec);
  
-                                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                                       if ($SysPrefs->suppress_tax_rates() == 1)
                                                $tax_type_name = $tax_item['tax_type_name'];
                                        else
                                                $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                                        if ($myrow['tax_included'])
                                {
-                                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                        {
                                                if ($first)
                                                {
index 4287a4de03ed29136426ca17fd6493d5bd2f73ab..02c398153d77e29f1af1424a66956a69d9dbc233 100644 (file)
@@ -31,7 +31,7 @@ print_sales_quotations();
 
 function print_sales_quotations()
 {
-       global $path_to_root, $print_as_quote, $print_invoice_no, $no_zero_lines_amount, $print_item_images_on_quote, $pic_height;
+       global $path_to_root, $print_as_quote, $SysPrefs, $pic_height;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -47,7 +47,7 @@ function print_sales_quotations()
        $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
-       $pictures = (isset($print_item_images_on_quote) && $print_item_images_on_quote==1);
+       $pictures = $SysPrefs->print_item_images_on_quote();
        // If you want a larger image, then increase $pic_height f.i.
        // $pic_height += 25;
        
@@ -74,7 +74,7 @@ function print_sales_quotations()
                if ($email == 1)
                {
                        $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
-                       if ($print_invoice_no == 1)
+                       if ($SysPrefs->print_invoice_no() == 1)
                                $rep->filename = "SalesQuotation" . $i . ".pdf";
                        else    
                                $rep->filename = "SalesQuotation" . $myrow['reference'] . ".pdf";
@@ -111,7 +111,7 @@ function print_sales_quotations()
                        $rep->TextColLines(1, 2, $myrow2['description'], -2);
                        $newrow = $rep->row;
                        $rep->row = $oldrow;
-                       if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
+                       if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !$SysPrefs->no_zero_lines_amount())
                        {
                                $rep->TextCol(2, 3,     $DisplayQty, -2);
                                $rep->TextCol(3, 4,     $myrow2['units'], -2);
@@ -176,7 +176,7 @@ function print_sales_quotations()
 
                        if ($myrow['tax_included'])
                        {
-                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                {
                                        if ($first)
                                        {
@@ -215,7 +215,7 @@ function print_sales_quotations()
                $rep->Font();
                if ($email == 1)
                {
-                       if ($print_invoice_no == 1)
+                       if ($SysPrefs->print_invoice_no() == 1)
                                $myrow['reference'] = $i;
                        $rep->End($email);
                }
index 2e8e1dc5484509dbc28aaa39803e19fc7230ada5..f8811652bb19068cb5d3d32fc275828ca1b9b6f2 100644 (file)
@@ -32,7 +32,7 @@ print_credits();
 
 function print_credits()
 {
-       global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates;
+       global $path_to_root, $SysPrefs;
        
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -155,14 +155,14 @@ function print_credits()
                                continue;
                        $DisplayTax = number_format2($sign*$tax_item['amount'], $dec);
                        
-                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                       if ($SysPrefs->suppress_tax_rates() == 1)
                                $tax_type_name = $tax_item['tax_type_name'];
                        else
                                $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                        if ($myrow['tax_included'])
                        {
-                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                {
                                        if ($first)
                                        {
index e5188bc6e812a28d9cd714259855a0534a82bc15..9f9f012199610e60a780db1813d3f2f103ed5d73 100644 (file)
@@ -58,7 +58,7 @@ function get_po_details($order_no)
 
 function print_po()
 {
-       global $path_to_root, $show_po_item_codes;
+       global $path_to_root, $SysPrefs;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -135,7 +135,7 @@ function print_po()
                        $DisplayPrice = price_decimal_format($myrow2["unit_price"],$dec2);
                        $DisplayQty = number_format2($myrow2["quantity_ordered"],get_qty_dec($myrow2['item_code']));
                        $DisplayNet = number_format2($Net,$dec);
-                       if ($show_po_item_codes) {
+                       if ($SysPrefs->show_po_item_codes()) {
                                $rep->TextCol(0, 1,     $myrow2['item_code'], -2);
                                $rep->TextCol(1, 2,     $myrow2['description'], -2);
                        } else
@@ -172,14 +172,14 @@ function print_po()
                                continue;
                        $DisplayTax = number_format2($tax_item['Value'], $dec);
 
-                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                       if ($SysPrefs->suppress_tax_rates() == 1)
                                $tax_type_name = $tax_item['tax_type_name'];
                        else
                                $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                        if ($myrow['tax_included'])
                        {
-                               if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
+                               if ($SysPrefs->alternative_tax_include_on_docs() == 1)
                                {
                                        if ($first)
                                        {
index 039eb3b8bb90278ca9388ef35e5ea060f729fe99..66c07caf2e12f90064d128e946a9fa38915b171b 100644 (file)
@@ -18,7 +18,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/reporting/includes/reports_classes.inc");
 $js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 add_js_file('reports.js');
index 56e39bb07e2814283bc06c99167db4efbf0cfd30..d96fcd4717470f882a34d3485bc7f383e83bd9fa 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 600);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Create and Print Recurrent Invoices"), false, false, "", $js);
@@ -111,7 +111,7 @@ if ($id != -1)
                if (count($invs) > 0)
                {
                        $ar = array('PARAM_0' => $min."-".ST_SALESINVOICE,      'PARAM_1' => $max."-".ST_SALESINVOICE, 'PARAM_2' => "",
-                               'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => $def_print_orientation);
+                               'PARAM_3' => 0, 'PARAM_4' => 0, 'PARAM_5' => "", 'PARAM_6' => user_def_print_orientation());
                        display_note(print_link(sprintf(_("&Print Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1);
                        $ar['PARAM_3'] = 1; // email
                        display_note(print_link(sprintf(_("&Email Recurrent Invoices # %s - # %s"), $min, $max), 107, $ar), 0, 1);
index b3ccc70857d2b6d2c0813caf2902aa95f034af19..5fa56cc3e5b1af02e32b2d2e89c8c242bde3e158 100644 (file)
@@ -29,7 +29,7 @@ $js = "";
 if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 
index fcc934bd224d945c98e222a78b82e164072d6599..2b31654aeef630beb912828470aad615deb39e82 100644 (file)
@@ -30,7 +30,7 @@ if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
 
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 
index f92538020e8cf61c06d3a928a24af7877f657bcf..fa7fc581e7d9ebbca0e24ba85e0976df8c8dd05d 100644 (file)
@@ -29,7 +29,7 @@ $js = "";
 if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 
index 6e4b77bd4075f1425e5da5376b4de350bf282be9..66f676e6cd00c36f0ea6fd2b4ce7b3dc31a5f519 100644 (file)
@@ -30,7 +30,7 @@ $js = "";
 if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 
index 3b44bc67e8613ee7bb906ae6eed66ff6da497777..17c39619eeee196e7b13fcd33fd2597d8d7c2260 100644 (file)
@@ -24,7 +24,7 @@ $js = "";
 if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 add_js_file('payalloc.js');
index 86ba5aa39a2e2bfbdb8b2caa4ad37ba86176c324..d02df7bd48e441a08373709a4893cb17c6f48e29 100644 (file)
@@ -12,7 +12,7 @@
 //----------------------------------------------------------------------------------------
 function add_sales_order(&$order)
 {
-       global $loc_notification, $path_to_root, $Refs;
+       global $SysPrefs, $path_to_root, $Refs;
 
        begin_transaction();
        hook_db_prewrite($order, $order->trans_type);
@@ -45,7 +45,7 @@ function add_sales_order(&$order)
 
        $order->trans_no = array($order_no=>0);
 
-       if ($loc_notification == 1)
+       if ($SysPrefs->loc_notification() == 1)
        {
                include_once($path_to_root . "/inventory/includes/inventory_db.inc");
                $st_ids = array();
@@ -55,7 +55,7 @@ function add_sales_order(&$order)
        }
        foreach ($order->line_items as $line)
        {
-               if ($loc_notification == 1 && is_inventory_item($line->stock_id))
+               if ($SysPrefs->loc_notification() == 1 && is_inventory_item($line->stock_id))
                        $loc = calculate_reorder_level($order->Location, $line, $st_ids, $st_names, $st_num, $st_reorder); 
 
                $sql = "INSERT INTO ".TB_PREF."sales_order_details (order_no, trans_type, stk_code, description, unit_price, quantity, discount_percent) VALUES (";
@@ -77,7 +77,7 @@ function add_sales_order(&$order)
        hook_db_postwrite($order, $order->trans_type);
        commit_transaction();
 
-       if ($loc_notification == 1 && count($st_ids) > 0)
+       if ($SysPrefs->loc_notification() == 1 && count($st_ids) > 0)
                send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
        return $order_no;
 }
@@ -120,7 +120,7 @@ function update_sales_order_version($order)
 
 function update_sales_order($order)
 {
-       global $loc_notification, $path_to_root, $Refs;
+       global $SysPrefs, $path_to_root, $Refs;
 
        $del_date = date2sql($order->due_date);
        $ord_date = date2sql($order->document_date);
@@ -168,7 +168,7 @@ function update_sales_order($order)
 
        db_query($sql, "Old order Cannot be Deleted");
 
-       if ($loc_notification == 1)
+       if ($SysPrefs->loc_notification() == 1)
        {
                include_once($path_to_root . "/inventory/includes/inventory_db.inc");
                $st_ids = array();
@@ -178,7 +178,7 @@ function update_sales_order($order)
        }
        foreach ($order->line_items as $line)
        {
-               if ($loc_notification == 1 && is_inventory_item($line->stock_id))
+               if ($SysPrefs->loc_notification() == 1 && is_inventory_item($line->stock_id))
                        $loc = calculate_reorder_level($order->Location, $line, $st_ids, $st_names, $st_num, $st_reorder); 
 
                if (!$line->id) //new line
@@ -215,7 +215,7 @@ function update_sales_order($order)
 
        hook_db_postwrite($order, $order->trans_type);
        commit_transaction();
-       if ($loc_notification == 1 && count($st_ids) > 0)
+       if ($SysPrefs->loc_notification() == 1 && count($st_ids) > 0)
                send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
 }
 
index 7fa66013580c8bc16d71ba7f974966941ec594a5..a1e0e55249f9a216052e206d1426552930705a0f 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/sales/includes/sales_db.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Customer Allocation Inquiry"), false, false, "", $js);
 
index 86b965881f6ef4bdb677a816b2c7c0c9645296f6..4356121379971c0cb2bc167657ab9162d08fb5aa 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Customer Transactions"), isset($_GET['customer_id']), false, "", $js);
 
index f6ac03fa01f95394c30e908c7f4b304f62535598..91787385f11d953dbb273880ba6cae309d7741c3 100644 (file)
@@ -20,7 +20,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 600);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 if (isset($_GET['OutstandingOnly']) && ($_GET['OutstandingOnly'] == true))
index b96b99dd1e7f3692ec00babeb090e65ab3bd7cc8..ae9a666ea6a17d04eaca5e0bb13ccf3c792e7ef2 100644 (file)
@@ -73,7 +73,7 @@ else
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 600);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page($_SESSION['page_title'], false, false, "", $js);
 
index 6515b8af9624371435d1cc13b82ed522ac4d4ad8..b007ac00a7498b81594d8f0d08df5a6807f07d2e 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/includes/session.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
        
 page(_($help_context = "Customers"), @$_REQUEST['popup'], false, "", $js); 
index 999bccdb10765ec3c0f7b40fce37090ab7683214..c100204c024d02fc862f6b4e7c4d909912e13588 100644 (file)
@@ -18,7 +18,7 @@ include_once($path_to_root . "/sales/includes/sales_db.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(900, 600);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 
 page(_($help_context = "Recurrent Invoices"), false, false, "", $js);
index 13a88349bb8036c10c3f4cf427b34bf00d744ef5..ecca77d0b4f812976eeba61f65ac54f9f0880f26 100644 (file)
@@ -55,7 +55,7 @@ if ($use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
 
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 
@@ -505,7 +505,7 @@ if (isset($_POST['ProcessOrder']) && can_process()) {
 
 function check_item_data()
 {
-       global $SysPrefs, $allow_negative_prices;
+       global $SysPrefs;
        
        $is_inventory_item = is_inventory_item(get_post('stock_id'));
        if(!get_post('stock_id_text', true)) {
@@ -517,7 +517,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) && (!$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 3f29a739152e6bc85c6bad97876390a0c800ac71..0a2584d346a77ebd6f7dc3294959224d081e7f53 100644 (file)
@@ -35,7 +35,51 @@ class fa2_4 {
                if (get_company_pref('default_receival_required') === null) { // new in 2.4 installations
                        set_company_pref('default_receival_required', 'glsetup.purchase', 'smallint', 6, 10);
                }
-               $result = $this->update_workorders()  && $this->update_grn_rates() && $this->switch_database_to_utf($pref);
+               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);
 
                if ($result)
                        $result = $this->do_cleanup();
index 14afb1ae8376c109ca3d1e1ace80b7fe7bfddf9a..dd300d2cd5c474d9aa043122811dc4e4da0239e5 100644 (file)
@@ -83,3 +83,8 @@ ALTER TABLE `0_stock_category` ADD COLUMN `dflt_no_purchase` tinyint(1) NOT NULL
 # added exchange rate field in grn_batch
 ALTER TABLE `0_grn_batch` ADD COLUMN `rate` double NULL default '1' AFTER `loc_code`;
 ALTER TABLE `0_users` CHANGE `query_size` `query_size` TINYINT(1) UNSIGNED NOT NULL DEFAULT 10; 
+
+ALTER TABLE `0_users` ADD `save_report_selections` SMALLINT( 6 ) NOT NULL default '0' COMMENT 'Save Report Selection Days' AFTER `transaction_days`;
+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`;
index aabfbb6fecee9529d2f6d7cd08260642ba5efbe4..fcef56ab510178b332bfb213359ec7f6cea9c829 100644 (file)
@@ -2063,6 +2063,7 @@ INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales',
 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
+INSERT INTO `0_sys_prefs` VALUES('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, '30');
 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
@@ -2081,6 +2082,18 @@ INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varcha
 INSERT INTO `0_sys_prefs` VALUES('bcc_email', 'setup.company', 'varchar', 100, '');
 INSERT INTO `0_sys_prefs` VALUES('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
+INSERT INTO `0_sys_prefs` VALUES('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
+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('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
+
 
 -- --------------------------------------------------------
 
@@ -2328,6 +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',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `user_id` (`user_id`)
@@ -2337,8 +2354,8 @@ CREATE TABLE IF NOT EXISTS `0_users` (
 -- Dumping data for table `0_users`
 --
 
-INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2014-05-11 23:27:46', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
-INSERT INTO `0_users` VALUES(2, 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', 9, '999-999-999', 'demo@demo.nu', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 3, 1, 1, 0, 0, '2014-02-06 19:02:35', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
+INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2014-05-11 23:27:46', 10, 1, 1, '1', 1, 0, 'orders', 30, 0, 1, 0, 0, 0);
+INSERT INTO `0_users` VALUES(2, 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', 9, '999-999-999', 'demo@demo.nu', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 3, 1, 1, 0, 0, '2014-02-06 19:02:35', 10, 1, 1, '1', 1, 0, 'orders', 30, 0, 1, 0, 0, 0);
 
 -- --------------------------------------------------------
 
index 7e77cb89eef20422155ce72bf8101b6dbcd34bc5..d46b8906441ea849e0be04fe896d4f5ae105ea4f 100644 (file)
@@ -1824,6 +1824,7 @@ INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales',
 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
+INSERT INTO `0_sys_prefs` VALUES('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, '30');
 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
@@ -1842,6 +1843,17 @@ INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varcha
 INSERT INTO `0_sys_prefs` VALUES('bcc_email', 'setup.company', 'varchar', 100, '');
 INSERT INTO `0_sys_prefs` VALUES('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
+INSERT INTO `0_sys_prefs` VALUES('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
+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('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
+INSERT INTO `0_sys_prefs` VALUES('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
 
 -- --------------------------------------------------------
 
@@ -2078,6 +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',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `user_id` (`user_id`)
@@ -2087,7 +2103,7 @@ CREATE TABLE IF NOT EXISTS `0_users` (
 -- Dumping data for table `0_users`
 --
 
-INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2008-04-04 12:34:29', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
+INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2008-04-04 12:34:29', 10, 1, 1, '1', 1, 0, 'orders', 30, 0, 1, 0, 0, 0);
 
 -- --------------------------------------------------------
 
index 032cc560f6596b2fb54e5e4b29f1cf79e1179a38..aff2014d667c4ae9ab8d87931c0993474419b8e8 100644 (file)
@@ -89,12 +89,11 @@ function delete_tax_group_items($id)
 //
 function get_tax_group_rates($group_id=null, $tax_shipping=false)
 {
-       global $suppress_tax_rates;
+       global $SysPrefs;
 
        $sql = 
        "SELECT t.id as tax_type_id,"
-               .(isset($suppress_tax_rates) && $suppress_tax_rates == 1
-                       ? "t.name as tax_type_name,"
+               .($SysPrefs->suppress_tax_rates() == 1 ? "t.name as tax_type_name,"
                        : "CONCAT(t.name, ' (', t.rate, '%)') as tax_type_name,")
                ."t.sales_gl_code,
                  t.purchasing_gl_code,