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 ".TB_PREF."gl_trans.*,".TB_PREF."chart_master.account_name FROM
12 ".TB_PREF."gl_trans,".TB_PREF."chart_master WHERE
13 ".TB_PREF."gl_trans.account = ".TB_PREF."chart_master.account_code AND
14 (dimension_id = $id OR dimension2_id = $id) ORDER BY account,tran_date";
15 $result = db_query($sql, "Transactions could not be calculated");
19 if (db_num_rows($result) == 0)
21 display_note(_("There are no transactions for this dimension."));
25 display_heading2(_("Transactions for this Dimension"));
26 start_table($table_style);
27 $th = array(_("Type"), _("#"), _("Account"),
28 _("Date"), _("Debit"), _("Credit"));
31 $total = $grand_total = $k = 0;
33 while ($myrow = db_fetch($result))
35 if ($account != $myrow["account"])
40 label_cell(_("Total"), "colspan=4");
41 display_debit_or_credit_cells($total);
45 $account = $myrow["account"];
48 alt_table_row_color($k);
50 label_cell(systypes::name($myrow["type"]));
51 label_cell(get_gl_view_str($myrow["type"], $myrow["type_no"], $myrow["type_no"], true));
52 label_cell($myrow["account"]." ".$myrow['account_name']);
53 label_cell(sql2date($myrow["tran_date"]));
54 display_debit_or_credit_cells($myrow["amount"]);
56 $total += $myrow["amount"];
57 $grand_total += $myrow["amount"];
62 label_cell(_("Total"), "colspan=4");
63 display_debit_or_credit_cells($total);
67 label_cell(_("Grand Total"), "colspan=4");
68 display_debit_or_credit_cells($grand_total);
75 //--------------------------------------------------------------------------------------