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