3 include_once($path_to_root . "/includes/ui.inc");
5 //--------------------------------------------------------------------------------------
7 function display_dimension_payments($id)
9 global $path_to_root, $table_style;
11 $sql = "SELECT * FROM ".TB_PREF."gl_trans WHERE dimension_id = $id OR dimension2_id = $id
12 ORDER BY account,tran_date";
13 $result = db_query($sql, "Transactions could not be calculated");
17 if (db_num_rows($result) == 0)
19 display_note(_("There are no transactions for this dimension."));
23 display_heading2(_("Transactions for this Dimension"));
24 start_table($table_style);
25 $th = array(_("Type"), _("#"), _("Account"),
26 _("Date"), _("Debit"), _("Credit"));
31 while ($myrow = db_fetch($result))
34 alt_table_row_color($k);
36 label_cell(systypes::name($myrow["type"]));
37 label_cell(get_gl_view_str($myrow["type"], $myrow["type_no"], $myrow["type_no"], true));
38 label_cell($myrow["account"]);
39 label_cell(sql2date($myrow["tran_date"]));
40 display_debit_or_credit_cells($myrow["amount"]);
42 $total += $myrow["amount"];
48 label_cell(_("Total"), "colspan=4");
49 display_debit_or_credit_cells($total);
56 //--------------------------------------------------------------------------------------