*** empty log message ***
[fa-stable.git] / reporting / reports_main.php
1 <?php
2
3 $path_to_root="..";
4 $page_security = 5;
5 include_once($path_to_root . "/includes/session.inc");
6
7 page(_("Reports and Analysis"));
8
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/data_checks.inc");
11 include_once($path_to_root . "/includes/ui.inc");
12 include_once($path_to_root . "/reporting/includes/reports_classes.inc");
13
14 $reports = new BoxReports;
15
16 $dim = get_company_pref('use_dimension');
17
18 $reports->addReportClass(_('Customer'));
19 $reports->addReport(_('Customer'),101,_('Customer Balances'),
20         array(  new ReportParam(_('End Date'),'DATE'), 
21                         new ReportParam(_('From Customer'),'CUSTOMERS'), 
22                         new ReportParam(_('To Customer'),'CUSTOMERS'), 
23                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
24                         new ReportParam(_('Comments'),'TEXTBOX')));
25 $reports->addReport(_('Customer'),102,_('Aged Customer Analysis'),
26         array(  new ReportParam(_('End Date'),'DATE'), 
27                         new ReportParam(_('From Customer'),'CUSTOMERS'), 
28                         new ReportParam(_('To Customer'),'CUSTOMERS'), 
29                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
30                         new ReportParam(_('Summary Only'),'YES_NO'), 
31                         new ReportParam(_('Graphics'),'GRAPHIC'), 
32                         new ReportParam(_('Comments'),'TEXTBOX')));
33 $reports->addReport(_('Customer'),103,_('Customer Detail Listing'),
34         array(  new ReportParam(_('Activity Since'),'DATEBEGIN'), 
35                         new ReportParam(_('Sales Areas'),'AREAS'), 
36                         new ReportParam(_('Sales Folk'),'SALESMEN'), new ReportParam(_('Activity Greater Than'),'TEXT'), new ReportParam(_('Activity Less Than'),'TEXT'), new ReportParam(_('Comments'),'TEXTBOX')));
37 $reports->addReport(_('Customer'),104,_('Price Listing'),
38         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
39                         new ReportParam(_('Sales Types'),'SALESTYPES'), 
40                         new ReportParam(_('Show Pictures'),'YES_NO'), 
41                         new ReportParam(_('Show GP %'),'YES_NO'), 
42                         new ReportParam(_('Comments'),'TEXTBOX')));
43 $reports->addReport(_('Customer'),105,_('Order Status Listing'),
44         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
45                         new ReportParam(_('End Date'),'DATEENDM'), 
46                         new ReportParam(_('Inventory Category'),'CATEGORIES'), 
47                         new ReportParam(_('Stock Location'),'LOCATIONS'), 
48                         new ReportParam(_('Back Orders Only'),'YES_NO'), 
49                         new ReportParam(_('Comments'),'TEXTBOX')));
50 $reports->addReport(_('Customer'),107,_('Print Invoices/Credit Notes'),
51         array(  new ReportParam(_('From'),'INVOICE'), 
52                         new ReportParam(_('To'),'INVOICE'), 
53                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
54                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
55                         new ReportParam(_('email Customers'),'YES_NO'), 
56                         new ReportParam(_('Comments'),'TEXTBOX')));
57 $reports->addReport(_('Customer'),108,_('Print Statements'),
58         array(  new ReportParam(_('Customers'),'CUSTOMERS_NO_FILTER'), 
59                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
60                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
61                         new ReportParam(_('Email Customers'),'YES_NO'), 
62                         new ReportParam(_('Comments'),'TEXTBOX')));
63 $reports->addReport(_('Customer'),109,_('Print Sales Orders'),
64         array(  new ReportParam(_('From'),'ORDERS'), 
65                         new ReportParam(_('To'),'ORDERS'), 
66                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
67                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
68                         new ReportParam(_('Email Customers'),'YES_NO'), 
69                         new ReportParam(_('Comments'),'TEXTBOX')));
70
71 $reports->addReportClass(_('Supplier'));
72 $reports->addReport(_('Supplier'),201,_('Supplier Balances'),
73         array(  new ReportParam(_('End Date'),'DATE'), 
74                         new ReportParam(_('From Supplier'),'SUPPLIERS'), 
75                         new ReportParam(_('To Supplier'),'SUPPLIERS'), 
76                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
77                         new ReportParam(_('Comments'),'TEXTBOX')));
78 $reports->addReport(_('Supplier'),202,_('Aged Supplier Analyses'),
79         array(  new ReportParam(_('End Date'),'DATE'), 
80                         new ReportParam(_('From Supplier'),'SUPPLIERS'), 
81                         new ReportParam(_('To Supplier'),'SUPPLIERS'), 
82                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
83                         new ReportParam(_('Summary Only'),'YES_NO'), 
84                         new ReportParam(_('Graphics'),'GRAPHIC'), 
85                         new ReportParam(_('Comments'),'TEXTBOX')));
86 $reports->addReport(_('Supplier'),203,_('Payment Report'),
87         array(  new ReportParam(_('End Date'),'DATE'), 
88                         new ReportParam(_('From Supplier'),'SUPPLIERS'), 
89                         new ReportParam(_('To Supplier'),'SUPPLIERS'), 
90                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
91                         new ReportParam(_('Comments'),'TEXTBOX')));
92 $reports->addReport(_('Supplier'),204,_('Outstanding GRNs Report'),
93         array(  new ReportParam(_('From Supplier'),'SUPPLIERS'), 
94                         new ReportParam(_('To Supplier'),'SUPPLIERS'), 
95                         new ReportParam(_('Comments'),'TEXTBOX')));
96 $reports->addReport(_('Supplier'),209,_('Print Purchase Orders'),
97         array(  new ReportParam(_('From'),'PO'), 
98                         new ReportParam(_('To'),'PO'), 
99                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
100                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
101                         new ReportParam(_('Email Customers'),'YES_NO'), 
102                         new ReportParam(_('Comments'),'TEXTBOX')));
103
104 $reports->addReportClass(_('Inventory'));
105 $reports->addReport(_('Inventory'),301,_('Inventory Valuation Report'),
106         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
107                         new ReportParam(_('Location'),'LOCATIONS'), 
108                         new ReportParam(_('Detailed Report'),'YES_NO'), 
109                         new ReportParam(_('Comments'),'TEXTBOX')));
110 $reports->addReport(_('Inventory'),302,_('Inventory Planning Report'),
111         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
112                         new ReportParam(_('Location'),'LOCATIONS'), 
113                         new ReportParam(_('Comments'),'TEXTBOX')));
114 $reports->addReport(_('Inventory'),303,_('Stock Check Sheets'),
115         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
116                         new ReportParam(_('Location'),'LOCATIONS'), 
117                         new ReportParam(_('Show Pictures'),'YES_NO'), 
118                         new ReportParam(_('Comments'),'TEXTBOX')));
119
120 $reports->addReportClass(_('Manufactoring'));
121 $reports->addReport(_('Manufactoring'),401,_('Bill of Material Listing'),
122         array(  new ReportParam(_('From component'),'ITEMS'), 
123                         new ReportParam(_('To component'),'ITEMS'), 
124                         new ReportParam(_('Comments'),'TEXTBOX')));
125         $reports->addReportClass(_('Dimensions'));
126 if ($dim > 0)
127 {
128         $reports->addReport(_('Dimensions'),501,_('Dimension Summary'),
129         array(  new ReportParam(_('From Dimension'),'DIMENSION'), 
130                         new ReportParam(_('To Dimension'),'DIMENSION'), 
131                         new ReportParam(_('Show Balance'),'YES_NO'), 
132                         new ReportParam(_('Comments'),'TEXTBOX')));
133         $reports->addReport(_('Dimensions'),502,_('Dimension Details'),
134         array(  new ReportParam(_('Dimension'),'DIMENSIONS'), 
135                         new ReportParam(_('Comments'),'TEXTBOX')));
136 }
137 $reports->addReportClass(_('Banking'));
138 //$reports->addReport(_('Banking'),601,_('Bank Account Transactions'),
139 //      array(  new ReportParam(_('Bank Accounts'),'BANK_ACCOUNTS'),
140 //                      new ReportParam(_('Start Date'),'DATE'), 
141 //                      new ReportParam(_('End Date'),'DATE'), 
142 //                      new ReportParam(_('Comments'),'TEXTBOX')));
143
144 $reports->addReportClass(_('General Ledger'));
145 $reports->addReport(_('General Ledger'),701,_('Chart of Accounts'),
146         array(  new ReportParam(_('Show Balances'),'YES_NO'), 
147                         new ReportParam(_('Comments'),'TEXTBOX')));
148 $reports->addReport(_('General Ledger'),702,_('List of Journal Entries'),
149         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
150                         new ReportParam(_('End Date'),'DATEENDM'), 
151                         new ReportParam(_('Type'),'SYS_TYPES'), 
152                         new ReportParam(_('Comments'),'TEXTBOX')));
153 //$reports->addReport(_('General Ledger'),703,_('GL Account Group Summary'),
154 //      array(  new ReportParam(_('Comments'),'TEXTBOX')));
155 if ($dim == 2)  
156 {
157         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
158         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
159                         new ReportParam(_('End Date'),'DATEENDM'), 
160                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
161                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
162                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
163                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
164                         new ReportParam(_('Comments'),'TEXTBOX')));
165         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
166         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
167                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
168                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
169                         new ReportParam(_('Comments'),'TEXTBOX')));
170         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
171         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
172                         new ReportParam(_('End Date'),'DATEENDM'), 
173                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
174                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
175                         new ReportParam(_('Graphics'),'GRAPHIC'), 
176                         new ReportParam(_('Comments'),'TEXTBOX')));
177         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
178         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
179                         new ReportParam(_('End Date'),'DATEENDM'), 
180                         new ReportParam(_('Compare to'),'COMPARE'), 
181                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
182                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
183                         new ReportParam(_('Graphics'),'GRAPHIC'), 
184                         new ReportParam(_('Comments'),'TEXTBOX')));
185         $reports->addReport(_('General Ledger'),708,_('Trial Balance'),
186         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
187                         new ReportParam(_('End Date'),'DATEENDM'), 
188                         new ReportParam(_('Zero values'),'YES_NO'), 
189                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
190                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
191                         new ReportParam(_('Comments'),'TEXTBOX')));
192 }
193 else if ($dim == 1)
194 {
195         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
196         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
197                         new ReportParam(_('End Date'),'DATEENDM'), 
198                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
199                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
200                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
201                         new ReportParam(_('Comments'),'TEXTBOX')));
202         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
203         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
204                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
205                         new ReportParam(_('Comments'),'TEXTBOX')));
206         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
207         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
208                         new ReportParam(_('End Date'),'DATEENDM'), 
209                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
210                         new ReportParam(_('Graphics'),'GRAPHIC'), 
211                         new ReportParam(_('Comments'),'TEXTBOX')));
212         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
213         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
214                         new ReportParam(_('End Date'),'DATEENDM'), 
215                         new ReportParam(_('Compare to'),'COMPARE'), 
216                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
217                         new ReportParam(_('Graphics'),'GRAPHIC'), 
218                         new ReportParam(_('Comments'),'TEXTBOX')));
219         $reports->addReport(_('General Ledger'),708,_('Trial Balance'),
220         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
221                         new ReportParam(_('End Date'),'DATEENDM'), 
222                         new ReportParam(_('Zero values'),'YES_NO'), 
223                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
224                         new ReportParam(_('Comments'),'TEXTBOX')));
225 }
226 else
227 {
228         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
229         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
230                         new ReportParam(_('End Date'),'DATEENDM'), 
231                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
232                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
233                         new ReportParam(_('Comments'),'TEXTBOX')));
234         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
235         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
236                         new ReportParam(_('Comments'),'TEXTBOX')));
237         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
238         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
239                         new ReportParam(_('End Date'),'DATEENDM'), 
240                         new ReportParam(_('Graphics'),'GRAPHIC'), 
241                         new ReportParam(_('Comments'),'TEXTBOX')));
242         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
243         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
244                         new ReportParam(_('End Date'),'DATEENDM'), 
245                         new ReportParam(_('Compare to'),'COMPARE'), 
246                         new ReportParam(_('Graphics'),'GRAPHIC'), 
247                         new ReportParam(_('Comments'),'TEXTBOX')));
248         $reports->addReport(_('General Ledger'),708,_('Trial Balance'),
249         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
250                         new ReportParam(_('End Date'),'DATEENDM'), 
251                         new ReportParam(_('Zero values'),'YES_NO'), 
252                         new ReportParam(_('Comments'),'TEXTBOX')));
253 }
254 $reports->addReport(_('General Ledger'),709,_('Tax Report'),
255         array(  new ReportParam(_('Start Date'),'DATEBEGINTAX'), 
256                         new ReportParam(_('End Date'),'DATEENDTAX'), 
257                         new ReportParam(_('Summary Only'),'YES_NO'), 
258                         new ReportParam(_('Comments'),'TEXTBOX')));
259
260 echo "
261 <form method=post>
262         <input type='hidden' name='REP_ID' value=''>
263         <input type='hidden' name='PARAM_COUNT' value=''>
264         <input type='hidden' name='PARAM_0' value=''>
265         <input type='hidden' name='PARAM_1' value=''>
266         <input type='hidden' name='PARAM_2' value=''>
267         <input type='hidden' name='PARAM_3' value=''>
268         <input type='hidden' name='PARAM_4' value=''>
269         <input type='hidden' name='PARAM_5' value=''>
270         <input type='hidden' name='PARAM_6' value=''>
271
272         <script language='javascript'>
273                 function onWindowLoad() {
274                         showClass(" . $_GET['Class'] . ")
275                 }
276                 window.onload=onWindowLoad;
277         </script>
278 ";
279 echo $reports->getDisplay();
280 echo "</form>";
281
282 end_page();
283 ?>