From: Janusz Dobrowolski Date: Mon, 8 Dec 2008 16:16:42 +0000 (+0000) Subject: GL acounts in seletors always grouped by type. X-Git-Tag: v2.4.2~19^2~1687 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=fbb7a3d6150e02e442bd763a717915649fb43437;p=fa-stable.git GL acounts in seletors always grouped by type. --- diff --git a/gl/includes/ui/gl_bank_ui.inc b/gl/includes/ui/gl_bank_ui.inc index cf44945e..5f95c3df 100644 --- a/gl/includes/ui/gl_bank_ui.inc +++ b/gl/includes/ui/gl_bank_ui.inc @@ -222,7 +222,7 @@ function gl_edit_item_controls(&$order, $dim, $Index=null) $_POST['code_id'] = get_company_pref($payment ? 'default_cogs_act':'default_inv_sales_act'); } - gl_all_accounts_list('code_id', null, false, false, true); + gl_all_accounts_list('code_id', null, false, true); if ($dim >= 1) dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1); if ($dim > 1) diff --git a/gl/includes/ui/gl_journal_ui.inc b/gl/includes/ui/gl_journal_ui.inc index 0f39203b..bae82d3b 100644 --- a/gl/includes/ui/gl_journal_ui.inc +++ b/gl/includes/ui/gl_journal_ui.inc @@ -180,7 +180,7 @@ function gl_edit_item_controls(&$order, $dim, $Index=null) } $skip_bank = ($_SESSION["wa_current_user"]->access != 2); - gl_all_accounts_list('code_id', null, $skip_bank, false, true); + gl_all_accounts_list('code_id', null, $skip_bank, true); if ($dim >= 1) dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1); if ($dim > 1) diff --git a/gl/manage/bank_accounts.php b/gl/manage/bank_accounts.php index a3a59b3e..54a7a610 100644 --- a/gl/manage/bank_accounts.php +++ b/gl/manage/bank_accounts.php @@ -176,7 +176,7 @@ else if($is_editing) label_row(_("Bank Account GL Code:"), $_POST['account_code']); else - gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null, false); + gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null); text_row(_("Bank Name:"), 'bank_name', null, 50, 60); text_row(_("Bank Account Number:"), 'bank_account_number', null, 30, 60); diff --git a/gl/manage/gl_accounts.php b/gl/manage/gl_accounts.php index 2520d355..5c88705d 100644 --- a/gl/manage/gl_accounts.php +++ b/gl/manage/gl_accounts.php @@ -198,7 +198,7 @@ if (db_has_gl_accounts()) { echo "
"; echo _("Select an Account:") . " "; - gl_all_accounts_list('AccountList', null, false, false, false, + gl_all_accounts_list('AccountList', null, false, false, _('New account'), true); echo "
"; } diff --git a/gl/manage/gl_quick_entries.php b/gl/manage/gl_quick_entries.php index fae60668..323580a7 100644 --- a/gl/manage/gl_quick_entries.php +++ b/gl/manage/gl_quick_entries.php @@ -268,7 +268,7 @@ if ($selected_id != -1) } } - gl_all_accounts_list_row(_("Account"), 'account', null, true); + gl_all_accounts_list_row(_("Account"), 'account', null); yesno_list_row(_("Use Tax:"), 'tax_acc', null, "", "", false); yesno_list_row(_("Use Percent:"), 'pct', null, "", "", false); amount_row(_("Amount"), 'amount', null); diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 9c8cb2d6..7b8f503e 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1518,7 +1518,7 @@ function gl_account_types_list_row($label, $name, $selected_id=null, $all_option //----------------------------------------------------------------------------------------------- function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=false, - $show_group=true, $cells=false, $all_option=false, $submit_on_change=false) + $cells=false, $all_option=false, $submit_on_change=false) { if ($skip_bank_accounts) $sql = "SELECT chart.account_code, chart.account_name, type.name @@ -1545,7 +1545,7 @@ function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=fals 'cells' => true, 'select_submit'=> $submit_on_change, 'async' => false, - 'category' => ($show_group ? 2 : false) + 'category' => 2 ) ); } @@ -1555,22 +1555,23 @@ function _format_account($row) return $row[0] . "    " . $row[1]; } -function gl_all_accounts_list_cells($label, $name, $selected_id=null, $skip_bank_accounts=false, - $show_group=false, $cells=false, $all_option=false) +function gl_all_accounts_list_cells($label, $name, $selected_id=null, + $skip_bank_accounts=false, $cells=false, $all_option=false) { if ($label != null) echo "$label\n"; echo ""; - gl_all_accounts_list($name, $selected_id, $skip_bank_accounts, $show_group, $cells, $all_option); + gl_all_accounts_list($name, $selected_id, + $skip_bank_accounts, $cells, $all_option); echo "\n"; } -function gl_all_accounts_list_row($label, $name, $selected_id=null, $skip_bank_accounts=false, - $show_group=false, $cells=false, $all_option=false) +function gl_all_accounts_list_row($label, $name, $selected_id=null, + $skip_bank_accounts=false, $cells=false, $all_option=false) { echo "\n"; - gl_all_accounts_list_cells($label, $name, $selected_id, $skip_bank_accounts, - $show_group, $cells, $all_option); + gl_all_accounts_list_cells($label, $name, $selected_id, + $skip_bank_accounts, $cells, $all_option); echo "\n"; } diff --git a/purchasing/includes/ui/invoice_ui.inc b/purchasing/includes/ui/invoice_ui.inc index 07f0d0e9..d0bd3fa6 100644 --- a/purchasing/includes/ui/invoice_ui.inc +++ b/purchasing/includes/ui/invoice_ui.inc @@ -36,7 +36,7 @@ function copy_to_trans(&$supp_trans) { foreach ( $supp_trans->grn_items as $grn) { - $supp_trans->ov_amount += round(($grn->this_quantity_inv * $grn->chg_price), + $supp_trans->ov_amount += round2(($grn->this_quantity_inv * $grn->chg_price), user_price_dec()); } } @@ -154,7 +154,7 @@ function display_gl_controls(&$supp_trans, $k) $_POST['gl_code'] = $accs['purchase_account']; alt_table_row_color($k); - gl_all_accounts_list('gl_code', null, true, false, true); + gl_all_accounts_list('gl_code', null, true, true); $dim = get_company_pref('use_dimension'); if ($dim >= 1) dimensions_list_cells(null, 'dimension_id', null, true, " ", false, 1); @@ -331,9 +331,9 @@ function display_grn_items_for_selection(&$supp_trans, $k) null, null, $dec); amount_cells(null, 'ChgPrice'.$n, price_format($myrow["unit_price"])); if ($supp_trans->is_invoice) - amount_cell(round($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec())); + amount_cell(round2($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec())); else - amount_cell(round($myrow["unit_price"] * max($myrow['quantity_inv'], 0), user_price_dec())); + amount_cell(round2($myrow["unit_price"] * max($myrow['quantity_inv'], 0), user_price_dec())); if ($supp_trans->is_invoice) submit_cells('grn_item_id'.$n, _("Add"), '', _("Add to Invoice"), true); else @@ -449,7 +449,7 @@ function display_grn_items(&$supp_trans, $mode=0) } qty_cell(abs($entered_grn->this_quantity_inv), true, $dec); amount_cell($entered_grn->chg_price); - amount_cell( round($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), user_price_dec()), true); + amount_cell( round2($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), user_price_dec()), true); if ($mode == 1) { @@ -459,7 +459,7 @@ function display_grn_items(&$supp_trans, $mode=0) } end_row(); - $total_grn_value += round($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), + $total_grn_value += round2($entered_grn->chg_price * abs($entered_grn->this_quantity_inv), user_price_dec()); $i++; diff --git a/sales/manage/customer_branches.php b/sales/manage/customer_branches.php index 7401941b..844e9217 100644 --- a/sales/manage/customer_branches.php +++ b/sales/manage/customer_branches.php @@ -321,7 +321,7 @@ table_section(2); table_section_title(_("GL Accounts")); // 2006-06-14. Changed gl_al_accounts_list to have an optional all_option 'Use Item Sales Accounts' -gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', null, false, false, false, true); +gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', null, false, false, true); gl_all_accounts_list_row(_("Sales Discount Account:"), 'sales_discount_account');