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