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 Outstanding Only') => '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( _('Inventory Category') => 'CATEGORIES',
179 _('Location') => 'LOCATIONS',
180 _('Summary Only') => 'YES_NO',
181 _('Comments') => 'TEXTBOX',
182 _('Destination') => 'DESTINATION'));
183 $reports->addReport(RC_INVENTORY, 302, _('Inventory &Planning Report'),
184 array( _('Inventory Category') => 'CATEGORIES',
185 _('Location') => 'LOCATIONS',
186 _('Comments') => 'TEXTBOX',
187 _('Destination') => 'DESTINATION'));
188 $reports->addReport(RC_INVENTORY, 303, _('Stock &Check Sheets'),
189 array( _('Inventory Category') => 'CATEGORIES',
190 _('Location') => 'LOCATIONS',
191 _('Show Pictures') => 'YES_NO',
192 _('Inventory Column') => 'YES_NO',
193 _('Show Shortage') => 'YES_NO',
194 _('Suppress Zeros') => 'YES_NO',
195 _('Comments') => 'TEXTBOX',
196 _('Destination') => 'DESTINATION'));
197 $reports->addReport(RC_INVENTORY, 304, _('Inventory &Sales Report'),
198 array( _('Start Date') => 'DATEBEGINM',
199 _('End Date') => 'DATEENDM',
200 _('Inventory Category') => 'CATEGORIES',
201 _('Location') => 'LOCATIONS',
202 _('Customer') => 'CUSTOMERS_NO_FILTER',
203 _('Comments') => 'TEXTBOX',
204 _('Destination') => 'DESTINATION'));
205 $reports->addReport(RC_INVENTORY, 305, _('&GRN Valuation Report'),
206 array( _('Start Date') => 'DATEBEGINM',
207 _('End Date') => 'DATEENDM',
208 _('Comments') => 'TEXTBOX',
209 _('Destination') => 'DESTINATION'));
211 $reports->addReportClass(_('Manufacturing'), RC_MANUFACTURE);
212 $reports->addReport(RC_MANUFACTURE, 401, _('&Bill of Material Listing'),
213 array( _('From product') => 'ITEMS',
214 _('To product') => 'ITEMS',
215 _('Comments') => 'TEXTBOX',
216 _('Destination') => 'DESTINATION'));
217 $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'),
218 array( _('From') => 'WORKORDER',
219 _('To') => 'WORKORDER',
220 _('Email Locations') => 'YES_NO',
221 _('Comments') => 'TEXTBOX'));
222 $reports->addReportClass(_('Dimensions'), RC_DIMENSIONS);
225 $reports->addReport(RC_DIMENSIONS, 501, _('Dimension &Summary'),
226 array( _('From Dimension') => 'DIMENSION',
227 _('To Dimension') => 'DIMENSION',
228 _('Show Balance') => 'YES_NO',
229 _('Comments') => 'TEXTBOX',
230 _('Destination') => 'DESTINATION'));
231 //$reports->addReport(_('Dimensions'),502, _('Dimension Details'),
232 //array( _('Dimension'),'DIMENSIONS'),
233 // _('Comments'),'TEXTBOX')));
235 $reports->addReportClass(_('Banking'), RC_BANKING);
236 $reports->addReport(RC_BANKING, 601, _('Bank &Statement'),
237 array( _('Bank Accounts') => 'BANK_ACCOUNTS',
238 _('Start Date') => 'DATEBEGINM',
239 _('End Date') => 'DATEENDM',
240 _('Comments') => 'TEXTBOX',
241 _('Destination') => 'DESTINATION'));
243 $reports->addReportClass(_('General Ledger'), RC_GL);
244 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),
245 array( _('Show Balances') => 'YES_NO',
246 _('Comments') => 'TEXTBOX',
247 _('Destination') => 'DESTINATION'));
248 $reports->addReport(RC_GL, 702, _('List of &Journal Entries'),
249 array( _('Start Date') => 'DATEBEGINM',
250 _('End Date') => 'DATEENDM',
251 _('Type') => 'SYS_TYPES',
252 _('Comments') => 'TEXTBOX',
253 _('Destination') => 'DESTINATION'));
254 //$reports->addReport(RC_GL, 703, _('GL Account Group Summary'),
255 // array( _('Comments'),'TEXTBOX')));
259 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
260 array( _('Start Date') => 'DATEBEGINM',
261 _('End Date') => 'DATEENDM',
262 _('From Account') => 'GL_ACCOUNTS',
263 _('To Account') => 'GL_ACCOUNTS',
264 _('Dimension')." 1" => 'DIMENSIONS1',
265 _('Dimension')." 2" => 'DIMENSIONS2',
266 _('Comments') => 'TEXTBOX',
267 _('Destination') => 'DESTINATION'));
268 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
269 array( _('Year') => 'TRANS_YEARS',
270 _('Dimension')." 1" => 'DIMENSIONS1',
271 _('Dimension')." 2" => 'DIMENSIONS2',
272 _('Account Tags') => 'ACCOUNTTAGS',
273 _('Comments') => 'TEXTBOX',
274 _('Destination') => 'DESTINATION'));
275 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
276 array( _('Start Date') => 'DATEBEGIN',
277 _('End Date') => 'DATEENDM',
278 _('Dimension')." 1" => 'DIMENSIONS1',
279 _('Dimension')." 2" => 'DIMENSIONS2',
280 _('Account Tags') => 'ACCOUNTTAGS',
281 _('Decimal values') => 'YES_NO',
282 _('Graphics') => 'GRAPHIC',
283 _('Comments') => 'TEXTBOX',
284 _('Destination') => 'DESTINATION'));
285 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
286 array( _('Start Date') => 'DATEBEGINM',
287 _('End Date') => 'DATEENDM',
288 _('Compare to') => 'COMPARE',
289 _('Dimension')." 1" => 'DIMENSIONS1',
290 _('Dimension')." 2" => 'DIMENSIONS2',
291 _('Account Tags') => 'ACCOUNTTAGS',
292 _('Decimal values') => 'YES_NO',
293 _('Graphics') => 'GRAPHIC',
294 _('Comments') => 'TEXTBOX',
295 _('Destination') => 'DESTINATION'));
296 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
297 array( _('Start Date') => 'DATEBEGINM',
298 _('End Date') => 'DATEENDM',
299 _('Zero values') => 'YES_NO',
300 _('Only balances') => 'YES_NO',
301 _('Dimension')." 1" => 'DIMENSIONS1',
302 _('Dimension')." 2" => 'DIMENSIONS2',
303 _('Comments') => 'TEXTBOX',
304 _('Destination') => 'DESTINATION'));
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') => 'DIMENSIONS1',
314 _('Comments') => 'TEXTBOX',
315 _('Destination') => 'DESTINATION'));
316 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
317 array( _('Year') => 'TRANS_YEARS',
318 _('Dimension') => 'DIMENSIONS1',
319 _('Account Tags') => 'ACCOUNTTAGS',
320 _('Comments') => 'TEXTBOX',
321 _('Destination') => 'DESTINATION'));
322 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
323 array( _('Start Date') => 'DATEBEGIN',
324 _('End Date') => 'DATEENDM',
325 _('Dimension') => 'DIMENSIONS1',
326 _('Account Tags') => 'ACCOUNTTAGS',
327 _('Decimal values') => 'YES_NO',
328 _('Graphics') => 'GRAPHIC',
329 _('Comments') => 'TEXTBOX',
330 _('Destination') => 'DESTINATION'));
331 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
332 array( _('Start Date') => 'DATEBEGINM',
333 _('End Date') => 'DATEENDM',
334 _('Compare to') => 'COMPARE',
335 _('Dimension') => 'DIMENSIONS1',
336 _('Account Tags') => 'ACCOUNTTAGS',
337 _('Decimal values') => 'YES_NO',
338 _('Graphics') => 'GRAPHIC',
339 _('Comments') => 'TEXTBOX',
340 _('Destination') => 'DESTINATION'));
341 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
342 array( _('Start Date') => 'DATEBEGINM',
343 _('End Date') => 'DATEENDM',
344 _('Zero values') => 'YES_NO',
345 _('Only balances') => 'YES_NO',
346 _('Dimension') => 'DIMENSIONS1',
347 _('Comments') => 'TEXTBOX',
348 _('Destination') => 'DESTINATION'));
352 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
353 array( _('Start Date') => 'DATEBEGINM',
354 _('End Date') => 'DATEENDM',
355 _('From Account') => 'GL_ACCOUNTS',
356 _('To Account') => 'GL_ACCOUNTS',
357 _('Comments') => 'TEXTBOX',
358 _('Destination') => 'DESTINATION'));
359 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
360 array( _('Year') => 'TRANS_YEARS',
361 _('Account Tags') => 'ACCOUNTTAGS',
362 _('Comments') => 'TEXTBOX',
363 _('Destination') => 'DESTINATION'));
364 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
365 array( _('Start Date') => 'DATEBEGIN',
366 _('End Date') => 'DATEENDM',
367 _('Account Tags') => 'ACCOUNTTAGS',
368 _('Decimal values') => 'YES_NO',
369 _('Graphics') => 'GRAPHIC',
370 _('Comments') => 'TEXTBOX',
371 _('Destination') => 'DESTINATION'));
372 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
373 array( _('Start Date') => 'DATEBEGINM',
374 _('End Date') => 'DATEENDM',
375 _('Compare to') => 'COMPARE',
376 _('Account Tags') => 'ACCOUNTTAGS',
377 _('Decimal values') => 'YES_NO',
378 _('Graphics') => 'GRAPHIC',
379 _('Comments') => 'TEXTBOX',
380 _('Destination') => 'DESTINATION'));
381 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
382 array( _('Start Date') => 'DATEBEGINM',
383 _('End Date') => 'DATEENDM',
384 _('Zero values') => 'YES_NO',
385 _('Only balances') => 'YES_NO',
386 _('Comments') => 'TEXTBOX',
387 _('Destination') => 'DESTINATION'));
389 $reports->addReport(RC_GL, 709, _('Ta&x Report'),
390 array( _('Start Date') => 'DATEBEGINTAX',
391 _('End Date') => 'DATEENDTAX',
392 _('Summary Only') => 'YES_NO',
393 _('Comments') => 'TEXTBOX',
394 _('Destination') => 'DESTINATION'));
395 $reports->addReport(RC_GL, 710, _('Audit Trail'),
396 array( _('Start Date') => 'DATEBEGINM',
397 _('End Date') => 'DATEENDM',
398 _('Type') => 'SYS_TYPES_ALL',
399 _('User') => 'USERS',
400 _('Comments') => 'TEXTBOX',
401 _('Destination') => 'DESTINATION'));
403 add_custom_reports($reports);
405 echo $reports->getDisplay();