Added a selector for decimal values in Balance Sheet and P/L Statement
[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 ($use_date_picker)
22         $js .= get_js_date_picker();
23 page(_($help_context = "Reports and Analysis"), false, false, "", $js);
24
25 $reports = new BoxReports;
26
27 $dim = get_company_pref('use_dimension');
28
29 $reports->addReportClass(_('Customer'));
30 $reports->addReport(_('Customer'),101,_('Customer &Balances'),
31         array(  _('Start Date') => 'DATEBEGIN',
32                         _('End Date') => 'DATEENDM',
33                         _('Customer') => 'CUSTOMERS_NO_FILTER',
34                         _('Currency Filter') => 'CURRENCY',
35                         _('Comments') => 'TEXTBOX',
36                         _('Destination') => 'DESTINATION'));
37 $reports->addReport(_('Customer'),102,_('&Aged Customer Analysis'),
38         array(  _('End Date') => 'DATE',
39                         _('Customer') => 'CUSTOMERS_NO_FILTER',
40                         _('Currency Filter') => 'CURRENCY',
41                         _('Summary Only') => 'YES_NO',
42                         _('Graphics') => 'GRAPHIC',
43                         _('Comments') => 'TEXTBOX',
44                         _('Destination') => 'DESTINATION'));
45 $reports->addReport(_('Customer'),103,_('Customer &Detail Listing'),
46         array(  _('Activity Since') => 'DATEBEGIN',
47                         _('Sales Areas') => 'AREAS',
48                         _('Sales Folk') => 'SALESMEN',
49                         _('Activity Greater Than') => 'TEXT',
50                         _('Activity Less Than') => 'TEXT',
51                         _('Comments') => 'TEXTBOX',
52                         _('Destination') => 'DESTINATION'));
53 $reports->addReport(_('Customer'),104,_('&Price Listing'),
54         array(  _('Currency Filter') => 'CURRENCY',
55                         _('Inventory Category') => 'CATEGORIES',
56                         _('Sales Types') => 'SALESTYPES',
57                         _('Show Pictures') => 'YES_NO',
58                         _('Show GP %') => 'YES_NO',
59                         _('Comments') => 'TEXTBOX',
60                         _('Destination') => 'DESTINATION'));
61 $reports->addReport(_('Customer'),105,_('&Order Status Listing'),
62         array(  _('Start Date') => 'DATEBEGINM',
63                         _('End Date') => 'DATEENDM',
64                         _('Inventory Category') => 'CATEGORIES',
65                         _('Stock Location') => 'LOCATIONS',
66                         _('Back Orders Only') => 'YES_NO',
67                         _('Comments') => 'TEXTBOX',
68                         _('Destination') => 'DESTINATION'));
69 $reports->addReport(_('Customer'),106,_('&Salesman Listing'),
70         array(  _('Start Date') => 'DATEBEGINM',
71                         _('End Date') => 'DATEENDM',
72                         _('Summary Only') => 'YES_NO',
73                         _('Comments') => 'TEXTBOX',
74                         _('Destination') => 'DESTINATION'));
75 $reports->addReport(_('Customer'),107,_('Print &Invoices/Credit Notes'),
76         array(  _('From') => 'INVOICE',
77                         _('To') => 'INVOICE',
78                         _('Currency Filter') => 'CURRENCY',
79                         _('email Customers') => 'YES_NO',
80                         _('Payment Link') => 'PAYMENT_LINK',
81                         _('Comments') => 'TEXTBOX'));
82 $reports->addReport(_('Customer'),110,_('Print &Deliveries'),
83         array(  _('From') => 'DELIVERY',
84                         _('To') => 'DELIVERY',
85                         _('email Customers') => 'YES_NO',
86                         _('Print as Packing Slip') => 'YES_NO',
87                         _('Comments') => 'TEXTBOX'));
88 $reports->addReport(_('Customer'),108,_('Print &Statements'),
89         array(  _('Customer') => 'CUSTOMERS_NO_FILTER',
90                         _('Currency Filter') => 'CURRENCY',
91                         _('Email Customers') => 'YES_NO',
92                         _('Comments') => 'TEXTBOX'));
93 $reports->addReport(_('Customer'),109,_('&Print Sales Orders'),
94         array(  _('From') => 'ORDERS',
95                         _('To') => 'ORDERS',
96                         _('Currency Filter') => 'CURRENCY',
97                         _('Email Customers') => 'YES_NO',
98                         _('Print as Quote') => 'YES_NO',
99                         _('Comments') => 'TEXTBOX'));
100 $reports->addReport(_('Customer'),111,_('&Print Sales Quotations'),
101         array(  _('From') => 'QUOTATIONS',
102                         _('To') => 'QUOTATIONS',
103                         _('Currency Filter') => 'CURRENCY',
104                         _('Email Customers') => 'YES_NO',
105                         _('Comments') => 'TEXTBOX'));
106 $reports->addReport(_('Customer'),111,_('&Print Sales Quotations'),
107         array(  _('From') => 'QUOTATIONS',
108                         _('To') => 'QUOTATIONS',
109                         _('Currency Filter') => 'CURRENCY',
110                         _('Email Customers') => 'YES_NO',
111                         _('Comments') => 'TEXTBOX'));
112 $reports->addReport(_('Customer'),112,_('Print Receipts'),
113         array(  _('From') => 'RECEIPT',
114                         _('To') => 'RECEIPT',
115                         _('Currency Filter') => 'CURRENCY',
116                         _('Comments') => 'TEXTBOX'));
117
118 $reports->addReportClass(_('Supplier'));
119 $reports->addReport(_('Supplier'),201,_('Supplier &Balances'),
120         array(  _('Start Date') => 'DATEBEGIN',
121                         _('End Date') => 'DATEENDM',
122                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
123                         _('Currency Filter') => 'CURRENCY',
124                         _('Comments') => 'TEXTBOX',
125                         _('Destination') => 'DESTINATION'));
126 $reports->addReport(_('Supplier'),202,_('&Aged Supplier Analyses'),
127         array(  _('End Date') => 'DATE',
128                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
129                         _('Currency Filter') => 'CURRENCY',
130                         _('Summary Only') => 'YES_NO',
131                         _('Graphics') => 'GRAPHIC',
132                         _('Comments') => 'TEXTBOX',
133                         _('Destination') => 'DESTINATION'));
134 $reports->addReport(_('Supplier'),203,_('&Payment Report'),
135         array(  _('End Date') => 'DATE',
136                         _('Supplier') => 'SUPPLIERS_NO_FILTER',
137                         _('Currency Filter') => 'CURRENCY',
138                         _('Comments') => 'TEXTBOX',
139                         _('Destination') => 'DESTINATION'));
140 $reports->addReport(_('Supplier'),204,_('Outstanding &GRNs Report'),
141         array(  _('Supplier') => 'SUPPLIERS_NO_FILTER',
142                         _('Comments') => 'TEXTBOX',
143                         _('Destination') => 'DESTINATION'));
144 $reports->addReport(_('Supplier'),209,_('Print Purchase &Orders'),
145         array(  _('From') => 'PO',
146                         _('To') => 'PO',
147                         _('Currency Filter') => 'CURRENCY',
148                         _('Email Customers') => 'YES_NO',
149                         _('Comments') => 'TEXTBOX'));
150 $reports->addReport(_('Supplier'),210,_('Print Remittances'),
151         array(  _('From') => 'REMITTANCE',
152                         _('To') => 'REMITTANCE',
153                         _('Currency Filter') => 'CURRENCY',
154                         _('Email Customers') => 'YES_NO',
155                         _('Comments') => 'TEXTBOX'));
156
157 $reports->addReportClass(_('Inventory'));
158 $reports->addReport(_('Inventory'),301,_('Inventory &Valuation Report'),
159         array(  _('Inventory Category') => 'CATEGORIES',
160                         _('Location') => 'LOCATIONS',
161                         _('Summary Only') => 'YES_NO',
162                         _('Comments') => 'TEXTBOX',
163                         _('Destination') => 'DESTINATION'));
164 $reports->addReport(_('Inventory'),302,_('Inventory &Planning Report'),
165         array(  _('Inventory Category') => 'CATEGORIES',
166                         _('Location') => 'LOCATIONS',
167                         _('Comments') => 'TEXTBOX',
168                         _('Destination') => 'DESTINATION'));
169 $reports->addReport(_('Inventory'),303,_('Stock &Check Sheets'),
170         array(  _('Inventory Category') => 'CATEGORIES',
171                         _('Location') => 'LOCATIONS',
172                         _('Show Pictures') => 'YES_NO',
173                         _('Inventory Column') => 'YES_NO',
174                         _('Show Shortage') => 'YES_NO',
175                         _('Comments') => 'TEXTBOX',
176                         _('Destination') => 'DESTINATION'));
177 $reports->addReport(_('Inventory'),304,_('Inventory &Sales Report'),
178         array(  _('Start Date') => 'DATEBEGINM',
179                         _('End Date') => 'DATEENDM',
180                         _('Inventory Category') => 'CATEGORIES',
181                         _('Location') => 'LOCATIONS',
182                         _('Customer') => 'CUSTOMERS_NO_FILTER',
183                         _('Comments') => 'TEXTBOX',
184                         _('Destination') => 'DESTINATION'));
185 $reports->addReport(_('Inventory'),305,_('&GRN Valuation Report'),
186         array(  _('Start Date') => 'DATEBEGINM',
187                         _('End Date') => 'DATEENDM',
188                         _('Comments') => 'TEXTBOX',
189                         _('Destination') => 'DESTINATION'));
190
191 $reports->addReportClass(_('Manufacturing'));
192 $reports->addReport(_('Manufacturing'),401,_('&Bill of Material Listing'),
193         array(  _('From product') => 'ITEMS',
194                         _('To product') => 'ITEMS',
195                         _('Comments') => 'TEXTBOX',
196                         _('Destination') => 'DESTINATION'));
197 $reports->addReport(_('Manufacturing'),409,_('Print &Work Orders'),
198         array(  _('From') => 'WORKORDER',
199                         _('To') => 'WORKORDER',
200                         _('Email Locations') => 'YES_NO',
201                         _('Comments') => 'TEXTBOX'));
202 $reports->addReportClass(_('Dimensions'));
203 if ($dim > 0)
204 {
205         $reports->addReport(_('Dimensions'),501,_('Dimension &Summary'),
206         array(  _('From Dimension') => 'DIMENSION',
207                         _('To Dimension') => 'DIMENSION',
208                         _('Show Balance') => 'YES_NO',
209                         _('Comments') => 'TEXTBOX',
210                         _('Destination') => 'DESTINATION'));
211         //$reports->addReport(_('Dimensions'),502,_('Dimension Details'),
212         //array(        _('Dimension'),'DIMENSIONS'),
213         //              _('Comments'),'TEXTBOX')));
214 }
215 $reports->addReportClass(_('Banking'));
216         $reports->addReport(_('Banking'),601,_('Bank &Statement'),
217         array(  _('Bank Accounts') => 'BANK_ACCOUNTS',
218                         _('Start Date') => 'DATEBEGINM',
219                         _('End Date') => 'DATEENDM',
220                         _('Comments') => 'TEXTBOX',
221                         _('Destination') => 'DESTINATION'));
222
223 $reports->addReportClass(_('General Ledger'));
224 $reports->addReport(_('General Ledger'),701,_('Chart of &Accounts'),
225         array(  _('Show Balances') => 'YES_NO',
226                         _('Comments') => 'TEXTBOX',
227                         _('Destination') => 'DESTINATION'));
228 $reports->addReport(_('General Ledger'),702,_('List of &Journal Entries'),
229         array(  _('Start Date') => 'DATEBEGINM',
230                         _('End Date') => 'DATEENDM',
231                         _('Type') => 'SYS_TYPES',
232                         _('Comments') => 'TEXTBOX',
233                         _('Destination') => 'DESTINATION'));
234 //$reports->addReport(_('General Ledger'),703,_('GL Account Group Summary'),
235 //      array(  _('Comments'),'TEXTBOX')));
236
237 if ($dim == 2)
238 {
239         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
240         array(  _('Start Date') => 'DATEBEGINM',
241                         _('End Date') => 'DATEENDM',
242                         _('From Account') => 'GL_ACCOUNTS',
243                         _('To Account') => 'GL_ACCOUNTS',
244                         _('Dimension')." 1" =>  'DIMENSIONS1',
245                         _('Dimension')." 2" =>  'DIMENSIONS2',
246                         _('Comments') => 'TEXTBOX',
247                         _('Destination') => 'DESTINATION'));
248         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
249         array(  _('Year') => 'TRANS_YEARS',
250                         _('Dimension')." 1" =>  'DIMENSIONS1',
251                         _('Dimension')." 2" =>  'DIMENSIONS2',
252                         _('Comments') => 'TEXTBOX',
253                         _('Destination') => 'DESTINATION'));
254         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
255         array(  _('Start Date') => 'DATEBEGIN',
256                         _('End Date') => 'DATEENDM',
257                         _('Dimension')." 1" => 'DIMENSIONS1',
258                         _('Dimension')." 2" => 'DIMENSIONS2',
259                         _('Decimal values') => 'YES_NO',
260                         _('Graphics') => 'GRAPHIC',
261                         _('Comments') => 'TEXTBOX',
262                         _('Destination') => 'DESTINATION'));
263         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
264         array(  _('Start Date') => 'DATEBEGINM',
265                         _('End Date') => 'DATEENDM',
266                         _('Compare to') => 'COMPARE',
267                         _('Dimension')." 1" =>  'DIMENSIONS1',
268                         _('Dimension')." 2" =>  'DIMENSIONS2',
269                         _('Decimal values') => 'YES_NO',
270                         _('Graphics') => 'GRAPHIC',
271                         _('Comments') => 'TEXTBOX',
272                         _('Destination') => 'DESTINATION'));
273         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
274         array(  _('Start Date') => 'DATEBEGINM',
275                         _('End Date') => 'DATEENDM',
276                         _('Zero values') => 'YES_NO',
277                         _('Only balances') => 'YES_NO',
278                         _('Dimension')." 1" =>  'DIMENSIONS1',
279                         _('Dimension')." 2" =>  'DIMENSIONS2',
280                         _('Comments') => 'TEXTBOX',
281                         _('Destination') => 'DESTINATION'));
282 }
283 else if ($dim == 1)
284 {
285         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
286         array(  _('Start Date') => 'DATEBEGINM',
287                         _('End Date') => 'DATEENDM',
288                         _('From Account') => 'GL_ACCOUNTS',
289                         _('To Account') => 'GL_ACCOUNTS',
290                         _('Dimension') =>  'DIMENSIONS1',
291                         _('Comments') => 'TEXTBOX',
292                         _('Destination') => 'DESTINATION'));
293         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
294         array(  _('Year') => 'TRANS_YEARS',
295                         _('Dimension') =>  'DIMENSIONS1',
296                         _('Comments') => 'TEXTBOX',
297                         _('Destination') => 'DESTINATION'));
298         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
299         array(  _('Start Date') => 'DATEBEGIN',
300                         _('End Date') => 'DATEENDM',
301                         _('Dimension') => 'DIMENSIONS1',
302                         _('Decimal values') => 'YES_NO',
303                         _('Graphics') => 'GRAPHIC',
304                         _('Comments') => 'TEXTBOX',
305                         _('Destination') => 'DESTINATION'));
306         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
307         array(  _('Start Date') => 'DATEBEGINM',
308                         _('End Date') => 'DATEENDM',
309                         _('Compare to') => 'COMPARE',
310                         _('Dimension') => 'DIMENSIONS1',
311                         _('Decimal values') => 'YES_NO',
312                         _('Graphics') => 'GRAPHIC',
313                         _('Comments') => 'TEXTBOX',
314                         _('Destination') => 'DESTINATION'));
315         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
316         array(  _('Start Date') => 'DATEBEGINM',
317                         _('End Date') => 'DATEENDM',
318                         _('Zero values') => 'YES_NO',
319                         _('Only balances') => 'YES_NO',
320                         _('Dimension') => 'DIMENSIONS1',
321                         _('Comments') => 'TEXTBOX',
322                         _('Destination') => 'DESTINATION'));
323 }
324 else
325 {
326         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
327         array(  _('Start Date') => 'DATEBEGINM',
328                         _('End Date') => 'DATEENDM',
329                         _('From Account') => 'GL_ACCOUNTS',
330                         _('To Account') => 'GL_ACCOUNTS',
331                         _('Comments') => 'TEXTBOX',
332                         _('Destination') => 'DESTINATION'));
333         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
334         array(  _('Year') => 'TRANS_YEARS',
335                         _('Comments') => 'TEXTBOX',
336                         _('Destination') => 'DESTINATION'));
337         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
338         array(  _('Start Date') => 'DATEBEGIN',
339                         _('End Date') => 'DATEENDM',
340                         _('Decimal values') => 'YES_NO',
341                         _('Graphics') => 'GRAPHIC',
342                         _('Comments') => 'TEXTBOX',
343                         _('Destination') => 'DESTINATION'));
344         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
345         array(  _('Start Date') => 'DATEBEGINM',
346                         _('End Date') => 'DATEENDM',
347                         _('Compare to') => 'COMPARE',
348                         _('Decimal values') => 'YES_NO',
349                         _('Graphics') => 'GRAPHIC',
350                         _('Comments') => 'TEXTBOX',
351                         _('Destination') => 'DESTINATION'));
352         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
353         array(  _('Start Date') => 'DATEBEGINM',
354                         _('End Date') => 'DATEENDM',
355                         _('Zero values') => 'YES_NO',
356                         _('Only balances') => 'YES_NO',
357                         _('Comments') => 'TEXTBOX',
358                         _('Destination') => 'DESTINATION'));
359 }
360 $reports->addReport(_('General Ledger'),709,_('Ta&x Report'),
361         array(  _('Start Date') => 'DATEBEGINTAX',
362                         _('End Date') => 'DATEENDTAX',
363                         _('Summary Only') => 'YES_NO',
364                         _('Comments') => 'TEXTBOX'));
365 $reports->addReport(_('General Ledger'),710,_('Audit Trail'),
366         array(  _('Start Date') => 'DATEBEGINM',
367                         _('End Date') => 'DATEENDM',
368                         _('Type') => 'SYS_TYPES_ALL',
369                         _('User') => 'USERS',
370                         _('Comments') => 'TEXTBOX',
371                         _('Destination') => 'DESTINATION'));
372
373 add_custom_reports($reports);
374
375 echo "<script language='javascript'>
376                 function onWindowLoad() {
377                         showClass(" . $_GET['Class'] . ")
378                 }
379         Behaviour.addLoadEvent(onWindowLoad);
380         </script>
381 ";
382 echo $reports->getDisplay();
383
384 end_page();
385 ?>