From: Janusz Dobrowolski Date: Wed, 20 Jan 2010 11:23:31 +0000 (+0000) Subject: Merged changes form main trunk up to 2.2.4 X-Git-Tag: v2.4.2~19^2~998 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=9478a0cdeaf9201d2f3947e11e58d90354050025 Merged changes form main trunk up to 2.2.4 --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8d71f2ef..367afd8f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,65 @@ Legend: ! -> Note $ -> Affected files + +20-Jan-2010 Merged changes from main trunk 2.2.3-2.2.4 as follows +------------------------------- Release 2.2.4 ---------------------------------- +17-Jan-2010 Joe Hunt +! Release 2.2.4 +$ $config.default.php + update.html + +17-Jan-2010 Janusz Dobrowolski +! Improved error checking.in company update/creation. +$ /admin/create_coy.php +# Fixed default value for stock_category.dflt_tax_type +$ /sql/en_US-new.sql +# Fixed errors display in ajax mode. +$ /includes/errors.inc +# Fixed checks for deleting POS +$ /sales/manage/sales_points.php + +15-Jan-2010 Janusz Dobrowolski +! Changed so GL Account Types id allows up to 10 digits. +$ /gl/manage/gl_account_types.php +# [0000187] Category and description reset after failed check; +$ /inventory/manage/sales_kits.php +# Cleaned warnings in errorlog. +$ /sales/includes/sales_db.inc +! Default 0 on empty amount fields +$ /includes/data_checks.inc +! Empty numeric input fields globaly defaulted to 0. +$ /includes/data_checks.inc + /includes/ui/ui_input.inc + +15-Jan-2010 Joe Hunt +# [0000190] Back link on confirmation only pages removed. +$ /includes/page/footer.inc + /includes/ui/ui_view.inc + /includes/main.inc +# Removed a comma after last item in structure for 0_tax_types, line 1596 +$ /sql/en_US-new.sql + +14-Jan-2010 Joe Hunt +# A couple of small bugs were fixed in average material cost +$ /purchasing/includes/db/grn_db.inc + /purchasing/includes/db/invoice_db.inc + /manufacturing/includes/db/work_orders_db.inc + +13-Jan-2010 Joe Hunt +! Changed so also Item Adjustment and Cost Update allow more than 2 dec in price +$ /inventory/cost_update.php + /inventory/includes/item_adjustments_ui.inc + /inventory/view/view_adjustment.php +! Changed so GL Account Types id allows up to 6 digits. +$ /gl/manage/gl_account_types.php + +12-Jan-2010 Janusz Dobrowolski +# Fixed buggy exemptions display +$ /taxes/item_tax_types.php + +---------- End of changes from main trunk 2.2.3-2.2.4 + 12-Jan-2010 Janusz Dobrowolski ! Added sorting by branch_ref $ /sales/includes/db/branches_db.inc diff --git a/admin/create_coy.php b/admin/create_coy.php index 6667ea45..4a5f921d 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -83,7 +83,7 @@ function handle_submit() $comp_path, $comp_subdirs; $new = false; - + $error = false; if (!check_data()) return false; @@ -115,25 +115,30 @@ function handle_submit() if (($db = db_create_db($conn)) == 0) { display_error(_("Error creating Database: ") . $conn['dbname'] . _(", Please create it manually")); - remove_connection($id); - set_global_connection(); - return false; - } + $error = true; + } else { - $filename = $_FILES['uploadfile']['tmp_name']; - if (is_uploaded_file ($filename)) - { - db_import($filename, $conn, $id); - if (isset($_POST['admpassword']) && $_POST['admpassword'] != "") - update_admin_password($conn, md5($_POST['admpassword'])); + $filename = $_FILES['uploadfile']['tmp_name']; + if (is_uploaded_file ($filename)) + { + if (!db_import($filename, $conn, $id)) { + display_error(_('Cannot create new company due to bugs in sql file.')); + $error = true; + } else + if (isset($_POST['admpassword']) && $_POST['admpassword'] != "") + update_admin_password($conn, md5($_POST['admpassword'])); + } + else + { + display_error(_("Error uploading Database Script, please upload it manually")); + $error = true; + } } - else - { - display_error(_("Error uploading Database Script, please upload it manually")); - set_global_connection(); + set_global_connection(); + if ($error) { + remove_connection($id); return false; } - set_global_connection(); } $error = write_config_db($new); if ($error == -1) @@ -153,6 +158,7 @@ function handle_submit() } $exts = get_company_extensions(); write_extensions($exts, $id); + display_notification($new ? _('New company has been created.') : _('Company has been updated.')); return true; } @@ -218,8 +224,7 @@ function handle_delete() display_error(_("Cannot remove temporary renamed company data directory ") . $tmpname); return; } - - meta_forward($_SERVER['PHP_SELF']); + display_notification(_("Selected company as been deleted")); } //--------------------------------------------------------------------------------------------- @@ -359,19 +364,14 @@ function display_company_edit($selected_id) //--------------------------------------------------------------------------------------------- -if (isset($_GET['c']) && $_GET['c'] == 'df') -{ - +if (isset($_GET['c']) && $_GET['c'] == 'df') { handle_delete(); + $selected_id = -1; } if (isset($_GET['c']) && $_GET['c'] == 'u') -{ if (handle_submit()) - { - meta_forward($_SERVER['PHP_SELF']); - } -} + $selected_id = -1; //--------------------------------------------------------------------------------------------- diff --git a/config.default.php b/config.default.php index 17fb66d7..dda1474e 100644 --- a/config.default.php +++ b/config.default.php @@ -56,7 +56,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ // Main Title $app_title = "FrontAccounting"; // application version - $version = "2.3 CVS (m3)"; + $version = "2.3 CVS (m4)"; // Build for development purposes $build_version = date("d.m.Y", filemtime("$path_to_root/CHANGELOG.txt")); diff --git a/gl/manage/gl_account_types.php b/gl/manage/gl_account_types.php index 8efa766e..57ab4a65 100644 --- a/gl/manage/gl_account_types.php +++ b/gl/manage/gl_account_types.php @@ -174,7 +174,7 @@ if ($selected_id != -1) label_row(_("ID:"), $_POST['id']); } else - text_row_ex(_("ID:"), 'id', 4); + text_row_ex(_("ID:"), 'id', 10); text_row_ex(_("Name:"), 'name', 50); gl_account_types_list_row(_("Subgroup Of:"), 'parent', null, _("None"), true); diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 9589f13c..ff316953 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -470,11 +470,12 @@ function check_int($postname, $min=null, $max=null) { // // Numeric input check. // Return 1 if number has proper form and is within range +// Empty/not defined fields are defaulted to $dflt value. // -function check_num($postname, $min=null, $max=null) { +function check_num($postname, $min=null, $max=null, $dflt=0) { if(!isset($_POST[$postname])) return 0; - $num = input_num($postname); + $num = input_num($postname, $dflt); if ($num === false || $num === null) return 0; if (isset($min) && ($num<$min)) diff --git a/includes/errors.inc b/includes/errors.inc index a9b68898..500d7e60 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -94,7 +94,12 @@ function error_box() { Helper to avoid sparse log notices. */ function end_flush () { - if (ob_get_level()) ob_end_flush(); + global $Ajax; + + if (isset($Ajax)) + $Ajax->run(); + + if (ob_get_level()) ob_end_flush(); } function display_db_error($msg, $sql_statement=null, $exit=true) diff --git a/includes/main.inc b/includes/main.inc index b0878fb5..138ae369 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -48,13 +48,13 @@ function page($title, $no_menu=false, $is_index=false, $onload="", $js="", $scri } } -function end_page($no_menu=false, $is_index=false) +function end_page($no_menu=false, $is_index=false, $hide_back_link=false) { global $path_to_root, $Ajax; $hide_menu = $no_menu; div_end(); // _page_body section include($path_to_root . "/includes/page/footer.inc"); - page_footer($no_menu, $is_index); + page_footer($no_menu, $is_index, $hide_back_link); } function flush_dir($path, $wipe = false) diff --git a/includes/page/footer.inc b/includes/page/footer.inc index 90c951c1..e07f6983 100644 --- a/includes/page/footer.inc +++ b/includes/page/footer.inc @@ -9,11 +9,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -function page_footer($no_menu=false, $is_index=false) +function page_footer($no_menu=false, $is_index=false, $hide_back_link=false) { global $path_to_root, $js_lib, $Validate, $Editors, $Ajax; - if (!$is_index && function_exists('hyperlink_back')) + if (!$is_index && !$hide_back_link && function_exists('hyperlink_back')) hyperlink_back(); include_once($path_to_root."/themes/".user_theme()."/renderer.php"); $rend = new renderer(); diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index b2a49e2b..b27f5fde 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -75,7 +75,7 @@ function simple_page_mode($numeric_id = true) // // Read numeric value from user formatted input // -function input_num($postname=null, $dflt=null) +function input_num($postname=null, $dflt=0) { if (!isset($_POST[$postname]) || $_POST[$postname] == "") return $dflt; diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 9b51ce3f..8e2591c3 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -432,7 +432,7 @@ function display_edit_tax_items($taxes, $columns, $tax_included, $leftspan=0) function display_footer_exit() { br(2); - end_page(); + end_page(false, false, true); exit; } diff --git a/inventory/cost_update.php b/inventory/cost_update.php index 2ce775fc..088cad58 100644 --- a/inventory/cost_update.php +++ b/inventory/cost_update.php @@ -103,20 +103,16 @@ hidden("OldLabourCost", $myrow["labour_cost"]); hidden("OldOverheadCost", $myrow["overhead_cost"]); start_table($table_style2); +$dec1 = $dec2 = $dec3 = 0; +$_POST['material_cost'] = price_decimal_format($myrow["material_cost"], $dec1); +$_POST['labour_cost'] = price_decimal_format($myrow["labour_cost"], $dec2); +$_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3); -$_POST['material_cost'] = price_format($myrow["material_cost"]); -$_POST['labour_cost'] = price_format($myrow["labour_cost"]); -$_POST['overhead_cost'] = price_format($myrow["overhead_cost"]); - -amount_row(_("Standard Material Cost Per Unit"), "material_cost", - null, "class='tableheader2'"); - +amount_row(_("Standard Material Cost Per Unit"), "material_cost", null, "class='tableheader2'", null, $dec1); if ($myrow["mb_flag"]=='M') { - amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", - null, "class='tableheader2'"); - amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", - null, "class='tableheader2'"); + amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2); + amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", null, "class='tableheader2'", null, $dec3); } else { diff --git a/inventory/includes/item_adjustments_ui.inc b/inventory/includes/item_adjustments_ui.inc index 7b67cca3..cfe697fa 100644 --- a/inventory/includes/item_adjustments_ui.inc +++ b/inventory/includes/item_adjustments_ui.inc @@ -81,7 +81,7 @@ function display_adjustment_items($title, &$order) label_cell($stock_item->item_description); qty_cell($stock_item->quantity, false, get_qty_dec($stock_item->stock_id)); label_cell($stock_item->units); - amount_cell($stock_item->standard_cost); + amount_decimal_cell($stock_item->standard_cost); amount_cell($stock_item->standard_cost * $stock_item->quantity); edit_button_cell("Edit$line_no", _("Edit"), @@ -112,13 +112,15 @@ function adjustment_edit_item_controls(&$order, $line_no=-1) global $Ajax; start_row(); + $dec2 = 0; $id = find_submit('Edit'); if ($line_no != -1 && $line_no == $id) { $_POST['stock_id'] = $order->line_items[$id]->stock_id; $_POST['qty'] = qty_format($order->line_items[$id]->quantity, $order->line_items[$id]->stock_id, $dec); - $_POST['std_cost'] = price_format($order->line_items[$id]->standard_cost); + //$_POST['std_cost'] = price_format($order->line_items[$id]->standard_cost); + $_POST['std_cost'] = price_decimal_format($order->line_items[$id]->standard_cost, $dec2); $_POST['units'] = $order->line_items[$id]->units; hidden('stock_id', $_POST['stock_id']); @@ -138,14 +140,16 @@ function adjustment_edit_item_controls(&$order, $line_no=-1) $item_info = get_item_edit_info($_POST['stock_id']); $dec = $item_info['decimals']; $_POST['qty'] = number_format2(0, $dec); - $_POST['std_cost'] = price_format($item_info["standard_cost"]); + //$_POST['std_cost'] = price_format($item_info["standard_cost"]); + $_POST['std_cost'] = price_decimal_format($item_info["standard_cost"], $dec2); $_POST['units'] = $item_info["units"]; } qty_cells(null, 'qty', $_POST['qty'], null, null, $dec); label_cell($_POST['units'], '', 'units'); - amount_cells(null, 'std_cost', $_POST['std_cost']); + //amount_cells(null, 'std_cost', $_POST['std_cost']); + amount_cells(null, 'std_cost', null, null, null, $dec2); label_cell(" "); if ($id != -1) diff --git a/inventory/manage/sales_kits.php b/inventory/manage/sales_kits.php index 005af381..16a78f87 100644 --- a/inventory/manage/sales_kits.php +++ b/inventory/manage/sales_kits.php @@ -200,7 +200,8 @@ if (get_post('item_code') == '') { start_table($table_style2); text_row(_("Alias/kit code:"), 'kit_code', null, 20, 21); } else -{ // Kit selected so display bom or edit component +{ + // Kit selected so display bom or edit component $_POST['description'] = $props['description']; $_POST['category'] = $props['category_id']; start_table($table_style2); @@ -226,8 +227,10 @@ if (get_post('item_code') == '') { // if (get_post('description') == '') // $_POST['description'] = get_kit_name($_POST['component']); if (get_post('item_code') == '') { // new kit/alias - $_POST['description'] = $props['description']; - $_POST['category'] = $props['category_id']; + if ($Mode!='ADD_ITEM' && $Mode!='UPDATE_ITEM') { + $_POST['description'] = $props['description']; + $_POST['category'] = $props['category_id']; + } text_row(_("Description:"), 'description', null, 50, 200); stock_categories_list_row(_("Category:"), 'category', null); } diff --git a/inventory/view/view_adjustment.php b/inventory/view/view_adjustment.php index 6bc50764..953e6018 100644 --- a/inventory/view/view_adjustment.php +++ b/inventory/view/view_adjustment.php @@ -64,7 +64,7 @@ while ($adjustment = db_fetch($adjustment_items)) label_cell($adjustment['description']); qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id'])); label_cell($adjustment['units']); - amount_cell($adjustment['standard_cost']); + amount_decimal_cell($adjustment['standard_cost']); end_row(); } diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 7e8be648..c06994ee 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -20,6 +20,8 @@ function add_material_cost($stock_id, $qty, $date_) $standard_cost = get_standard_cost($bom_item['component']); $m_cost += ($bom_item['quantity'] * $standard_cost); } + $dec = user_price_dec(); + $m_cost = price_decimal_format($m_cost, $dec); $sql = "SELECT material_cost FROM ".TB_PREF."stock_master WHERE stock_id = " .db_escape($stock_id); $result = db_query($sql); @@ -30,6 +32,7 @@ function add_material_cost($stock_id, $qty, $date_) $material_cost = 0; else $material_cost = ($qoh * $material_cost + $qty * $m_cost) / ($qoh + $qty); + $material_cost = round2($material_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=$material_cost WHERE stock_id=".db_escape($stock_id); db_query($sql,"The cost details for the inventory item could not be updated"); @@ -37,6 +40,8 @@ function add_material_cost($stock_id, $qty, $date_) function add_overhead_cost($stock_id, $qty, $date_, $costs) { + $dec = user_price_dec(); + $costs = price_decimal_format($costs, $dec); if ($qty != 0) $costs /= $qty; $sql = "SELECT overhead_cost FROM ".TB_PREF."stock_master WHERE stock_id = " @@ -49,6 +54,7 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs) $overhead_cost = 0; else $overhead_cost = ($qoh * $overhead_cost + $qty * $costs) / ($qoh + $qty); + $overhead_cost = round2($overhead_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET overhead_cost=".db_escape($overhead_cost)." WHERE stock_id=".db_escape($stock_id); db_query($sql,"The cost details for the inventory item could not be updated"); @@ -56,6 +62,8 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs) function add_labour_cost($stock_id, $qty, $date_, $costs) { + $dec = user_price_dec(); + $costs = price_decimal_format($costs, $dec); if ($qty != 0) $costs /= $qty; $sql = "SELECT labour_cost FROM ".TB_PREF."stock_master WHERE stock_id = " @@ -68,6 +76,7 @@ function add_labour_cost($stock_id, $qty, $date_, $costs) $labour_cost = 0; else $labour_cost = ($qoh * $labour_cost + $qty * $costs) / ($qoh + $qty); + $labour_cost = round2($labour_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET labour_cost=".db_escape($labour_cost)." WHERE stock_id=".db_escape($stock_id); db_query($sql,"The cost details for the inventory item could not be updated"); @@ -82,11 +91,14 @@ function add_issue_cost($stock_id, $qty, $date_, $costs) $result = db_query($sql); $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; + $dec = user_price_dec(); + $material_cost = price_decimal_format($material_cost, $dec); $qoh = get_qoh_on_date($stock_id, null, $date_); if ($qoh + $qty <= 0) $material_cost = 0; else $material_cost = ($qty * $costs) / ($qoh + $qty); + $material_cost = round2($material_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=material_cost+" .db_escape($material_cost) ." WHERE stock_id=".db_escape($stock_id); diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 84a2f938..b055c1f9 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -17,20 +17,27 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $currency = get_supplier_currency($supplier); else $currency = null; + $dec = user_price_dec(); + $price = price_decimal_format($price, $dec); if ($currency != null) - $price_in_home_currency = to_home_currency($price, $currency, $date); + { + $ex_rate = get_exchange_rate_to_home_currency($currency, $date_); + $price_in_home_currency = $price / $ex_rate; + //$price_in_home_currency = to_home_currency($price, $currency, $date); + } else $price_in_home_currency = $price; $sql = "SELECT material_cost FROM ".TB_PREF."stock_master WHERE stock_id=".db_escape($stock_id); $result = db_query($sql); $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; + if ($price > -0.0001 && $price < 0.0001) + return $material_cost; if ($adj_only) $exclude = ST_CUSTDELIVERY; else $exclude = 0; $qoh = get_qoh_on_date($stock_id, null, $date, $exclude); - if ($adj_only) { if ($qoh <= 0) @@ -41,7 +48,12 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, elseif ($qoh + $qty <= 0) $material_cost = 0; else + { + if ($qoh < 0) + $qoh = 0; $material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / ($qoh + $qty); + } + $material_cost = round2($material_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=".db_escape($material_cost)." WHERE stock_id=".db_escape($stock_id); @@ -66,7 +78,6 @@ function add_grn(&$po, $date_, $reference, $location) { /*Update sales_order_details for the new quantity received and the standard cost used for postings to GL and recorded in the stock movements for FIFO/LIFO stocks valuations*/ - //------------------- update average material cost ------------------------------------------ Joe Hunt Mar-03-2008 update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->price, $order_line->receive_qty, $date_); diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index ec3e14a8..1b7d3aaa 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -112,10 +112,15 @@ function get_deliveries_between($stock_id, $from, $to) function get_diff_in_home_currency($supplier, $old_date, $date, $amount1, $amount2) { + $dec = user_price_dec(); + price_decimal_format($amount2, $dec); $currency = get_supplier_currency($supplier); - $amount1 = to_home_currency($amount1, $currency, $old_date); - $amount2 = to_home_currency($amount2, $currency, $date); - return $amount2 - $amount1; + $ex_rate = get_exchange_rate_to_home_currency($currency, $old_date); + $amount1 = $amount1 / $ex_rate; + $ex_rate = get_exchange_rate_to_home_currency($currency, $date_); + $amount2 = $amount2 / $ex_rate; + $diff = $amount2 - $amount1; + return round2($diff, $dec); } //---------------------------------------------------------------------------------------- @@ -207,7 +212,6 @@ function add_supp_invoice($supp_trans, $invoice_no=0) // do not receive as ref b $entered_grn->this_quantity_inv = -$entered_grn->this_quantity_inv; set_grn_item_credited($entered_grn, $supp_trans->supplier_id, $invoice_id, $date_); } - $line_taxfree = $entered_grn->taxfree_charge_price($supp_trans->tax_group_id); $line_tax = $entered_grn->full_charge_price($supp_trans->tax_group_id) - $line_taxfree; $stock_gl_code = get_stock_gl_code($entered_grn->item_code); diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index 483f5672..88727e80 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -187,7 +187,8 @@ function set_document_parent($cart) if (count($cart->src_docs) == 1) { // if this child document has only one parent - update child link - $del_no = reset(array_keys($cart->src_docs)); + $src = array_keys($cart->src_docs); + $del_no = reset($src); $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no . ' WHERE type='.db_escape($cart->trans_type).' AND trans_no='. $inv_no ; diff --git a/sales/manage/sales_points.php b/sales/manage/sales_points.php index b3947548..4ac75900 100644 --- a/sales/manage/sales_points.php +++ b/sales/manage/sales_points.php @@ -64,7 +64,7 @@ if ($Mode=='UPDATE_ITEM' && can_process()) if ($Mode == 'Delete') { - if (key_in_foreign_table($selected_id, 'users', 'print_profile')) + if (key_in_foreign_table($selected_id, 'users', 'pos')) { display_error(_("Cannot delete this POS because it is used in users setup.")); } else { @@ -140,7 +140,6 @@ if($cash) { cash_accounts_list_row(_("Default cash account").':', 'account'); } else { hidden('credit', 1); - hidden('cash', 0); hidden('account', 0); } diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 372265e3..46e2248c 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -402,7 +402,6 @@ CREATE TABLE `0_company` ( PRIMARY KEY (`coy_code`) ) TYPE=MyISAM ; - ### Data of table `0_company` ### INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1200', '5060', '2100', '5690', '4450', '9990', '3590', '4430', '4010', '4510', '4500', '1510', '5010', '5040', '4010', '1530', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '1', '0', '0', '', '1', '2.2', '0', '-1', '1', '600'); @@ -1629,7 +1628,7 @@ CREATE TABLE `0_tax_types` ( `purchasing_gl_code` varchar(11) NOT NULL default '', `name` varchar(60) NOT NULL default '', `inactive` tinyint(1) NOT NULL default '0', - PRIMARY KEY (`id`), + PRIMARY KEY (`id`) ) TYPE=InnoDB AUTO_INCREMENT=2 ; diff --git a/taxes/item_tax_types.php b/taxes/item_tax_types.php index 7e3dfce6..549b7fc0 100644 --- a/taxes/item_tax_types.php +++ b/taxes/item_tax_types.php @@ -146,7 +146,7 @@ if ($selected_id != -1) { if ($Mode == 'Edit') { $myrow = get_item_tax_type($selected_id); - + unset($_POST); // clear exemption checkboxes $_POST['name'] = $myrow["name"]; $_POST['exempt'] = $myrow["exempt"]; diff --git a/update.html b/update.html index 8dc71bdb..2f6a2adb 100644 --- a/update.html +++ b/update.html @@ -18,7 +18,7 @@ these files.
  • Upload all the new files. -
  • Look into the file, config.default.php and compare with your own config.php file. You should update the the following in your config.php:

    • Change the $version in your config.php file, about line 59, from "2.X.X" to "2.2.3".
    • Copy these 2 lines from config.default.php at the bottom into config.php at the bottom:

      /* allow using of multi level sub-types when digits are of same length in account types */

      $use_new_account_types = 0;
      Change this to 1 if you want to use new multi level sup-types.
    • If this is an update from "2.2.X" to "2.2.3" you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php about line 80-82 into config.php about line 80:

      /* Show users online discretetely in the footer */
      $show_users_online = 0;
      Change this to 1 if you want to show users online.
    • Replace the 2 lines about line 110-111 in config.php:

      $table_style     = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
    • With these 4 lines from config.default.php:

      if (!isset($_SESSION['bordercolor']))
          $_SESSION['bordercolor'] = "#8cacbb";
      $table_style     = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";
    • Remove these 2 lines from config.php about line 176-177:

      /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
      $def_app = "orders";
    • Copy these 3 lines from config.default.php about line 113-115

      // defalt dateformats and dateseps indexes used before user login

      $dflt_date_fmt = 0;
      $dflt_date_sep = 0;
    • Copy these 2 lines from config.default.php about line 211-212:

      define("ICON_SUBMIT", "ok.gif");        // new in 2.2
      define("ICON_ESCAPE", "escape.png");    // new in 2.2
    • And paste them into config.php about line 209
    • If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday
      then you  should  set this line in config.php about line  95.
      $date_system = 3;
    • If you want to use FrontAccounting help wiki then set this line in config.php about line 85
      $help_base_url = "http://frontaccounting.net/fawiki?n=Help.";
  • Rename or remove the /install folder (you have already performed the install +
  • Look into the file, config.default.php and compare with your own config.php file. You should update the the following in your config.php:

    • Change the $version in your config.php file, about line 59, from "2.X.X" to "2.2.4".
    • If this is an update from 2.2.3 to 2.2.4  you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php at the bottom into config.php at the bottom:

      /* allow using of multi level sub-types when digits are of same length in account types */

      $use_new_account_types = 0;
      Change this to 1 if you want to use new multi level sup-types.
    • If this is an update from "2.2.X" to "2.2.3" you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php about line 80-82 into config.php about line 80:

      /* Show users online discretetely in the footer */
      $show_users_online = 0;
      Change this to 1 if you want to show users online.
    • Replace the 2 lines about line 110-111 in config.php:

      $table_style     = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
    • With these 4 lines from config.default.php:

      if (!isset($_SESSION['bordercolor']))
          $_SESSION['bordercolor'] = "#8cacbb";
      $table_style     = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";
    • Remove these 2 lines from config.php about line 176-177:

      /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
      $def_app = "orders";
    • Copy these 3 lines from config.default.php about line 113-115

      // defalt dateformats and dateseps indexes used before user login

      $dflt_date_fmt = 0;
      $dflt_date_sep = 0;
    • Copy these 2 lines from config.default.php about line 211-212:

      define("ICON_SUBMIT", "ok.gif");        // new in 2.2
      define("ICON_ESCAPE", "escape.png");    // new in 2.2
    • And paste them into config.php about line 209
    • If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday
      then you  should  set this line in config.php about line  95.
      $date_system = 3;
    • If you want to use FrontAccounting help wiki then set this line in config.php about line 85
      $help_base_url = "http://frontaccounting.net/fawiki?n=Help.";
  • Rename or remove the /install folder (you have already performed the install process earlier).