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();
23 page(_($help_context = "Reports and Analysis"), false, false, "", $js);
25 $reports = new BoxReports;
27 $dim = get_company_pref('use_dimension');
29 $reports->addReportClass(_('Customer'), RC_CUSTOMER);
30 $reports->addReport(RC_CUSTOMER, 101, _('Customer &Balances'),
31 array( _('Start Date') => 'DATEBEGIN',
32 _('End Date') => 'DATEENDM',
33 _('Customer') => 'CUSTOMERS_NO_FILTER',
34 _('Currency Filter') => 'CURRENCY',
35 _('Comments') => 'TEXTBOX',
36 _('Destination') => 'DESTINATION'));
37 $reports->addReport(RC_CUSTOMER, 102, _('&Aged Customer Analysis'),
38 array( _('End Date') => 'DATE',
39 _('Customer') => 'CUSTOMERS_NO_FILTER',
40 _('Currency Filter') => 'CURRENCY',
41 _('Summary Only') => 'YES_NO',
42 _('Graphics') => 'GRAPHIC',
43 _('Comments') => 'TEXTBOX',
44 _('Destination') => 'DESTINATION'));
45 $reports->addReport(RC_CUSTOMER, 103, _('Customer &Detail Listing'),
46 array( _('Activity Since') => 'DATEBEGIN',
47 _('Sales Areas') => 'AREAS',
48 _('Sales Folk') => 'SALESMEN',
49 _('Activity Greater Than') => 'TEXT',
50 _('Activity Less Than') => 'TEXT',
51 _('Comments') => 'TEXTBOX',
52 _('Destination') => 'DESTINATION'));
53 $reports->addReport(RC_CUSTOMER, 104, _('&Price Listing'),
54 array( _('Currency Filter') => 'CURRENCY',
55 _('Inventory Category') => 'CATEGORIES',
56 _('Sales Types') => 'SALESTYPES',
57 _('Show Pictures') => 'YES_NO',
58 _('Show GP %') => 'YES_NO',
59 _('Comments') => 'TEXTBOX',
60 _('Destination') => 'DESTINATION'));
61 $reports->addReport(RC_CUSTOMER, 105, _('&Order Status Listing'),
62 array( _('Start Date') => 'DATEBEGINM',
63 _('End Date') => 'DATEENDM',
64 _('Inventory Category') => 'CATEGORIES',
65 _('Stock Location') => 'LOCATIONS',
66 _('Back Orders Only') => 'YES_NO',
67 _('Comments') => 'TEXTBOX',
68 _('Destination') => 'DESTINATION'));
69 $reports->addReport(RC_CUSTOMER, 106, _('&Salesman Listing'),
70 array( _('Start Date') => 'DATEBEGINM',
71 _('End Date') => 'DATEENDM',
72 _('Summary Only') => 'YES_NO',
73 _('Comments') => 'TEXTBOX',
74 _('Destination') => 'DESTINATION'));
75 $reports->addReport(RC_CUSTOMER, 107, _('Print &Invoices/Credit Notes'),
76 array( _('From') => 'INVOICE',
78 _('Currency Filter') => 'CURRENCY',
79 _('email Customers') => 'YES_NO',
80 _('Payment Link') => 'PAYMENT_LINK',
81 _('Comments') => 'TEXTBOX'));
82 $reports->addReport(RC_CUSTOMER, 110, _('Print &Deliveries'),
83 array( _('From') => 'DELIVERY',
84 _('To') => 'DELIVERY',
85 _('email Customers') => 'YES_NO',
86 _('Print as Packing Slip') => 'YES_NO',
87 _('Comments') => 'TEXTBOX'));
88 $reports->addReport(RC_CUSTOMER, 108, _('Print &Statements'),
89 array( RC_CUSTOMER => 'CUSTOMERS_NO_FILTER',
90 _('Currency Filter') => 'CURRENCY',
91 _('Email Customers') => 'YES_NO',
92 _('Comments') => 'TEXTBOX'));
93 $reports->addReport(RC_CUSTOMER, 109, _('&Print Sales Orders'),
94 array( _('From') => 'ORDERS',
96 _('Currency Filter') => 'CURRENCY',
97 _('Email Customers') => 'YES_NO',
98 _('Print as Quote') => 'YES_NO',
99 _('Comments') => 'TEXTBOX'));
100 $reports->addReport(RC_CUSTOMER, 111, _('&Print Sales Quotations'),
101 array( _('From') => 'QUOTATIONS',
102 _('To') => 'QUOTATIONS',
103 _('Currency Filter') => 'CURRENCY',
104 _('Email Customers') => '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, 112, _('Print Receipts'),
113 array( _('From') => 'RECEIPT',
114 _('To') => 'RECEIPT',
115 _('Currency Filter') => 'CURRENCY',
116 _('Comments') => 'TEXTBOX'));
118 $reports->addReportClass(_('Supplier'), RC_SUPPLIER);
119 $reports->addReport(RC_SUPPLIER, 201, _('Supplier &Balances'),
120 array( _('Start Date') => 'DATEBEGIN',
121 _('End Date') => 'DATEENDM',
122 _('Supplier') => 'SUPPLIERS_NO_FILTER',
123 _('Currency Filter') => 'CURRENCY',
124 _('Comments') => 'TEXTBOX',
125 _('Destination') => 'DESTINATION'));
126 $reports->addReport(RC_SUPPLIER, 202, _('&Aged Supplier Analyses'),
127 array( _('End Date') => 'DATE',
128 _('Supplier') => 'SUPPLIERS_NO_FILTER',
129 _('Currency Filter') => 'CURRENCY',
130 _('Summary Only') => 'YES_NO',
131 _('Graphics') => 'GRAPHIC',
132 _('Comments') => 'TEXTBOX',
133 _('Destination') => 'DESTINATION'));
134 $reports->addReport(RC_SUPPLIER, 203, _('&Payment Report'),
135 array( _('End Date') => 'DATE',
136 _('Supplier') => 'SUPPLIERS_NO_FILTER',
137 _('Currency Filter') => 'CURRENCY',
138 _('Comments') => 'TEXTBOX',
139 _('Destination') => 'DESTINATION'));
140 $reports->addReport(RC_SUPPLIER, 204, _('Outstanding &GRNs Report'),
141 array( _('Supplier') => 'SUPPLIERS_NO_FILTER',
142 _('Comments') => 'TEXTBOX',
143 _('Destination') => 'DESTINATION'));
144 $reports->addReport(RC_SUPPLIER, 209, _('Print Purchase &Orders'),
145 array( _('From') => 'PO',
147 _('Currency Filter') => 'CURRENCY',
148 _('Email Customers') => 'YES_NO',
149 _('Comments') => 'TEXTBOX'));
150 $reports->addReport(RC_SUPPLIER, 210, _('Print Remittances'),
151 array( _('From') => 'REMITTANCE',
152 _('To') => 'REMITTANCE',
153 _('Currency Filter') => 'CURRENCY',
154 _('Email Customers') => 'YES_NO',
155 _('Comments') => 'TEXTBOX'));
157 $reports->addReportClass(_('Inventory'), RC_INVENTORY);
159 $reports->addReport(RC_INVENTORY, 301, _('Inventory &Valuation Report'),
160 array( _('Inventory Category') => 'CATEGORIES',
161 _('Location') => 'LOCATIONS',
162 _('Summary Only') => 'YES_NO',
163 _('Comments') => 'TEXTBOX',
164 _('Destination') => 'DESTINATION'));
165 $reports->addReport(RC_INVENTORY, 302, _('Inventory &Planning Report'),
166 array( _('Inventory Category') => 'CATEGORIES',
167 _('Location') => 'LOCATIONS',
168 _('Comments') => 'TEXTBOX',
169 _('Destination') => 'DESTINATION'));
170 $reports->addReport(RC_INVENTORY, 303, _('Stock &Check Sheets'),
171 array( _('Inventory Category') => 'CATEGORIES',
172 _('Location') => 'LOCATIONS',
173 _('Show Pictures') => 'YES_NO',
174 _('Inventory Column') => 'YES_NO',
175 _('Show Shortage') => 'YES_NO',
176 _('Comments') => 'TEXTBOX',
177 _('Destination') => 'DESTINATION'));
178 $reports->addReport(RC_INVENTORY, 304, _('Inventory &Sales Report'),
179 array( _('Start Date') => 'DATEBEGINM',
180 _('End Date') => 'DATEENDM',
181 _('Inventory Category') => 'CATEGORIES',
182 _('Location') => 'LOCATIONS',
183 _('Customer') => 'CUSTOMERS_NO_FILTER',
184 _('Comments') => 'TEXTBOX',
185 _('Destination') => 'DESTINATION'));
186 $reports->addReport(RC_INVENTORY, 305, _('&GRN Valuation Report'),
187 array( _('Start Date') => 'DATEBEGINM',
188 _('End Date') => 'DATEENDM',
189 _('Comments') => 'TEXTBOX',
190 _('Destination') => 'DESTINATION'));
192 $reports->addReportClass(_('Manufacturing'), RC_MANUFACTURE);
193 $reports->addReport(RC_MANUFACTURE, 401, _('&Bill of Material Listing'),
194 array( _('From product') => 'ITEMS',
195 _('To product') => 'ITEMS',
196 _('Comments') => 'TEXTBOX',
197 _('Destination') => 'DESTINATION'));
198 $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'),
199 array( _('From') => 'WORKORDER',
200 _('To') => 'WORKORDER',
201 _('Email Locations') => 'YES_NO',
202 _('Comments') => 'TEXTBOX'));
203 $reports->addReportClass(_('Dimensions'), RC_DIMENSIONS);
206 $reports->addReport(RC_DIMENSIONS, 501, _('Dimension &Summary'),
207 array( _('From Dimension') => 'DIMENSION',
208 _('To Dimension') => 'DIMENSION',
209 _('Show Balance') => 'YES_NO',
210 _('Comments') => 'TEXTBOX',
211 _('Destination') => 'DESTINATION'));
212 //$reports->addReport(_('Dimensions'),502, _('Dimension Details'),
213 //array( _('Dimension'),'DIMENSIONS'),
214 // _('Comments'),'TEXTBOX')));
216 $reports->addReportClass(_('Banking'), RC_BANKING);
217 $reports->addReport(RC_BANKING, 601, _('Bank &Statement'),
218 array( _('Bank Accounts') => 'BANK_ACCOUNTS',
219 _('Start Date') => 'DATEBEGINM',
220 _('End Date') => 'DATEENDM',
221 _('Comments') => 'TEXTBOX',
222 _('Destination') => 'DESTINATION'));
224 $reports->addReportClass(_('General Ledger'), RC_GL);
225 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),
226 array( _('Show Balances') => 'YES_NO',
227 _('Comments') => 'TEXTBOX',
228 _('Destination') => 'DESTINATION'));
229 $reports->addReport(RC_GL, 702, _('List of &Journal Entries'),
230 array( _('Start Date') => 'DATEBEGINM',
231 _('End Date') => 'DATEENDM',
232 _('Type') => 'SYS_TYPES',
233 _('Comments') => 'TEXTBOX',
234 _('Destination') => 'DESTINATION'));
235 //$reports->addReport(RC_GL, 703, _('GL Account Group Summary'),
236 // array( _('Comments'),'TEXTBOX')));
240 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
241 array( _('Start Date') => 'DATEBEGINM',
242 _('End Date') => 'DATEENDM',
243 _('From Account') => 'GL_ACCOUNTS',
244 _('To Account') => 'GL_ACCOUNTS',
245 _('Dimension')." 1" => 'DIMENSIONS1',
246 _('Dimension')." 2" => 'DIMENSIONS2',
247 _('Comments') => 'TEXTBOX',
248 _('Destination') => 'DESTINATION'));
249 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
250 array( _('Year') => 'TRANS_YEARS',
251 _('Dimension')." 1" => 'DIMENSIONS1',
252 _('Dimension')." 2" => 'DIMENSIONS2',
253 _('Comments') => 'TEXTBOX',
254 _('Destination') => 'DESTINATION'));
255 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
256 array( _('Start Date') => 'DATEBEGIN',
257 _('End Date') => 'DATEENDM',
258 _('Dimension')." 1" => 'DIMENSIONS1',
259 _('Dimension')." 2" => 'DIMENSIONS2',
260 _('Decimal values') => 'YES_NO',
261 _('Graphics') => 'GRAPHIC',
262 _('Comments') => 'TEXTBOX',
263 _('Destination') => 'DESTINATION'));
264 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
265 array( _('Start Date') => 'DATEBEGINM',
266 _('End Date') => 'DATEENDM',
267 _('Compare to') => 'COMPARE',
268 _('Dimension')." 1" => 'DIMENSIONS1',
269 _('Dimension')." 2" => 'DIMENSIONS2',
270 _('Decimal values') => 'YES_NO',
271 _('Graphics') => 'GRAPHIC',
272 _('Comments') => 'TEXTBOX',
273 _('Destination') => 'DESTINATION'));
274 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
275 array( _('Start Date') => 'DATEBEGINM',
276 _('End Date') => 'DATEENDM',
277 _('Zero values') => 'YES_NO',
278 _('Only balances') => 'YES_NO',
279 _('Dimension')." 1" => 'DIMENSIONS1',
280 _('Dimension')." 2" => 'DIMENSIONS2',
281 _('Comments') => 'TEXTBOX',
282 _('Destination') => 'DESTINATION'));
286 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
287 array( _('Start Date') => 'DATEBEGINM',
288 _('End Date') => 'DATEENDM',
289 _('From Account') => 'GL_ACCOUNTS',
290 _('To Account') => 'GL_ACCOUNTS',
291 _('Dimension') => 'DIMENSIONS1',
292 _('Comments') => 'TEXTBOX',
293 _('Destination') => 'DESTINATION'));
294 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
295 array( _('Year') => 'TRANS_YEARS',
296 _('Dimension') => 'DIMENSIONS1',
297 _('Comments') => 'TEXTBOX',
298 _('Destination') => 'DESTINATION'));
299 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
300 array( _('Start Date') => 'DATEBEGIN',
301 _('End Date') => 'DATEENDM',
302 _('Dimension') => 'DIMENSIONS1',
303 _('Decimal values') => 'YES_NO',
304 _('Graphics') => 'GRAPHIC',
305 _('Comments') => 'TEXTBOX',
306 _('Destination') => 'DESTINATION'));
307 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
308 array( _('Start Date') => 'DATEBEGINM',
309 _('End Date') => 'DATEENDM',
310 _('Compare to') => 'COMPARE',
311 _('Dimension') => 'DIMENSIONS1',
312 _('Decimal values') => 'YES_NO',
313 _('Graphics') => 'GRAPHIC',
314 _('Comments') => 'TEXTBOX',
315 _('Destination') => 'DESTINATION'));
316 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
317 array( _('Start Date') => 'DATEBEGINM',
318 _('End Date') => 'DATEENDM',
319 _('Zero values') => 'YES_NO',
320 _('Only balances') => 'YES_NO',
321 _('Dimension') => 'DIMENSIONS1',
322 _('Comments') => 'TEXTBOX',
323 _('Destination') => 'DESTINATION'));
327 $reports->addReport(RC_GL, 704, _('GL Account &Transactions'),
328 array( _('Start Date') => 'DATEBEGINM',
329 _('End Date') => 'DATEENDM',
330 _('From Account') => 'GL_ACCOUNTS',
331 _('To Account') => 'GL_ACCOUNTS',
332 _('Comments') => 'TEXTBOX',
333 _('Destination') => 'DESTINATION'));
334 $reports->addReport(RC_GL, 705, _('Annual &Expense Breakdown'),
335 array( _('Year') => 'TRANS_YEARS',
336 _('Comments') => 'TEXTBOX',
337 _('Destination') => 'DESTINATION'));
338 $reports->addReport(RC_GL, 706, _('&Balance Sheet'),
339 array( _('Start Date') => 'DATEBEGIN',
340 _('End Date') => 'DATEENDM',
341 _('Decimal values') => 'YES_NO',
342 _('Graphics') => 'GRAPHIC',
343 _('Comments') => 'TEXTBOX',
344 _('Destination') => 'DESTINATION'));
345 $reports->addReport(RC_GL, 707, _('&Profit and Loss Statement'),
346 array( _('Start Date') => 'DATEBEGINM',
347 _('End Date') => 'DATEENDM',
348 _('Compare to') => 'COMPARE',
349 _('Decimal values') => 'YES_NO',
350 _('Graphics') => 'GRAPHIC',
351 _('Comments') => 'TEXTBOX',
352 _('Destination') => 'DESTINATION'));
353 $reports->addReport(RC_GL, 708, _('Trial &Balance'),
354 array( _('Start Date') => 'DATEBEGINM',
355 _('End Date') => 'DATEENDM',
356 _('Zero values') => 'YES_NO',
357 _('Only balances') => 'YES_NO',
358 _('Comments') => 'TEXTBOX',
359 _('Destination') => 'DESTINATION'));
361 $reports->addReport(RC_GL, 709, _('Ta&x Report'),
362 array( _('Start Date') => 'DATEBEGINTAX',
363 _('End Date') => 'DATEENDTAX',
364 _('Summary Only') => 'YES_NO',
365 _('Comments') => 'TEXTBOX'));
366 $reports->addReport(RC_GL, 710, _('Audit Trail'),
367 array( _('Start Date') => 'DATEBEGINM',
368 _('End Date') => 'DATEENDM',
369 _('Type') => 'SYS_TYPES_ALL',
370 _('User') => 'USERS',
371 _('Comments') => 'TEXTBOX',
372 _('Destination') => 'DESTINATION'));
374 add_custom_reports($reports);
376 echo "<script language='javascript'>
377 function onWindowLoad() {
378 showClass(" . $_GET['Class'] . ")
380 Behaviour.addLoadEvent(onWindowLoad);
383 echo $reports->getDisplay();