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 _('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, 104, _('&Price Listing'),
59 array( _('Currency Filter') => 'CURRENCY',
60 _('Inventory Category') => 'CATEGORIES',
61 _('Sales Types') => 'SALESTYPES',
62 _('Show Pictures') => 'YES_NO',
63 _('Show GP %') => 'YES_NO',
64 _('Comments') => 'TEXTBOX',
65 _('Destination') => 'DESTINATION'));
66 $reports->addReport(RC_CUSTOMER, 105, _('&Order Status Listing'),
67 array( _('Start Date') => 'DATEBEGINM',
68 _('End Date') => 'DATEENDM',
69 _('Inventory Category') => 'CATEGORIES',
70 _('Stock Location') => 'LOCATIONS',
71 _('Back Orders Only') => 'YES_NO',
72 _('Comments') => 'TEXTBOX',
73 _('Destination') => 'DESTINATION'));
74 $reports->addReport(RC_CUSTOMER, 106, _('&Salesman Listing'),
75 array( _('Start Date') => 'DATEBEGINM',
76 _('End Date') => 'DATEENDM',
77 _('Summary Only') => 'YES_NO',
78 _('Comments') => 'TEXTBOX',
79 _('Destination') => 'DESTINATION'));
80 $reports->addReport(RC_CUSTOMER, 107, _('Print &Invoices/Credit Notes'),
81 array( _('From') => 'INVOICE',
83 _('Currency Filter') => 'CURRENCY',
84 _('email Customers') => 'YES_NO',
85 _('Payment Link') => 'PAYMENT_LINK',
86 _('Comments') => 'TEXTBOX'));
87 $reports->addReport(RC_CUSTOMER, 110, _('Print &Deliveries'),
88 array( _('From') => 'DELIVERY',
89 _('To') => 'DELIVERY',
90 _('email Customers') => 'YES_NO',
91 _('Print as Packing Slip') => 'YES_NO',
92 _('Comments') => 'TEXTBOX'));
93 $reports->addReport(RC_CUSTOMER, 108, _('Print &Statements'),
94 array( _('Customer') => 'CUSTOMERS_NO_FILTER',
95 _('Currency Filter') => 'CURRENCY',
96 _('Show Outstanding Only') => 'YES_NO',
97 _('Email Customers') => 'YES_NO',
98 _('Comments') => 'TEXTBOX'));
99 $reports->addReport(RC_CUSTOMER, 109, _('&Print Sales Orders'),
100 array( _('From') => 'ORDERS',
102 _('Currency Filter') => 'CURRENCY',
103 _('Email Customers') => 'YES_NO',
104 _('Print as Quote') => 'YES_NO',
105 _('Comments') => 'TEXTBOX'));
106 $reports->addReport(RC_CUSTOMER, 111, _('&Print Sales Quotations'),
107 array( _('From') => 'QUOTATIONS',
108 _('To') => 'QUOTATIONS',
109 _('Currency Filter') => 'CURRENCY',
110 _('Email Customers') => 'YES_NO',
111 _('Comments') => 'TEXTBOX'));
112 $reports->addReport(RC_CUSTOMER, 111, _('&Print Sales Quotations'),
113 array( _('From') => 'QUOTATIONS',
114 _('To') => 'QUOTATIONS',
115 _('Currency Filter') => 'CURRENCY',
116 _('Email Customers') => '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'));
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',
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'));
166 $reports->addReportClass(_('Inventory'), RC_INVENTORY);
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'));
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);
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')));
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 $reports->addReport(RC_BANKING, 602, _('Bank Statement w/&Reconcile'),
234 array( _('Bank Accounts') => 'BANK_ACCOUNTS',
235 _('Start Date') => 'DATEBEGINM',
236 _('End Date') => 'DATEENDM',
237 _('Comments') => 'TEXTBOX',
238 _('Destination') => 'DESTINATION'));
239 $reports->addReportClass(_('General Ledger'), RC_GL);
240 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),
241 array( _('Show Balances') => 'YES_NO',
242 _('Comments') => 'TEXTBOX',
243 _('Destination') => 'DESTINATION'));
244 $reports->addReport(RC_GL, 702, _('List of &Journal Entries'),
245 array( _('Start Date') => 'DATEBEGINM',
246 _('End Date') => 'DATEENDM',
247 _('Type') => 'SYS_TYPES',
248 _('Comments') => 'TEXTBOX',
249 _('Destination') => 'DESTINATION'));
250 //$reports->addReport(RC_GL, 703, _('GL Account Group Summary'),
251 // array( _('Comments'),'TEXTBOX')));
255 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
256 array( _('Start Date') => 'DATEBEGINM',
257 _('End Date') => 'DATEENDM',
258 _('From Account') => 'GL_ACCOUNTS',
259 _('To Account') => 'GL_ACCOUNTS',
260 _('Dimension')." 1" => 'DIMENSIONS1',
261 _('Dimension')." 2" => 'DIMENSIONS2',
262 _('Comments') => 'TEXTBOX',
263 _('Destination') => 'DESTINATION'));
264 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
265 array( _('Year') => 'TRANS_YEARS',
266 _('Dimension')." 1" => 'DIMENSIONS1',
267 _('Dimension')." 2" => 'DIMENSIONS2',
268 _('Account Tags') => 'ACCOUNTTAGS',
269 _('Comments') => 'TEXTBOX',
270 _('Destination') => 'DESTINATION'));
271 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
272 array( _('Start Date') => 'DATEBEGIN',
273 _('End Date') => 'DATEENDM',
274 _('Dimension')." 1" => 'DIMENSIONS1',
275 _('Dimension')." 2" => 'DIMENSIONS2',
276 _('Account Tags') => 'ACCOUNTTAGS',
277 _('Decimal values') => 'YES_NO',
278 _('Graphics') => 'GRAPHIC',
279 _('Comments') => 'TEXTBOX',
280 _('Destination') => 'DESTINATION'));
281 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
282 array( _('Start Date') => 'DATEBEGINM',
283 _('End Date') => 'DATEENDM',
284 _('Compare to') => 'COMPARE',
285 _('Dimension')." 1" => 'DIMENSIONS1',
286 _('Dimension')." 2" => 'DIMENSIONS2',
287 _('Account Tags') => 'ACCOUNTTAGS',
288 _('Decimal values') => 'YES_NO',
289 _('Graphics') => 'GRAPHIC',
290 _('Comments') => 'TEXTBOX',
291 _('Destination') => 'DESTINATION'));
292 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
293 array( _('Start Date') => 'DATEBEGINM',
294 _('End Date') => 'DATEENDM',
295 _('Zero values') => 'YES_NO',
296 _('Only balances') => 'YES_NO',
297 _('Dimension')." 1" => 'DIMENSIONS1',
298 _('Dimension')." 2" => 'DIMENSIONS2',
299 _('Comments') => 'TEXTBOX',
300 _('Destination') => 'DESTINATION'));
304 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
305 array( _('Start Date') => 'DATEBEGINM',
306 _('End Date') => 'DATEENDM',
307 _('From Account') => 'GL_ACCOUNTS',
308 _('To Account') => 'GL_ACCOUNTS',
309 _('Dimension') => 'DIMENSIONS1',
310 _('Comments') => 'TEXTBOX',
311 _('Destination') => 'DESTINATION'));
312 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
313 array( _('Year') => 'TRANS_YEARS',
314 _('Dimension') => 'DIMENSIONS1',
315 _('Account Tags') => 'ACCOUNTTAGS',
316 _('Comments') => 'TEXTBOX',
317 _('Destination') => 'DESTINATION'));
318 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
319 array( _('Start Date') => 'DATEBEGIN',
320 _('End Date') => 'DATEENDM',
321 _('Dimension') => 'DIMENSIONS1',
322 _('Account Tags') => 'ACCOUNTTAGS',
323 _('Decimal values') => 'YES_NO',
324 _('Graphics') => 'GRAPHIC',
325 _('Comments') => 'TEXTBOX',
326 _('Destination') => 'DESTINATION'));
327 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
328 array( _('Start Date') => 'DATEBEGINM',
329 _('End Date') => 'DATEENDM',
330 _('Compare to') => 'COMPARE',
331 _('Dimension') => 'DIMENSIONS1',
332 _('Account Tags') => 'ACCOUNTTAGS',
333 _('Decimal values') => 'YES_NO',
334 _('Graphics') => 'GRAPHIC',
335 _('Comments') => 'TEXTBOX',
336 _('Destination') => 'DESTINATION'));
337 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
338 array( _('Start Date') => 'DATEBEGINM',
339 _('End Date') => 'DATEENDM',
340 _('Zero values') => 'YES_NO',
341 _('Only balances') => 'YES_NO',
342 _('Dimension') => 'DIMENSIONS1',
343 _('Comments') => 'TEXTBOX',
344 _('Destination') => 'DESTINATION'));
348 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
349 array( _('Start Date') => 'DATEBEGINM',
350 _('End Date') => 'DATEENDM',
351 _('From Account') => 'GL_ACCOUNTS',
352 _('To Account') => 'GL_ACCOUNTS',
353 _('Comments') => 'TEXTBOX',
354 _('Destination') => 'DESTINATION'));
355 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
356 array( _('Year') => 'TRANS_YEARS',
357 _('Account Tags') => 'ACCOUNTTAGS',
358 _('Comments') => 'TEXTBOX',
359 _('Destination') => 'DESTINATION'));
360 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
361 array( _('Start Date') => 'DATEBEGIN',
362 _('End Date') => 'DATEENDM',
363 _('Account Tags') => 'ACCOUNTTAGS',
364 _('Decimal values') => 'YES_NO',
365 _('Graphics') => 'GRAPHIC',
366 _('Comments') => 'TEXTBOX',
367 _('Destination') => 'DESTINATION'));
368 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
369 array( _('Start Date') => 'DATEBEGINM',
370 _('End Date') => 'DATEENDM',
371 _('Compare to') => 'COMPARE',
372 _('Account Tags') => 'ACCOUNTTAGS',
373 _('Decimal values') => 'YES_NO',
374 _('Graphics') => 'GRAPHIC',
375 _('Comments') => 'TEXTBOX',
376 _('Destination') => 'DESTINATION'));
377 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
378 array( _('Start Date') => 'DATEBEGINM',
379 _('End Date') => 'DATEENDM',
380 _('Zero values') => 'YES_NO',
381 _('Only balances') => 'YES_NO',
382 _('Comments') => 'TEXTBOX',
383 _('Destination') => 'DESTINATION'));
385 $reports->addReport(RC_GL, 709, _('Ta&x Report'),
386 array( _('Start Date') => 'DATEBEGINTAX',
387 _('End Date') => 'DATEENDTAX',
388 _('Summary Only') => 'YES_NO',
389 _('Comments') => 'TEXTBOX',
390 _('Destination') => 'DESTINATION'));
391 $reports->addReport(RC_GL, 710, _('Audit Trail'),
392 array( _('Start Date') => 'DATEBEGINM',
393 _('End Date') => 'DATEENDM',
394 _('Type') => 'SYS_TYPES_ALL',
395 _('User') => 'USERS',
396 _('Comments') => 'TEXTBOX',
397 _('Destination') => 'DESTINATION'));
399 add_custom_reports($reports);
401 echo $reports->getDisplay();