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