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