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