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 Remi&ttances'),
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, 304, _('Inventory &Sales Report'),
222 array( _('Start Date') => 'DATEBEGINM',
223 _('End Date') => 'DATEENDM',
224 _('Inventory Category') => 'CATEGORIES',
225 _('Location') => 'LOCATIONS',
226 _('Customer') => 'CUSTOMERS_NO_FILTER',
227 _('Comments') => 'TEXTBOX',
228 _('Orientation') => 'ORIENTATION',
229 _('Destination') => 'DESTINATION'));
230 $reports->addReport(RC_INVENTORY, 305, _('&GRN Valuation Report'),
231 array( _('Start Date') => 'DATEBEGINM',
232 _('End Date') => 'DATEENDM',
233 _('Comments') => 'TEXTBOX',
234 _('Orientation') => 'ORIENTATION',
235 _('Destination') => 'DESTINATION'));
236 $reports->addReport(RC_INVENTORY, 306, _('Inventory P&urchasing Report'),
237 array( _('Start Date') => 'DATEBEGINM',
238 _('End Date') => 'DATEENDM',
239 _('Inventory Category') => 'CATEGORIES',
240 _('Location') => 'LOCATIONS',
241 _('Supplier') => 'SUPPLIERS_NO_FILTER',
242 _('Items') => 'ITEMS_P',
243 _('Comments') => 'TEXTBOX',
244 _('Orientation') => 'ORIENTATION',
245 _('Destination') => 'DESTINATION'));
247 $reports->addReportClass(_('Manufacturing'), RC_MANUFACTURE);
248 $reports->addReport(RC_MANUFACTURE, 401, _('&Bill of Material Listing'),
249 array( _('From product') => 'ITEMS',
250 _('To product') => 'ITEMS',
251 _('Comments') => 'TEXTBOX',
252 _('Orientation') => 'ORIENTATION',
253 _('Destination') => 'DESTINATION'));
254 $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'),
255 array( _('From') => 'WORKORDER',
256 _('To') => 'WORKORDER',
257 _('Email Locations') => 'YES_NO',
258 _('Comments') => 'TEXTBOX',
259 _('Orientation') => 'ORIENTATION'));
260 $reports->addReportClass(_('Dimensions'), RC_DIMENSIONS);
263 $reports->addReport(RC_DIMENSIONS, 501, _('Dimension &Summary'),
264 array( _('From Dimension') => 'DIMENSION',
265 _('To Dimension') => 'DIMENSION',
266 _('Show Balance') => 'YES_NO',
267 _('Comments') => 'TEXTBOX',
268 _('Orientation') => 'ORIENTATION',
269 _('Destination') => 'DESTINATION'));
270 //$reports->addReport(_('Dimensions'),502, _('Dimension Details'),
271 //array( _('Dimension'),'DIMENSIONS'),
272 // _('Comments'),'TEXTBOX')));
274 $reports->addReportClass(_('Banking'), RC_BANKING);
275 $reports->addReport(RC_BANKING, 601, _('Bank &Statement'),
276 array( _('Bank Accounts') => 'BANK_ACCOUNTS',
277 _('Start Date') => 'DATEBEGINM',
278 _('End Date') => 'DATEENDM',
279 _('Zero values') => 'YES_NO',
280 _('Comments') => 'TEXTBOX',
281 _('Orientation') => 'ORIENTATION',
282 _('Destination') => 'DESTINATION'));
283 $reports->addReport(RC_BANKING, 602, _('Bank Statement w/ &Reconcile'),
284 array( _('Bank Accounts') => 'BANK_ACCOUNTS',
285 _('Start Date') => 'DATEBEGINM',
286 _('End Date') => 'DATEENDM',
287 _('Comments') => 'TEXTBOX',
288 _('Destination') => 'DESTINATION'));
290 $reports->addReportClass(_('General Ledger'), RC_GL);
291 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),
292 array( _('Show Balances') => 'YES_NO',
293 _('Comments') => 'TEXTBOX',
294 _('Orientation') => 'ORIENTATION',
295 _('Destination') => 'DESTINATION'));
296 $reports->addReport(RC_GL, 702, _('List of &Journal Entries'),
297 array( _('Start Date') => 'DATEBEGINM',
298 _('End Date') => 'DATEENDM',
299 _('Type') => 'SYS_TYPES',
300 _('Comments') => 'TEXTBOX',
301 _('Orientation') => 'ORIENTATION',
302 _('Destination') => 'DESTINATION'));
303 //$reports->addReport(RC_GL, 703, _('GL Account Group Summary'),
304 // array( _('Comments'),'TEXTBOX')));
308 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
309 array( _('Start Date') => 'DATEBEGINM',
310 _('End Date') => 'DATEENDM',
311 _('From Account') => 'GL_ACCOUNTS',
312 _('To Account') => 'GL_ACCOUNTS',
313 _('Dimension')." 1" => 'DIMENSIONS1',
314 _('Dimension')." 2" => 'DIMENSIONS2',
315 _('Comments') => 'TEXTBOX',
316 _('Orientation') => 'ORIENTATION',
317 _('Destination') => 'DESTINATION'));
318 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
319 array( _('Year') => 'TRANS_YEARS',
320 _('Dimension')." 1" => 'DIMENSIONS1',
321 _('Dimension')." 2" => 'DIMENSIONS2',
322 _('Account Tags') => 'ACCOUNTTAGS',
323 _('Comments') => 'TEXTBOX',
324 _('Orientation') => 'ORIENTATION',
325 _('Destination') => 'DESTINATION'));
326 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
327 array( _('Start Date') => 'DATEBEGIN',
328 _('End Date') => 'DATEENDM',
329 _('Dimension')." 1" => 'DIMENSIONS1',
330 _('Dimension')." 2" => 'DIMENSIONS2',
331 _('Account Tags') => 'ACCOUNTTAGS',
332 _('Decimal values') => 'YES_NO',
333 _('Graphics') => 'GRAPHIC',
334 _('Comments') => 'TEXTBOX',
335 _('Orientation') => 'ORIENTATION',
336 _('Destination') => 'DESTINATION'));
337 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
338 array( _('Start Date') => 'DATEBEGINM',
339 _('End Date') => 'DATEENDM',
340 _('Compare to') => 'COMPARE',
341 _('Dimension')." 1" => 'DIMENSIONS1',
342 _('Dimension')." 2" => 'DIMENSIONS2',
343 _('Account Tags') => 'ACCOUNTTAGS',
344 _('Decimal values') => 'YES_NO',
345 _('Graphics') => 'GRAPHIC',
346 _('Comments') => 'TEXTBOX',
347 _('Orientation') => 'ORIENTATION',
348 _('Destination') => 'DESTINATION'));
349 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
350 array( _('Start Date') => 'DATEBEGINM',
351 _('End Date') => 'DATEENDM',
352 _('Zero values') => 'YES_NO',
353 _('Only balances') => 'YES_NO',
354 _('Dimension')." 1" => 'DIMENSIONS1',
355 _('Dimension')." 2" => 'DIMENSIONS2',
356 _('Comments') => 'TEXTBOX',
357 _('Orientation') => 'ORIENTATION',
358 _('Destination') => 'DESTINATION'));
362 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
363 array( _('Start Date') => 'DATEBEGINM',
364 _('End Date') => 'DATEENDM',
365 _('From Account') => 'GL_ACCOUNTS',
366 _('To Account') => 'GL_ACCOUNTS',
367 _('Dimension') => 'DIMENSIONS1',
368 _('Comments') => 'TEXTBOX',
369 _('Orientation') => 'ORIENTATION',
370 _('Destination') => 'DESTINATION'));
371 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
372 array( _('Year') => 'TRANS_YEARS',
373 _('Dimension') => 'DIMENSIONS1',
374 _('Account Tags') => 'ACCOUNTTAGS',
375 _('Comments') => 'TEXTBOX',
376 _('Orientation') => 'ORIENTATION',
377 _('Destination') => 'DESTINATION'));
378 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
379 array( _('Start Date') => 'DATEBEGIN',
380 _('End Date') => 'DATEENDM',
381 _('Dimension') => 'DIMENSIONS1',
382 _('Account Tags') => 'ACCOUNTTAGS',
383 _('Decimal values') => 'YES_NO',
384 _('Graphics') => 'GRAPHIC',
385 _('Comments') => 'TEXTBOX',
386 _('Orientation') => 'ORIENTATION',
387 _('Destination') => 'DESTINATION'));
388 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
389 array( _('Start Date') => 'DATEBEGINM',
390 _('End Date') => 'DATEENDM',
391 _('Compare to') => 'COMPARE',
392 _('Dimension') => 'DIMENSIONS1',
393 _('Account Tags') => 'ACCOUNTTAGS',
394 _('Decimal values') => 'YES_NO',
395 _('Graphics') => 'GRAPHIC',
396 _('Comments') => 'TEXTBOX',
397 _('Orientation') => 'ORIENTATION',
398 _('Destination') => 'DESTINATION'));
399 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
400 array( _('Start Date') => 'DATEBEGINM',
401 _('End Date') => 'DATEENDM',
402 _('Zero values') => 'YES_NO',
403 _('Only balances') => 'YES_NO',
404 _('Dimension') => 'DIMENSIONS1',
405 _('Comments') => 'TEXTBOX',
406 _('Orientation') => 'ORIENTATION',
407 _('Destination') => 'DESTINATION'));
411 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
412 array( _('Start Date') => 'DATEBEGINM',
413 _('End Date') => 'DATEENDM',
414 _('From Account') => 'GL_ACCOUNTS',
415 _('To Account') => 'GL_ACCOUNTS',
416 _('Comments') => 'TEXTBOX',
417 _('Orientation') => 'ORIENTATION',
418 _('Destination') => 'DESTINATION'));
419 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
420 array( _('Year') => 'TRANS_YEARS',
421 _('Account Tags') => 'ACCOUNTTAGS',
422 _('Comments') => 'TEXTBOX',
423 _('Orientation') => 'ORIENTATION',
424 _('Destination') => 'DESTINATION'));
425 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
426 array( _('Start Date') => 'DATEBEGIN',
427 _('End Date') => 'DATEENDM',
428 _('Account Tags') => 'ACCOUNTTAGS',
429 _('Decimal values') => 'YES_NO',
430 _('Graphics') => 'GRAPHIC',
431 _('Comments') => 'TEXTBOX',
432 _('Orientation') => 'ORIENTATION',
433 _('Destination') => 'DESTINATION'));
434 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
435 array( _('Start Date') => 'DATEBEGINM',
436 _('End Date') => 'DATEENDM',
437 _('Compare to') => 'COMPARE',
438 _('Account Tags') => 'ACCOUNTTAGS',
439 _('Decimal values') => 'YES_NO',
440 _('Graphics') => 'GRAPHIC',
441 _('Comments') => 'TEXTBOX',
442 _('Orientation') => 'ORIENTATION',
443 _('Destination') => 'DESTINATION'));
444 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
445 array( _('Start Date') => 'DATEBEGINM',
446 _('End Date') => 'DATEENDM',
447 _('Zero values') => 'YES_NO',
448 _('Only balances') => 'YES_NO',
449 _('Comments') => 'TEXTBOX',
450 _('Orientation') => 'ORIENTATION',
451 _('Destination') => 'DESTINATION'));
453 $reports->addReport(RC_GL, 709, _('Ta&x Report'),
454 array( _('Start Date') => 'DATEBEGINTAX',
455 _('End Date') => 'DATEENDTAX',
456 _('Summary Only') => 'YES_NO',
457 _('Comments') => 'TEXTBOX',
458 _('Orientation') => 'ORIENTATION',
459 _('Destination') => 'DESTINATION'));
460 $reports->addReport(RC_GL, 710, _('Audit Trail'),
461 array( _('Start Date') => 'DATEBEGINM',
462 _('End Date') => 'DATEENDM',
463 _('Type') => 'SYS_TYPES_ALL',
464 _('User') => 'USERS',
465 _('Comments') => 'TEXTBOX',
466 _('Orientation') => 'ORIENTATION',
467 _('Destination') => 'DESTINATION'));
469 add_custom_reports($reports);
471 echo $reports->getDisplay();