2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 include_once($path_to_root . "/includes/ui.inc");
14 //--------------------------------------------------------------------------------------
16 function display_dimension_balance($id, $from, $to)
20 $result = get_dimension_balance_all($id, $from, $to);
22 if (db_num_rows($result) == 0)
24 display_note(_("There are no transactions for this dimension for the selected period."));
28 display_heading2(_("Balance for this Dimension"));
30 start_table(TABLESTYLE);
31 $th = array(_("Account"), _("Debit"), _("Credit"));
35 while ($myrow = db_fetch($result))
37 alt_table_row_color($k);
39 label_cell($myrow["account"]." ".$myrow['account_name']);
40 display_debit_or_credit_cells($myrow["amt"]);
41 $total += $myrow["amt"];
45 label_cell("<b>"._("Balance")."</b>");
48 amount_cell($total, true);
54 amount_cell(abs($total), true);
62 //--------------------------------------------------------------------------------------