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."));
'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'];
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"];
$_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);
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);
check_row(_("Search Customer List"), 'no_customer_list', null);
check_row(_("Search Supplier List"), 'no_supplier_list', null);
label_row("", " ");
+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'));
'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']);
/* 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());
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');
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);
}
$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;
'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
)));
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"];
$_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'];
//---------------
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']);
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']);
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']);
text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
-
//----------------
end_outer_table(1);
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);
/* 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 */
/* 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
/* 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;
/* 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;
/* 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;
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);
$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'])
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);
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
$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');
$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);
$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'])) {
$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'])) {
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);
$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);
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);
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);
$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);
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);
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);
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);
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);
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."));
}
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']))
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);
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)
{
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
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)
{
$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;
$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";
'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()
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;
// 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();
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] == "")
{
$_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";
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";
+}
+
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))
{
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()),
$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);
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();
$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();
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)
$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;
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();
$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();
}
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);
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;
$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);
//------------------------------------------------------------------------------------------------
$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);
$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);
$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);
$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);
$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);
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");
}
$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);
$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);
$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);
$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);
$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);
$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);
$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);
$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'])) {
$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);
$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();
//----------------------------------------------------------------------------------------
$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();
//----------------------------------------------------------------------------------------
$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');
$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"],
$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'];
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
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;
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)
{
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
//
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)
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";
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);
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";
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";
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
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
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";
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";
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()
}
}
}
//----------------------------------------------------------------------------------------------------
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
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
$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);
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)
{
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");
$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);
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)
{
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");
$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);
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)
{
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");
$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;
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";
$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);
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)
{
$rep->Font();
if ($email == 1)
{
- if ($print_invoice_no == 1)
+ if ($SysPrefs->print_invoice_no() == 1)
$myrow['reference'] = $i;
$rep->End($email);
}
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");
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)
{
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");
$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
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)
{
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');
$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);
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);
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();
}
$js .= get_js_open_window(900, 500);
}
-if ($use_date_picker) {
+if (user_use_date_picker()) {
$js .= get_js_date_picker();
}
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 ($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 ($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');
//----------------------------------------------------------------------------------------
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);
$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();
}
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 (";
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;
}
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);
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();
}
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
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);
}
$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);
$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);
$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))
$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);
$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);
$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);
$js .= get_js_open_window(900, 500);
}
-if ($use_date_picker) {
+if (user_use_date_picker()) {
$js .= get_js_date_picker();
}
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)) {
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;
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();
# 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`;
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');
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');
+
-- --------------------------------------------------------
`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`)
-- 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);
-- --------------------------------------------------------
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');
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');
-- --------------------------------------------------------
`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`)
-- 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);
-- --------------------------------------------------------
//
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,