Bug 4817: g/l account inquiry can timeout due to slow sql. @Braath Waate.
[fa-stable.git] / reporting / reports_main.php
1 <?php
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 $path_to_root="..";
13 $page_security = 'SA_OPEN';
14 include_once($path_to_root . "/includes/session.inc");
15
16 include_once($path_to_root . "/includes/date_functions.inc");
17 include_once($path_to_root . "/includes/data_checks.inc");
18 include_once($path_to_root . "/includes/ui.inc");
19 include_once($path_to_root . "/reporting/includes/reports_classes.inc");
20 $js = "";
21 if ($SysPrefs->use_popup_windows && $SysPrefs->use_popup_search)
22         $js .= get_js_open_window(900, 500);
23 if (user_use_date_picker())
24         $js .= get_js_date_picker();
25
26 add_js_file('reports.js');
27
28 page(_($help_context = "Reports and Analysis"), false, false, "", $js);
29
30 $reports = new BoxReports;
31
32 $dim = get_company_pref('use_dimension');
33
34 $reports->addReportClass(_('Customer'), RC_CUSTOMER);
35 $reports->addReport(RC_CUSTOMER, 101, _('Customer &Balances'),
36         array(  _('Start Date') => 'DATEBEGIN',
37                         _('End Date') => 'DATEENDM',
38                         _('Customer') => 'CUSTOMERS_NO_FILTER',
39                         _('Show Balance') => 'YES_NO',
40                         _('Currency Filter') => 'CURRENCY',
41                         _('Suppress Zeros') => 'YES_NO',
42                         _('Comments') => 'TEXTBOX',
43                         _('Orientation') => 'ORIENTATION',
44                         _('Destination') => 'DESTINATION'));
45 $reports->addReport(RC_CUSTOMER, 102, _('&Aged Customer Analysis'),
46         array(  _('End Date') => 'DATE',
47                         _('Customer') => 'CUSTOMERS_NO_FILTER',
48                         _('Currency Filter') => 'CURRENCY',
49                         _('Show Also Allocated') => 'YES_NO',
50                         _('Summary Only') => 'YES_NO',
51                         _('Suppress Zeros') => 'YES_NO',
52                         _('Graphics') => 'GRAPHIC',
53                         _('Comments') => 'TEXTBOX',
54                         _('Orientation') => 'ORIENTATION',
55                         _('Destination') => 'DESTINATION'));
56 $reports->addReport(RC_CUSTOMER, 115, _('Customer Trial Balance'),
57     array(  _('Start Date') => 'DATEBEGIN',
58             _('End Date') => 'DATEENDM',
59             _('Customer') => 'CUSTOMERS_NO_FILTER',
60             _('Sales Areas') => 'AREAS',
61             _('Sales Folk') => 'SALESMEN',
62             _('Currency Filter') => 'CURRENCY',
63             _('Suppress Zeros') => 'YES_NO',
64             _('Comments') => 'TEXTBOX',
65             _('Orientation') => 'ORIENTATION',
66             _('Destination') => 'DESTINATION'));
67 $reports->addReport(RC_CUSTOMER, 103, _('Customer &Detail Listing'),
68         array(  _('Activity Since') => 'DATEBEGIN',
69                         _('Sales Areas') => 'AREAS',
70                         _('Sales Folk') => 'SALESMEN',
71                         _('Activity Greater Than') => 'TEXT',
72                         _('Activity Less Than') => 'TEXT',
73                         _('Comments') => 'TEXTBOX',
74                         _('Orientation') => 'ORIENTATION',
75                         _('Destination') => 'DESTINATION'));
76 $reports->addReport(RC_CUSTOMER, 114, _('Sales &Summary Report'),
77         array(  _('Start Date') => 'DATEBEGINTAX',
78                         _('End Date') => 'DATEENDTAX',
79                         _('Tax Id Only') => 'YES_NO',
80                         _('Comments') => 'TEXTBOX',
81                         _('Orientation') => 'ORIENTATION',
82                         _('Destination') => 'DESTINATION'));
83 $reports->addReport(RC_CUSTOMER, 104, _('&Price Listing'),
84         array(  _('Currency Filter') => 'CURRENCY',
85                         _('Inventory Category') => 'CATEGORIES',
86                         _('Sales Types') => 'SALESTYPES',
87                         _('Show Pictures') => 'YES_NO',
88                         _('Show GP %') => 'YES_NO',
89                         _('Comments') => 'TEXTBOX',
90                         _('Orientation') => 'ORIENTATION',
91                         _('Destination') => 'DESTINATION'));
92 $reports->addReport(RC_CUSTOMER, 105, _('&Order Status Listing'),
93         array(  _('Start Date') => 'DATEBEGINM',
94                         _('End Date') => 'DATEENDM',
95                         _('Inventory Category') => 'CATEGORIES',
96                         _('Stock Location') => 'LOCATIONS',
97                         _('Back Orders Only') => 'YES_NO',
98                         _('Comments') => 'TEXTBOX',
99                         _('Orientation') => 'ORIENTATION',
100                         _('Destination') => 'DESTINATION'));
101 $reports->addReport(RC_CUSTOMER, 106, _('&Salesman Listing'),
102         array(  _('Start Date') => 'DATEBEGINM',
103                         _('End Date') => 'DATEENDM',
104                         _('Summary Only') => 'YES_NO',
105                         _('Comments') => 'TEXTBOX',
106                         _('Orientation') => 'ORIENTATION',
107                         _('Destination') => 'DESTINATION'));
108 $reports->addReport(RC_CUSTOMER, 107, _('Print &Invoices'),
109         array(  _('From') => 'INVOICE',
110                         _('To') => 'INVOICE',
111                         _('Currency Filter') => 'CURRENCY',
112                         _('email Customers') => 'YES_NO',
113                         _('Payment Link') => 'PAYMENT_LINK',
114                         _('Comments') => 'TEXTBOX',
115                         _('Customer') => 'CUSTOMERS_NO_FILTER',
116                         _('Orientation') => 'ORIENTATION'
117 ));
118 $reports->addReport(RC_CUSTOMER, 113, _('Print &Credit Notes'),
119         array(  _('From') => 'CREDIT',
120                         _('To') => 'CREDIT',
121                         _('Currency Filter') => 'CURRENCY',
122                         _('email Customers') => 'YES_NO',
123                         _('Payment Link') => 'PAYMENT_LINK',
124                         _('Comments') => 'TEXTBOX',
125                         _('Orientation') => 'ORIENTATION'));
126 $reports->addReport(RC_CUSTOMER, 110, _('Print &Deliveries'),
127         array(  _('From') => 'DELIVERY',
128                         _('To') => 'DELIVERY',
129                         _('email Customers') => 'YES_NO',
130                         _('Print as Packing Slip') => 'YES_NO',
131                         _('Comments') => 'TEXTBOX',
132                         _('Orientation') => 'ORIENTATION'));
133 $reports->addReport(RC_CUSTOMER, 108, _('Print &Statements'),
134         array(  _('Customer') => 'CUSTOMERS_NO_FILTER',
135                         _('Currency Filter') => 'CURRENCY',
136                         _('Show Also Allocated') => 'YES_NO',
137                         _('Email Customers') => 'YES_NO',
138                         _('Comments') => 'TEXTBOX',
139                         _('Orientation') => 'ORIENTATION'));
140 $reports->addReport(RC_CUSTOMER, 109, _('&Print Sales Orders'),
141         array(  _('From') => 'ORDERS',
142                         _('To') => 'ORDERS',
143                         _('Currency Filter') => 'CURRENCY',
144                         _('Email Customers') => 'YES_NO',
145                         _('Print as Quote') => 'YES_NO',
146                         _('Comments') => 'TEXTBOX',
147                         _('Orientation') => 'ORIENTATION'));
148 $reports->addReport(RC_CUSTOMER, 111, _('&Print Sales Quotations'),
149         array(  _('From') => 'QUOTATIONS',
150                         _('To') => 'QUOTATIONS',
151                         _('Currency Filter') => 'CURRENCY',
152                         _('Email Customers') => 'YES_NO',
153                         _('Comments') => 'TEXTBOX',
154                         _('Orientation') => 'ORIENTATION'));
155 $reports->addReport(RC_CUSTOMER, 112, _('Print Receipts'),
156         array(  _('From') => 'RECEIPT',
157                         _('To') => 'RECEIPT',
158                         _('Currency Filter') => 'CURRENCY',
159                         _('Comments') => 'TEXTBOX',
160                         _('Orientation') => 'ORIENTATION'));
161
162 $reports->addReportClass(_('Supplier'), RC_SUPPLIER);
163 $reports->addReport(RC_SUPPLIER, 201, _('Supplier &Balances'),
164         array(  _('Start Date') => 'DATEBEGIN',
165                         _('End Date') => 'DATEENDM',
166                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
167                         _('Show Balance') => 'YES_NO',
168                         _('Currency Filter') => 'CURRENCY',
169                         _('Suppress Zeros') => 'YES_NO',
170                         _('Comments') => 'TEXTBOX',
171                         _('Orientation') => 'ORIENTATION',
172                         _('Destination') => 'DESTINATION'));
173 $reports->addReport(RC_SUPPLIER, 202, _('&Aged Supplier Analyses'),
174         array(  _('End Date') => 'DATE',
175                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
176                         _('Currency Filter') => 'CURRENCY',
177                         _('Show Also Allocated') => 'YES_NO',
178                         _('Summary Only') => 'YES_NO',
179                         _('Suppress Zeros') => 'YES_NO',
180                         _('Graphics') => 'GRAPHIC',
181                         _('Comments') => 'TEXTBOX',
182                         _('Orientation') => 'ORIENTATION',
183                         _('Destination') => 'DESTINATION'));
184 $reports->addReport(RC_SUPPLIER, 206, _('Supplier &Trial Balances'),
185     array(  _('Start Date') => 'DATEBEGIN',
186             _('End Date') => 'DATEENDM',
187             _('Supplier') => 'SUPPLIERS_NO_FILTER',
188             _('Currency Filter') => 'CURRENCY',
189             _('Suppress Zeros') => 'YES_NO',
190             _('Comments') => 'TEXTBOX',
191             _('Orientation') => 'ORIENTATION',
192             _('Destination') => 'DESTINATION'));
193 $reports->addReport(RC_SUPPLIER, 203, _('&Payment Report'),
194         array(  _('End Date') => 'DATE',
195                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
196                         _('Currency Filter') => 'CURRENCY',
197                         _('Suppress Zeros') => 'YES_NO',
198                         _('Comments') => 'TEXTBOX',
199                         _('Orientation') => 'ORIENTATION',
200                         _('Destination') => 'DESTINATION'));
201 $reports->addReport(RC_SUPPLIER, 204, _('Outstanding &GRNs Report'),
202         array(  _('Supplier') => 'SUPPLIERS_NO_FILTER',
203                         _('Comments') => 'TEXTBOX',
204                         _('Orientation') => 'ORIENTATION',
205                         _('Destination') => 'DESTINATION'));
206 $reports->addReport(RC_SUPPLIER, 205, _('Supplier &Detail Listing'),
207         array(  _('Activity Since') => 'DATEBEGIN',
208                         _('Activity Greater Than') => 'TEXT',
209                         _('Activity Less Than') => 'TEXT',
210                         _('Comments') => 'TEXTBOX',
211                         _('Orientation') => 'ORIENTATION',
212                         _('Destination') => 'DESTINATION'));
213 $reports->addReport(RC_SUPPLIER, 209, _('Print Purchase &Orders'),
214         array(  _('From') => 'PO',
215                         _('To') => 'PO',
216                         _('Currency Filter') => 'CURRENCY',
217                         _('Email Suppliers') => 'YES_NO',
218                         _('Comments') => 'TEXTBOX',
219                         _('Orientation') => 'ORIENTATION'));
220 $reports->addReport(RC_SUPPLIER, 210, _('Print Remi&ttances'),
221         array(  _('From') => 'REMITTANCE',
222                         _('To') => 'REMITTANCE',
223                         _('Currency Filter') => 'CURRENCY',
224                         _('Email Suppliers') => 'YES_NO',
225                         _('Comments') => 'TEXTBOX',
226                         _('Orientation') => 'ORIENTATION'));
227
228 $reports->addReportClass(_('Inventory'), RC_INVENTORY);
229 $reports->addReport(RC_INVENTORY,  301, _('Inventory &Valuation Report'),
230         array(  _('End Date') => 'DATE',
231                         _('Inventory Category') => 'CATEGORIES',
232                         _('Location') => 'LOCATIONS',
233                         _('Summary Only') => 'YES_NO',
234                         _('Comments') => 'TEXTBOX',
235                         _('Orientation') => 'ORIENTATION',
236                         _('Destination') => 'DESTINATION'));
237 $reports->addReport(RC_INVENTORY,  302, _('Inventory &Planning Report'),
238         array(  _('Inventory Category') => 'CATEGORIES',
239                         _('Location') => 'LOCATIONS',
240                         _('Comments') => 'TEXTBOX',
241                         _('Orientation') => 'ORIENTATION',
242                         _('Destination') => 'DESTINATION'));
243 $reports->addReport(RC_INVENTORY, 303, _('Stock &Check Sheets'),
244         array(  _('Inventory Category') => 'CATEGORIES',
245                         _('Location') => 'LOCATIONS',
246                         _('Show Pictures') => 'YES_NO',
247                         _('Inventory Column') => 'YES_NO',
248                         _('Show Shortage') => 'YES_NO',
249                         _('Suppress Zeros') => 'YES_NO',
250                         _('Item Like') => 'TEXT',
251                         _('Comments') => 'TEXTBOX',
252                         _('Orientation') => 'ORIENTATION',
253                         _('Destination') => 'DESTINATION'));
254 $reports->addReport(RC_INVENTORY, 304, _('Inventory &Sales Report'),
255         array(  _('Start Date') => 'DATEBEGINM',
256                         _('End Date') => 'DATEENDM',
257                         _('Inventory Category') => 'CATEGORIES',
258                         _('Location') => 'LOCATIONS',
259                         _('Customer') => 'CUSTOMERS_NO_FILTER',
260                         _('Show Service Items') => 'YES_NO',
261                         _('Comments') => 'TEXTBOX',
262                         _('Orientation') => 'ORIENTATION',
263                         _('Destination') => 'DESTINATION'));
264 $reports->addReport(RC_INVENTORY, 305, _('&GRN Valuation Report'),
265         array(  _('Start Date') => 'DATEBEGINM',
266                         _('End Date') => 'DATEENDM',
267                         _('Comments') => 'TEXTBOX',
268                         _('Orientation') => 'ORIENTATION',
269                         _('Destination') => 'DESTINATION'));
270 $reports->addReport(RC_INVENTORY, 306, _('Inventory P&urchasing Report'),
271         array(  _('Start Date') => 'DATEBEGINM',
272                         _('End Date') => 'DATEENDM',
273                         _('Inventory Category') => 'CATEGORIES',
274                         _('Location') => 'LOCATIONS',
275                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
276                         _('Items') => 'ITEMS_P',
277                         _('Comments') => 'TEXTBOX',
278                         _('Orientation') => 'ORIENTATION',
279                         _('Destination') => 'DESTINATION'));
280 $reports->addReport(RC_INVENTORY, 307, _('Inventory &Movement Report'),
281         array(  _('Start Date') => 'DATEBEGINM',
282                         _('End Date') => 'DATEENDM',
283                         _('Inventory Category') => 'CATEGORIES',
284                         _('Location') => 'LOCATIONS',
285                         _('Comments') => 'TEXTBOX',
286                         _('Orientation') => 'ORIENTATION',
287                         _('Destination') => 'DESTINATION'));                            
288 $reports->addReport(RC_INVENTORY, 308, _('C&osted Inventory Movement Report'),
289         array(  _('Start Date') => 'DATEBEGINM',
290                         _('End Date') => 'DATEENDM',
291                         _('Inventory Category') => 'CATEGORIES',
292                         _('Location') => 'LOCATIONS',
293                         _('Comments') => 'TEXTBOX',
294                         _('Orientation') => 'ORIENTATION',
295                         _('Destination') => 'DESTINATION'));                            
296 $reports->addReport(RC_INVENTORY, 309,_('Item &Sales Summary Report'),
297         array(  _('Start Date') => 'DATEBEGINM',
298                         _('End Date') => 'DATEENDM',
299                         _('Inventory Category') => 'CATEGORIES',
300                         _('Comments') => 'TEXTBOX',
301                         _('Orientation') => 'ORIENTATION',
302                         _('Destination') => 'DESTINATION'));                            
303 $reports->addReport(RC_INVENTORY, 310, _('Inventory Purchasing - &Transaction Based'),
304         array(  _('Start Date') => 'DATEBEGINM',
305                         _('End Date') => 'DATEENDM',
306                         _('Inventory Category') => 'CATEGORIES',
307                         _('Location') => 'LOCATIONS',
308                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
309                         _('Items') => 'ITEMS_P',
310                         _('Comments') => 'TEXTBOX',
311                         _('Orientation') => 'ORIENTATION',
312                         _('Destination') => 'DESTINATION'));
313 if (get_company_pref('use_manufacturing'))
314 {
315         $reports->addReportClass(_('Manufacturing'), RC_MANUFACTURE);
316         $reports->addReport(RC_MANUFACTURE, 401, _('&Bill of Material Listing'),
317                 array(  _('From product') => 'ITEMS',
318                                 _('To product') => 'ITEMS',
319                                 _('Comments') => 'TEXTBOX',
320                                 _('Orientation') => 'ORIENTATION',
321                                 _('Destination') => 'DESTINATION'));
322         $reports->addReport(RC_MANUFACTURE, 402, _('Work Order &Listing'),
323                 array(  _('Items') => 'ITEMS_ALL',
324                                 _('Location') => 'LOCATIONS',
325                                 _('Outstanding Only') => 'YES_NO',
326                                 _('Show GL Rows') => 'YES_NO',
327                                 _('Comments') => 'TEXTBOX',
328                                 _('Orientation') => 'ORIENTATION',
329                                 _('Destination') => 'DESTINATION'));
330         $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'),
331                 array(  _('From') => 'WORKORDER',
332                                 _('To') => 'WORKORDER',
333                                 _('Email Locations') => 'YES_NO',
334                                 _('Comments') => 'TEXTBOX',
335                                 _('Orientation') => 'ORIENTATION'));
336 }
337 if (get_company_pref('use_fixed_assets'))
338 {
339         $reports->addReportClass(_('Fixed Assets'), RC_FIXEDASSETS);
340         $reports->addReport(RC_FIXEDASSETS, 451, _('&Fixed Assets Valuation'),
341                 array(  _('End Date') => 'DATE',
342                                 _('Fixed Assets Class') => 'FCLASS',
343                                 _('Fixed Assets Location') => 'FLOCATIONS',
344                                 _('Summary Only') => 'YES_NO',
345                                 _('Comments') => 'TEXTBOX',
346                                 _('Orientation') => 'ORIENTATION',
347                                 _('Destination') => 'DESTINATION'));
348 }                               
349 $reports->addReportClass(_('Dimensions'), RC_DIMENSIONS);
350 if ($dim > 0)
351 {
352         $reports->addReport(RC_DIMENSIONS, 501, _('Dimension &Summary'),
353         array(  _('From Dimension') => 'DIMENSION',
354                         _('To Dimension') => 'DIMENSION',
355                         _('Show Balance') => 'YES_NO',
356                         _('Comments') => 'TEXTBOX',
357                         _('Orientation') => 'ORIENTATION',
358                         _('Destination') => 'DESTINATION'));
359 }
360 $reports->addReportClass(_('Banking'), RC_BANKING);
361         $reports->addReport(RC_BANKING,  601, _('Bank &Statement'),
362         array(  _('Bank Accounts') => 'BANK_ACCOUNTS',
363                         _('Start Date') => 'DATEBEGINM',
364                         _('End Date') => 'DATEENDM',
365                         _('Zero values') => 'YES_NO',
366                         _('Comments') => 'TEXTBOX',
367                         _('Orientation') => 'ORIENTATION',
368                         _('Destination') => 'DESTINATION'));
369         $reports->addReport(RC_BANKING,  602, _('Bank Statement w/ &Reconcile'),
370         array(  _('Bank Accounts') => 'BANK_ACCOUNTS',
371                         _('Start Date') => 'DATEBEGINM',
372                         _('End Date') => 'DATEENDM',
373                         _('Comments') => 'TEXTBOX',
374                         _('Destination') => 'DESTINATION'));
375
376 $reports->addReportClass(_('General Ledger'), RC_GL);
377 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),
378         array(  _('Show Balances') => 'YES_NO',
379                         _('Comments') => 'TEXTBOX',
380                         _('Orientation') => 'ORIENTATION',
381                         _('Destination') => 'DESTINATION'));
382 $reports->addReport(RC_GL, 702, _('List of &Journal Entries'),
383         array(  _('Start Date') => 'DATEBEGINM',
384                         _('End Date') => 'DATEENDM',
385                         _('Type') => 'SYS_TYPES',
386                         _('Comments') => 'TEXTBOX',
387                         _('Orientation') => 'ORIENTATION',
388                         _('Destination') => 'DESTINATION'));
389
390 if ($dim == 2)
391 {
392         $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
393         array(  _('Start Date') => 'DATEBEGINM',
394                         _('End Date') => 'DATEENDM',
395                         _('From Account') => 'GL_ACCOUNTS',
396                         _('To Account') => 'GL_ACCOUNTS',
397                         _('Dimension')." 1" =>  'DIMENSIONS1',
398                         _('Dimension')." 2" =>  'DIMENSIONS2',
399                         _('Comments') => 'TEXTBOX',
400                         _('Orientation') => 'ORIENTATION',
401                         _('Destination') => 'DESTINATION'));
402         $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
403         array(  _('Year') => 'TRANS_YEARS',
404                         _('Dimension')." 1" =>  'DIMENSIONS1',
405                         _('Dimension')." 2" =>  'DIMENSIONS2',
406                         _('Account Tags') =>  'ACCOUNTTAGS',
407                         _('Comments') => 'TEXTBOX',
408                         _('Orientation') => 'ORIENTATION',
409                         _('Destination') => 'DESTINATION'));
410         $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
411         array(  _('Start Date') => 'DATEBEGIN',
412                         _('End Date') => 'DATEENDM',
413                         _('Dimension')." 1" => 'DIMENSIONS1',
414                         _('Dimension')." 2" => 'DIMENSIONS2',
415                         _('Account Tags') =>  'ACCOUNTTAGS',
416                         _('Decimal values') => 'YES_NO',
417                         _('Graphics') => 'GRAPHIC',
418                         _('Comments') => 'TEXTBOX',
419                         _('Orientation') => 'ORIENTATION',
420                         _('Destination') => 'DESTINATION'));
421         $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
422         array(  _('Start Date') => 'DATEBEGINM',
423                         _('End Date') => 'DATEENDM',
424                         _('Compare to') => 'COMPARE',
425                         _('Dimension')." 1" =>  'DIMENSIONS1',
426                         _('Dimension')." 2" =>  'DIMENSIONS2',
427                         _('Account Tags') =>  'ACCOUNTTAGS',
428                         _('Decimal values') => 'YES_NO',
429                         _('Graphics') => 'GRAPHIC',
430                         _('Comments') => 'TEXTBOX',
431                         _('Orientation') => 'ORIENTATION',
432                         _('Destination') => 'DESTINATION'));
433         $reports->addReport(RC_GL, 708, _('Trial &Balance'),
434         array(  _('Start Date') => 'DATEBEGINM',
435                         _('End Date') => 'DATEENDM',
436                         _('Zero values') => 'YES_NO',
437                         _('Only balances') => 'YES_NO',
438                         _('Dimension')." 1" =>  'DIMENSIONS1',
439                         _('Dimension')." 2" =>  'DIMENSIONS2',
440                         _('Comments') => 'TEXTBOX',
441                         _('Orientation') => 'ORIENTATION',
442                         _('Destination') => 'DESTINATION'));
443 }
444 elseif ($dim == 1)
445 {
446         $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
447         array(  _('Start Date') => 'DATEBEGINM',
448                         _('End Date') => 'DATEENDM',
449                         _('From Account') => 'GL_ACCOUNTS',
450                         _('To Account') => 'GL_ACCOUNTS',
451                         _('Dimension') =>  'DIMENSIONS1',
452                         _('Comments') => 'TEXTBOX',
453                         _('Orientation') => 'ORIENTATION',
454                         _('Destination') => 'DESTINATION'));
455         $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
456         array(  _('Year') => 'TRANS_YEARS',
457                         _('Dimension') =>  'DIMENSIONS1',
458                         _('Account Tags') =>  'ACCOUNTTAGS',
459                         _('Comments') => 'TEXTBOX',
460                         _('Orientation') => 'ORIENTATION',
461                         _('Destination') => 'DESTINATION'));
462         $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
463         array(  _('Start Date') => 'DATEBEGIN',
464                         _('End Date') => 'DATEENDM',
465                         _('Dimension') => 'DIMENSIONS1',
466                         _('Account Tags') =>  'ACCOUNTTAGS',
467                         _('Decimal values') => 'YES_NO',
468                         _('Graphics') => 'GRAPHIC',
469                         _('Comments') => 'TEXTBOX',
470                         _('Orientation') => 'ORIENTATION',
471                         _('Destination') => 'DESTINATION'));
472         $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
473         array(  _('Start Date') => 'DATEBEGINM',
474                         _('End Date') => 'DATEENDM',
475                         _('Compare to') => 'COMPARE',
476                         _('Dimension') => 'DIMENSIONS1',
477                         _('Account Tags') =>  'ACCOUNTTAGS',
478                         _('Decimal values') => 'YES_NO',
479                         _('Graphics') => 'GRAPHIC',
480                         _('Comments') => 'TEXTBOX',
481                         _('Orientation') => 'ORIENTATION',
482                         _('Destination') => 'DESTINATION'));
483         $reports->addReport(RC_GL, 708, _('Trial &Balance'),
484         array(  _('Start Date') => 'DATEBEGINM',
485                         _('End Date') => 'DATEENDM',
486                         _('Zero values') => 'YES_NO',
487                         _('Only balances') => 'YES_NO',
488                         _('Dimension') => 'DIMENSIONS1',
489                         _('Comments') => 'TEXTBOX',
490                         _('Orientation') => 'ORIENTATION',
491                         _('Destination') => 'DESTINATION'));
492 }
493 else
494 {
495         $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
496         array(  _('Start Date') => 'DATEBEGINM',
497                         _('End Date') => 'DATEENDM',
498                         _('From Account') => 'GL_ACCOUNTS',
499                         _('To Account') => 'GL_ACCOUNTS',
500                         _('Comments') => 'TEXTBOX',
501                         _('Orientation') => 'ORIENTATION',
502                         _('Destination') => 'DESTINATION'));
503         $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
504         array(  _('Year') => 'TRANS_YEARS',
505                         _('Account Tags') =>  'ACCOUNTTAGS',
506                         _('Comments') => 'TEXTBOX',
507                         _('Orientation') => 'ORIENTATION',
508                         _('Destination') => 'DESTINATION'));
509         $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
510         array(  _('Start Date') => 'DATEBEGIN',
511                         _('End Date') => 'DATEENDM',
512                         _('Account Tags') =>  'ACCOUNTTAGS',
513                         _('Decimal values') => 'YES_NO',
514                         _('Graphics') => 'GRAPHIC',
515                         _('Comments') => 'TEXTBOX',
516                         _('Orientation') => 'ORIENTATION',
517                         _('Destination') => 'DESTINATION'));
518         $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
519         array(  _('Start Date') => 'DATEBEGINM',
520                         _('End Date') => 'DATEENDM',
521                         _('Compare to') => 'COMPARE',
522                         _('Account Tags') =>  'ACCOUNTTAGS',
523                         _('Decimal values') => 'YES_NO',
524                         _('Graphics') => 'GRAPHIC',
525                         _('Comments') => 'TEXTBOX',
526                         _('Orientation') => 'ORIENTATION',
527                         _('Destination') => 'DESTINATION'));
528         $reports->addReport(RC_GL, 708, _('Trial &Balance'),
529         array(  _('Start Date') => 'DATEBEGINM',
530                         _('End Date') => 'DATEENDM',
531                         _('Zero values') => 'YES_NO',
532                         _('Only balances') => 'YES_NO',
533                         _('Comments') => 'TEXTBOX',
534                         _('Orientation') => 'ORIENTATION',
535                         _('Destination') => 'DESTINATION'));
536 }
537 $reports->addReport(RC_GL, 709, _('Ta&x Report'),
538         array(  _('Start Date') => 'DATEBEGINTAX',
539                         _('End Date') => 'DATEENDTAX',
540                         _('Summary Only') => 'YES_NO',
541                         _('Comments') => 'TEXTBOX',
542                         _('Orientation') => 'ORIENTATION',
543                         _('Destination') => 'DESTINATION'));
544 $reports->addReport(RC_GL, 710, _('Audit Trail'),
545         array(  _('Start Date') => 'DATEBEGINM',
546                         _('End Date') => 'DATEENDM',
547                         _('Type') => 'SYS_TYPES_ALL',
548                         _('User') => 'USERS',
549                         _('Comments') => 'TEXTBOX',
550                         _('Orientation') => 'ORIENTATION',
551                         _('Destination') => 'DESTINATION'));
552
553 add_custom_reports($reports);
554
555 echo $reports->getDisplay();
556
557 end_page();