Added option to print delivery notes as packing slip in reports and links.
[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(_('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(_('Print as Packing Slip'),'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(_('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(_('Email Customers'),'YES_NO'),
98                         new ReportParam(_('Print as Quote'),'YES_NO'),
99                         new ReportParam(_('Comments'),'TEXTBOX')));
100 $reports->addReport(_('Customer'),111,_('&Print Sales Quotations'),
101         array(  new ReportParam(_('From'),'QUOTATIONS'),
102                         new ReportParam(_('To'),'QUOTATIONS'),
103                         new ReportParam(_('Currency Filter'),'CURRENCY'),
104                         new ReportParam(_('Email Customers'),'YES_NO'),
105                         new ReportParam(_('Comments'),'TEXTBOX')));
106
107 $reports->addReportClass(_('Supplier'));
108 $reports->addReport(_('Supplier'),201,_('Supplier &Balances'),
109         array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
110                         new ReportParam(_('End Date'),'DATEENDM'),
111                         new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
112                         new ReportParam(_('Currency Filter'),'CURRENCY'),
113                         new ReportParam(_('Comments'),'TEXTBOX'),
114                         new ReportParam(_('Destination'),'DESTINATION')));
115 $reports->addReport(_('Supplier'),202,_('&Aged Supplier Analyses'),
116         array(  new ReportParam(_('End Date'),'DATE'),
117                         new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
118                         new ReportParam(_('Currency Filter'),'CURRENCY'),
119                         new ReportParam(_('Summary Only'),'YES_NO'),
120                         new ReportParam(_('Graphics'),'GRAPHIC'),
121                         new ReportParam(_('Comments'),'TEXTBOX'),
122                         new ReportParam(_('Destination'),'DESTINATION')));
123 $reports->addReport(_('Supplier'),203,_('&Payment Report'),
124         array(  new ReportParam(_('End Date'),'DATE'),
125                         new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
126                         new ReportParam(_('Currency Filter'),'CURRENCY'),
127                         new ReportParam(_('Comments'),'TEXTBOX'),
128                         new ReportParam(_('Destination'),'DESTINATION')));
129 $reports->addReport(_('Supplier'),204,_('Outstanding &GRNs Report'),
130         array(  new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
131                         new ReportParam(_('Comments'),'TEXTBOX'),
132                         new ReportParam(_('Destination'),'DESTINATION')));
133 $reports->addReport(_('Supplier'),209,_('Print Purchase &Orders'),
134         array(  new ReportParam(_('From'),'PO'),
135                         new ReportParam(_('To'),'PO'),
136                         new ReportParam(_('Currency Filter'),'CURRENCY'),
137                         new ReportParam(_('Email Customers'),'YES_NO'),
138                         new ReportParam(_('Comments'),'TEXTBOX')));
139
140 $reports->addReportClass(_('Inventory'));
141 $reports->addReport(_('Inventory'),301,_('Inventory &Valuation Report'),
142         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
143                         new ReportParam(_('Location'),'LOCATIONS'),
144                         new ReportParam(_('Summary Only'),'YES_NO'),
145                         new ReportParam(_('Comments'),'TEXTBOX'),
146                         new ReportParam(_('Destination'),'DESTINATION')));
147 $reports->addReport(_('Inventory'),302,_('Inventory &Planning Report'),
148         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
149                         new ReportParam(_('Location'),'LOCATIONS'),
150                         new ReportParam(_('Comments'),'TEXTBOX'),
151                         new ReportParam(_('Destination'),'DESTINATION')));
152 $reports->addReport(_('Inventory'),303,_('Stock &Check Sheets'),
153         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
154                         new ReportParam(_('Location'),'LOCATIONS'),
155                         new ReportParam(_('Show Pictures'),'YES_NO'),
156                         new ReportParam(_('Inventory Column'),'YES_NO'),
157                         new ReportParam(_('Show Shortage'),'YES_NO'),
158                         new ReportParam(_('Comments'),'TEXTBOX'),
159                         new ReportParam(_('Destination'),'DESTINATION')));
160 $reports->addReport(_('Inventory'),304,_('Inventory &Sales Report'),
161         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
162                         new ReportParam(_('End Date'),'DATEENDM'),
163                         new ReportParam(_('Inventory Category'),'CATEGORIES'),
164                         new ReportParam(_('Location'),'LOCATIONS'),
165                         new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
166                         new ReportParam(_('Comments'),'TEXTBOX'),
167                         new ReportParam(_('Destination'),'DESTINATION')));
168 $reports->addReport(_('Inventory'),305,_('&GRN Valuation Report'),
169         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
170                         new ReportParam(_('End Date'),'DATEENDM'),
171                         new ReportParam(_('Comments'),'TEXTBOX'),
172                         new ReportParam(_('Destination'),'DESTINATION')));
173
174 $reports->addReportClass(_('Manufacturing'));
175 $reports->addReport(_('Manufacturing'),401,_('&Bill of Material Listing'),
176         array(  new ReportParam(_('From component'),'ITEMS'),
177                         new ReportParam(_('To component'),'ITEMS'),
178                         new ReportParam(_('Comments'),'TEXTBOX'),
179                         new ReportParam(_('Destination'),'DESTINATION')));
180 $reports->addReport(_('Manufacturing'),409,_('Print &Work Orders'),
181         array(  new ReportParam(_('From'),'WORKORDER'),
182                         new ReportParam(_('To'),'WORKORDER'),
183                         new ReportParam(_('Email Locations'),'YES_NO'),
184                         new ReportParam(_('Comments'),'TEXTBOX')));
185 $reports->addReportClass(_('Dimensions'));
186 if ($dim > 0)
187 {
188         $reports->addReport(_('Dimensions'),501,_('Dimension &Summary'),
189         array(  new ReportParam(_('From Dimension'),'DIMENSION'),
190                         new ReportParam(_('To Dimension'),'DIMENSION'),
191                         new ReportParam(_('Show Balance'),'YES_NO'),
192                         new ReportParam(_('Comments'),'TEXTBOX'),
193                         new ReportParam(_('Destination'),'DESTINATION')));
194         //$reports->addReport(_('Dimensions'),502,_('Dimension Details'),
195         //array(        new ReportParam(_('Dimension'),'DIMENSIONS'),
196         //              new ReportParam(_('Comments'),'TEXTBOX')));
197 }
198 $reports->addReportClass(_('Banking'));
199         $reports->addReport(_('Banking'),601,_('Bank &Statement'),
200         array(  new ReportParam(_('Bank Accounts'),'BANK_ACCOUNTS'),
201                         new ReportParam(_('Start Date'),'DATEBEGINM'),
202                         new ReportParam(_('End Date'),'DATEENDM'),
203                         new ReportParam(_('Comments'),'TEXTBOX'),
204                         new ReportParam(_('Destination'),'DESTINATION')));
205
206 $reports->addReportClass(_('General Ledger'));
207 $reports->addReport(_('General Ledger'),701,_('Chart of &Accounts'),
208         array(  new ReportParam(_('Show Balances'),'YES_NO'),
209                         new ReportParam(_('Comments'),'TEXTBOX'),
210                         new ReportParam(_('Destination'),'DESTINATION')));
211 $reports->addReport(_('General Ledger'),702,_('List of &Journal Entries'),
212         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
213                         new ReportParam(_('End Date'),'DATEENDM'),
214                         new ReportParam(_('Type'),'SYS_TYPES'),
215                         new ReportParam(_('Comments'),'TEXTBOX'),
216                         new ReportParam(_('Destination'),'DESTINATION')));
217 //$reports->addReport(_('General Ledger'),703,_('GL Account Group Summary'),
218 //      array(  new ReportParam(_('Comments'),'TEXTBOX')));
219 if ($dim == 2)
220 {
221         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
222         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
223                         new ReportParam(_('End Date'),'DATEENDM'),
224                         new ReportParam(_('From Account'),'GL_ACCOUNTS'),
225                         new ReportParam(_('To Account'),'GL_ACCOUNTS'),
226                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
227                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
228                         new ReportParam(_('Comments'),'TEXTBOX'),
229                         new ReportParam(_('Destination'),'DESTINATION')));
230         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
231         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
232                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
233                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
234                         new ReportParam(_('Comments'),'TEXTBOX'),
235                         new ReportParam(_('Destination'),'DESTINATION')));
236         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
237         array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
238                         new ReportParam(_('End Date'),'DATEENDM'),
239                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
240                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
241                         new ReportParam(_('Graphics'),'GRAPHIC'),
242                         new ReportParam(_('Comments'),'TEXTBOX'),
243                         new ReportParam(_('Destination'),'DESTINATION')));
244         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
245         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
246                         new ReportParam(_('End Date'),'DATEENDM'),
247                         new ReportParam(_('Compare to'),'COMPARE'),
248                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
249                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
250                         new ReportParam(_('Graphics'),'GRAPHIC'),
251                         new ReportParam(_('Comments'),'TEXTBOX'),
252                         new ReportParam(_('Destination'),'DESTINATION')));
253         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
254         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
255                         new ReportParam(_('End Date'),'DATEENDM'),
256                         new ReportParam(_('Zero values'),'YES_NO'),
257                         new ReportParam(_('Only balances'),'YES_NO'),
258                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
259                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
260                         new ReportParam(_('Comments'),'TEXTBOX'),
261                         new ReportParam(_('Destination'),'DESTINATION')));
262 }
263 else if ($dim == 1)
264 {
265         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
266         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
267                         new ReportParam(_('End Date'),'DATEENDM'),
268                         new ReportParam(_('From Account'),'GL_ACCOUNTS'),
269                         new ReportParam(_('To Account'),'GL_ACCOUNTS'),
270                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
271                         new ReportParam(_('Comments'),'TEXTBOX'),
272                         new ReportParam(_('Destination'),'DESTINATION')));
273         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
274         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
275                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
276                         new ReportParam(_('Comments'),'TEXTBOX'),
277                         new ReportParam(_('Destination'),'DESTINATION')));
278         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
279         array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
280                         new ReportParam(_('End Date'),'DATEENDM'),
281                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
282                         new ReportParam(_('Graphics'),'GRAPHIC'),
283                         new ReportParam(_('Comments'),'TEXTBOX'),
284                         new ReportParam(_('Destination'),'DESTINATION')));
285         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
286         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
287                         new ReportParam(_('End Date'),'DATEENDM'),
288                         new ReportParam(_('Compare to'),'COMPARE'),
289                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
290                         new ReportParam(_('Graphics'),'GRAPHIC'),
291                         new ReportParam(_('Comments'),'TEXTBOX'),
292                         new ReportParam(_('Destination'),'DESTINATION')));
293         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
294         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
295                         new ReportParam(_('End Date'),'DATEENDM'),
296                         new ReportParam(_('Zero values'),'YES_NO'),
297                         new ReportParam(_('Only balances'),'YES_NO'),
298                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
299                         new ReportParam(_('Comments'),'TEXTBOX'),
300                         new ReportParam(_('Destination'),'DESTINATION')));
301 }
302 else
303 {
304         $reports->addReport(_('General Ledger'),704,_('GL Account &Transactions'),
305         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
306                         new ReportParam(_('End Date'),'DATEENDM'),
307                         new ReportParam(_('From Account'),'GL_ACCOUNTS'),
308                         new ReportParam(_('To Account'),'GL_ACCOUNTS'),
309                         new ReportParam(_('Comments'),'TEXTBOX'),
310                         new ReportParam(_('Destination'),'DESTINATION')));
311         $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
312         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
313                         new ReportParam(_('Comments'),'TEXTBOX'),
314                         new ReportParam(_('Destination'),'DESTINATION')));
315         $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
316         array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
317                         new ReportParam(_('End Date'),'DATEENDM'),
318                         new ReportParam(_('Graphics'),'GRAPHIC'),
319                         new ReportParam(_('Comments'),'TEXTBOX'),
320                         new ReportParam(_('Destination'),'DESTINATION')));
321         $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
322         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
323                         new ReportParam(_('End Date'),'DATEENDM'),
324                         new ReportParam(_('Compare to'),'COMPARE'),
325                         new ReportParam(_('Graphics'),'GRAPHIC'),
326                         new ReportParam(_('Comments'),'TEXTBOX'),
327                         new ReportParam(_('Destination'),'DESTINATION')));
328         $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
329         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
330                         new ReportParam(_('End Date'),'DATEENDM'),
331                         new ReportParam(_('Zero values'),'YES_NO'),
332                         new ReportParam(_('Only balances'),'YES_NO'),
333                         new ReportParam(_('Comments'),'TEXTBOX'),
334                         new ReportParam(_('Destination'),'DESTINATION')));
335 }
336 $reports->addReport(_('General Ledger'),709,_('Ta&x Report'),
337         array(  new ReportParam(_('Start Date'),'DATEBEGINTAX'),
338                         new ReportParam(_('End Date'),'DATEENDTAX'),
339                         new ReportParam(_('Summary Only'),'YES_NO'),
340                         new ReportParam(_('Comments'),'TEXTBOX')));
341 $reports->addReport(_('General Ledger'),710,_('Audit Trail'),
342         array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
343                         new ReportParam(_('End Date'),'DATEENDM'),
344                         new ReportParam(_('Type'),'SYS_TYPES_ALL'),
345                         new ReportParam(_('User'),'USERS'),
346                         new ReportParam(_('Comments'),'TEXTBOX'),
347                         new ReportParam(_('Destination'),'DESTINATION')));
348
349 echo "<script language='javascript'>
350                 function onWindowLoad() {
351                         showClass(" . $_GET['Class'] . ")
352                 }
353         Behaviour.addLoadEvent(onWindowLoad);
354         </script>
355 ";
356 echo $reports->getDisplay();
357
358 end_page();
359 ?>