GL acounts in seletors always grouped by type.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 8 Dec 2008 16:16:42 +0000 (16:16 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 8 Dec 2008 16:16:42 +0000 (16:16 +0000)
gl/includes/ui/gl_bank_ui.inc
gl/includes/ui/gl_journal_ui.inc
gl/manage/bank_accounts.php
gl/manage/gl_accounts.php
gl/manage/gl_quick_entries.php
includes/ui/ui_lists.inc
purchasing/includes/ui/invoice_ui.inc
sales/manage/customer_branches.php

index cf44945ea6226cdf0e12e6a7026871575e8ee84a..5f95c3dfa63dd10b6de3c74393905d4c17f69b0c 100644 (file)
@@ -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)
index 0f39203bd9708157ceca236ba78b239229ccd8a4..bae82d3b511805b73fc5f6f16cc03f51ed443ffb 100644 (file)
@@ -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)
index a3a59b3eb45a14563428c38dd87ee2b4a9209b88..54a7a61066237223056c88edea75f1a7939d1fae 100644 (file)
@@ -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);
index 2520d355cfd7e43038e023123e378dfa4bc07bcf..5c88705d83c8f9bcd0c7943eccf725d62d775449 100644 (file)
@@ -198,7 +198,7 @@ if (db_has_gl_accounts())
 {
        echo "<center>";
     echo _("Select an Account:") . "&nbsp;";
-    gl_all_accounts_list('AccountList', null, false, false, false,
+    gl_all_accounts_list('AccountList', null, false, false,
                _('New account'), true);
     echo "</center>";
 }
index fae60668a55553564b21f80487abc4b8aa85b987..323580a777c497c82fe681c2df10a7effc653b0f 100644 (file)
@@ -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);
index 9c8cb2d6f22d48a6605063fd152e925cb967dd19..7b8f503e4f8cd912875c3b703b37a5b3e7910db5 100644 (file)
@@ -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] .  "&nbsp;&nbsp;&nbsp;&nbsp;" . $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 "<td>$label</td>\n";
        echo "<td>";
-       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 "</td>\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 "<tr>\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 "</tr>\n";
 }
 
index 07f0d0e9bb78ba62a7a9df9b32be1844252a2b08..d0bd3fa65226334b9a8981283ab010251d84648f 100644 (file)
@@ -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++;
index 7401941b87d77b2950901379c3ab66cf0531c4bb..844e92170e414eaf1b1793a7405a25861234c8aa 100644 (file)
@@ -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');