*** empty log message ***
[fa-stable.git] / dimensions / includes / dimensions_ui.inc
1 <?php
2
3 include_once($path_to_root . "/includes/ui.inc");
4
5 //--------------------------------------------------------------------------------------
6
7 function display_dimension_payments($id)
8 {
9         global $path_to_root, $table_style;
10
11     $result = get_bank_trans(null, null, payment_person_types::dimension(), $id);
12
13     echo "<br>";
14
15     if (db_num_rows($result) == 0)
16     {
17         display_note(_("There are no transactions for this dimension."));
18     }
19     else
20     {
21                 display_heading2(_("Transactions for this Dimension"));
22                 start_table($table_style);
23                 $th = array(_("Type"), _("#"), _("Reference"),
24                         _("Date"), _("Debit"), _("Credit"));
25                 table_header($th);
26
27         $total = $k = 0;
28
29         while ($myrow = db_fetch($result))
30         {
31
32                         alt_table_row_color($k);
33
34                         // projects are always in home currency...get the home equivalent of the banktrans
35                         // from it's gl postings
36                         $home_value = get_gl_trans_value($myrow["bank_act"], $myrow["type"], $myrow["trans_no"]);
37
38                 label_cell(systypes::name($myrow["type"]));
39                         label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"]));
40                         label_cell($myrow["ref"]);
41                         label_cell(sql2date($myrow["trans_date"]));
42                         display_debit_or_credit_cells($home_value);
43
44                         $total += $home_value;
45
46                         end_row();
47                 }
48
49                 start_row();
50                 label_cell(_("Total"), "colspan=4");
51                 display_debit_or_credit_cells($total);
52                 end_row();
53
54                 end_table();
55     }
56 }
57
58 //--------------------------------------------------------------------------------------
59
60 ?>