$_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)
}
$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)
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);
{
echo "<center>";
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 "</center>";
}
}
}
- 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);
//-----------------------------------------------------------------------------------------------
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
'cells' => true,
'select_submit'=> $submit_on_change,
'async' => false,
- 'category' => ($show_group ? 2 : false)
+ 'category' => 2
) );
}
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 "<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";
}
{
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());
}
}
$_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);
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
}
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)
{
}
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++;
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');