New files from unstable branch
[fa-stable.git] / dimensions / includes / dimensions_ui.inc
index 6ac85524fa968a2f25af1bca1ec5f37b0d94cf2f..925d0313137c67c3ef8c8d063fc0792652e34066 100644 (file)
@@ -15,16 +15,9 @@ include_once($path_to_root . "/includes/ui.inc");
 
 function display_dimension_balance($id, $from, $to)
 {
-       global $path_to_root, $table_style;
+       global $path_to_root;
 
-       $from = date2sql($from);
-       $to = date2sql($to);
-       $sql = "SELECT account, ".TB_PREF."chart_master.account_name, sum(amount) AS amt FROM
-               ".TB_PREF."gl_trans,".TB_PREF."chart_master WHERE
-               ".TB_PREF."gl_trans.account = ".TB_PREF."chart_master.account_code AND
-               (dimension_id = $id OR dimension2_id = $id) AND
-               tran_date >= '$from' AND tran_date <= '$to' GROUP BY account";
-       $result = db_query($sql, "Transactions could not be calculated");
+       $result = get_dimension_balance_all($id, $from, $to);
 
     if (db_num_rows($result) == 0)
     {
@@ -34,7 +27,7 @@ function display_dimension_balance($id, $from, $to)
     {
                display_heading2(_("Balance for this Dimension"));
                br();
-               start_table($table_style);
+               start_table(TABLESTYLE);
                $th = array(_("Account"), _("Debit"), _("Credit"));
                table_header($th);