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