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