4 // ----------------------------------------------------------------
8 // Title: List of Journal Entries
9 // ----------------------------------------------------------------
12 include_once($path_to_root . "includes/session.inc");
13 include_once($path_to_root . "includes/date_functions.inc");
14 include_once($path_to_root . "includes/data_checks.inc");
15 include_once($path_to_root . "gl/includes/gl_db.inc");
16 include_once($path_to_root . "includes/ui/ui_view.inc");
18 //----------------------------------------------------------------------------------------------------
20 // trial_inquiry_controls();
21 print_list_of_journal_entries();
23 //----------------------------------------------------------------------------------------------------
25 function print_list_of_journal_entries()
29 include_once($path_to_root . "reporting/includes/pdf_report.inc");
31 $from = $_POST['PARAM_0'];
32 $to = $_POST['PARAM_1'];
33 $systype = $_POST['PARAM_2'];
34 $comments = $_POST['PARAM_3'];
35 $dec = user_price_dec();
37 $cols = array(0, 100, 240, 300, 400, 460, 520, 580);
39 $headers = array(_('Type/Account'), _('Account Name'), _('Date/Dim.'),
40 _('Person/Item/Memo'), _('Debit'), _('Credit'));
42 $aligns = array('left', 'left', 'left', 'left', 'right', 'right');
44 $params = array( 0 => $comments,
45 1 => array('text' => _('Period'), 'from' => $from,'to' => $to),
46 2 => array('text' => _('Type'), 'from' => systypes::name($systype),
49 $rep = new FrontReport(_('List of Journal Entries'), "JournalEntries.pdf", user_pagesize());
52 $rep->Info($params, $cols, $headers, $aligns);
58 $trans = get_gl_transactions($from, $to, -1, null, 0, 0, $systype);
61 while ($myrow=db_fetch($trans))
63 if ($typeno != $myrow['type_no'])
67 $rep->Line($rep->row + 4);
70 $typeno = $myrow['type_no'];
71 $TransName = systypes::name($myrow['type']);
72 $rep->TextCol(0, 2, $TransName . " # " . $myrow['type_no']);
73 $rep->TextCol(2, 3, sql2date($myrow['tran_date']));
74 $coms = payment_person_types::person_name($myrow["person_type_id"],$myrow["person_id"]);
75 $memo = get_comments_string($myrow['type'], $myrow['type_no']);
77 $coms .= ($coms!= "")?"/":"" . $memo;
78 $rep->TextCol(3, 6, $coms);
81 $rep->TextCol(0, 1, $myrow['account']);
82 $rep->TextCol(1, 2, $myrow['account_name']);
83 $dim_str = get_dimension_string($myrow['dimension_id']);
84 $dim_str2 = get_dimension_string($myrow['dimension2_id']);
86 $dim_str .= "/".$dim_str2;
87 $rep->TextCol(2, 3, $dim_str);
88 $rep->TextCol(3, 4, $myrow['memo_']);
89 if ($myrow['amount'] > 0.0)
90 $rep->TextCol(4, 5, number_format2(abs($myrow['amount']), $dec));
92 $rep->TextCol(5, 6, number_format2(abs($myrow['amount']), $dec));
95 $rep->Line($rep->row + 4);