Added optional link for electronic payment on invoices (PayPal)
[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 include_once($path_to_root . "/includes/date_functions.inc");
8 include_once($path_to_root . "/includes/data_checks.inc");
9 include_once($path_to_root . "/includes/ui.inc");
10 include_once($path_to_root . "/reporting/includes/reports_classes.inc");
11 $js = "";
12 if ($use_date_picker)
13         $js .= get_js_date_picker();
14 page(_("Reports and Analysis"), false, false, "", $js);
15
16 $reports = new BoxReports;
17
18 $dim = get_company_pref('use_dimension');
19
20 $reports->addReportClass(_('Customer'));
21 $reports->addReport(_('Customer'),101,_('Customer Balances'),
22         array(  new ReportParam(_('End Date'),'DATE'), 
23                         new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'), 
24                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
25                         new ReportParam(_('Comments'),'TEXTBOX')));
26 $reports->addReport(_('Customer'),102,_('Aged Customer Analysis'),
27         array(  new ReportParam(_('End Date'),'DATE'), 
28                         new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'), 
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(_('Payment Link'),'PAYMENT_LINK'), 
57                         new ReportParam(_('Comments'),'TEXTBOX')));
58 $reports->addReport(_('Customer'),108,_('Print Statements'),
59         array(  new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'), 
60                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
61                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
62                         new ReportParam(_('Email Customers'),'YES_NO'), 
63                         new ReportParam(_('Comments'),'TEXTBOX')));
64 $reports->addReport(_('Customer'),109,_('Print Sales Orders'),
65         array(  new ReportParam(_('From'),'ORDERS'), 
66                         new ReportParam(_('To'),'ORDERS'), 
67                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
68                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
69                         new ReportParam(_('Email Customers'),'YES_NO'), 
70                         new ReportParam(_('Print as Quote'),'YES_NO'), 
71                         new ReportParam(_('Comments'),'TEXTBOX')));
72
73 $reports->addReportClass(_('Supplier'));
74 $reports->addReport(_('Supplier'),201,_('Supplier Balances'),
75         array(  new ReportParam(_('End Date'),'DATE'), 
76                         new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'), 
77                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
78                         new ReportParam(_('Comments'),'TEXTBOX')));
79 $reports->addReport(_('Supplier'),202,_('Aged Supplier Analyses'),
80         array(  new ReportParam(_('End Date'),'DATE'), 
81                         new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'), 
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(_('Supplier'),'SUPPLIERS_NO_FILTER'), 
89                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
90                         new ReportParam(_('Comments'),'TEXTBOX')));
91 $reports->addReport(_('Supplier'),204,_('Outstanding GRNs Report'),
92         array(  new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'), 
93                         new ReportParam(_('Comments'),'TEXTBOX')));
94 $reports->addReport(_('Supplier'),209,_('Print Purchase Orders'),
95         array(  new ReportParam(_('From'),'PO'), 
96                         new ReportParam(_('To'),'PO'), 
97                         new ReportParam(_('Currency Filter'),'CURRENCY'), 
98                         new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), 
99                         new ReportParam(_('Email Customers'),'YES_NO'), 
100                         new ReportParam(_('Comments'),'TEXTBOX')));
101
102 $reports->addReportClass(_('Inventory'));
103 $reports->addReport(_('Inventory'),301,_('Inventory Valuation Report'),
104         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
105                         new ReportParam(_('Location'),'LOCATIONS'), 
106                         new ReportParam(_('Detailed Report'),'YES_NO'), 
107                         new ReportParam(_('Comments'),'TEXTBOX')));
108 $reports->addReport(_('Inventory'),302,_('Inventory Planning Report'),
109         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
110                         new ReportParam(_('Location'),'LOCATIONS'), 
111                         new ReportParam(_('Comments'),'TEXTBOX')));
112 $reports->addReport(_('Inventory'),303,_('Stock Check Sheets'),
113         array(  new ReportParam(_('Inventory Category'),'CATEGORIES'), 
114                         new ReportParam(_('Location'),'LOCATIONS'), 
115                         new ReportParam(_('Show Pictures'),'YES_NO'), 
116                         new ReportParam(_('Comments'),'TEXTBOX')));
117
118 $reports->addReportClass(_('Manufactoring'));
119 $reports->addReport(_('Manufactoring'),401,_('Bill of Material Listing'),
120         array(  new ReportParam(_('From component'),'ITEMS'), 
121                         new ReportParam(_('To component'),'ITEMS'), 
122                         new ReportParam(_('Comments'),'TEXTBOX')));
123         $reports->addReportClass(_('Dimensions'));
124 if ($dim > 0)
125 {
126         $reports->addReport(_('Dimensions'),501,_('Dimension Summary'),
127         array(  new ReportParam(_('From Dimension'),'DIMENSION'), 
128                         new ReportParam(_('To Dimension'),'DIMENSION'), 
129                         new ReportParam(_('Show Balance'),'YES_NO'), 
130                         new ReportParam(_('Comments'),'TEXTBOX')));
131         $reports->addReport(_('Dimensions'),502,_('Dimension Details'),
132         array(  new ReportParam(_('Dimension'),'DIMENSIONS'), 
133                         new ReportParam(_('Comments'),'TEXTBOX')));
134 }
135 $reports->addReportClass(_('Banking'));
136 //$reports->addReport(_('Banking'),601,_('Bank Account Transactions'),
137 //      array(  new ReportParam(_('Bank Accounts'),'BANK_ACCOUNTS'),
138 //                      new ReportParam(_('Start Date'),'DATE'), 
139 //                      new ReportParam(_('End Date'),'DATE'), 
140 //                      new ReportParam(_('Comments'),'TEXTBOX')));
141
142 $reports->addReportClass(_('General Ledger'));
143 $reports->addReport(_('General Ledger'),701,_('Chart of Accounts'),
144         array(  new ReportParam(_('Show Balances'),'YES_NO'), 
145                         new ReportParam(_('Comments'),'TEXTBOX')));
146 $reports->addReport(_('General Ledger'),702,_('List of Journal Entries'),
147         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
148                         new ReportParam(_('End Date'),'DATEENDM'), 
149                         new ReportParam(_('Type'),'SYS_TYPES'), 
150                         new ReportParam(_('Comments'),'TEXTBOX')));
151 //$reports->addReport(_('General Ledger'),703,_('GL Account Group Summary'),
152 //      array(  new ReportParam(_('Comments'),'TEXTBOX')));
153 if ($dim == 2)  
154 {
155         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
156         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
157                         new ReportParam(_('End Date'),'DATEENDM'), 
158                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
159                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
160                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
161                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
162                         new ReportParam(_('Comments'),'TEXTBOX')));
163         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
164         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
165                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
166                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
167                         new ReportParam(_('Comments'),'TEXTBOX')));
168         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
169         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
170                         new ReportParam(_('End Date'),'DATEENDM'), 
171                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
172                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
173                         new ReportParam(_('Graphics'),'GRAPHIC'), 
174                         new ReportParam(_('Comments'),'TEXTBOX')));
175         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
176         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
177                         new ReportParam(_('End Date'),'DATEENDM'), 
178                         new ReportParam(_('Compare to'),'COMPARE'), 
179                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
180                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
181                         new ReportParam(_('Graphics'),'GRAPHIC'), 
182                         new ReportParam(_('Comments'),'TEXTBOX')));
183         $reports->addReport(_('General Ledger'),708,_('Trial Balance'),
184         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
185                         new ReportParam(_('End Date'),'DATEENDM'), 
186                         new ReportParam(_('Zero values'),'YES_NO'), 
187                         new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'), 
188                         new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'), 
189                         new ReportParam(_('Comments'),'TEXTBOX')));
190 }
191 else if ($dim == 1)
192 {
193         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
194         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
195                         new ReportParam(_('End Date'),'DATEENDM'), 
196                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
197                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
198                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
199                         new ReportParam(_('Comments'),'TEXTBOX')));
200         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
201         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
202                         new ReportParam(_('Dimension'), 'DIMENSIONS1'),
203                         new ReportParam(_('Comments'),'TEXTBOX')));
204         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
205         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
206                         new ReportParam(_('End Date'),'DATEENDM'), 
207                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
208                         new ReportParam(_('Graphics'),'GRAPHIC'), 
209                         new ReportParam(_('Comments'),'TEXTBOX')));
210         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
211         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
212                         new ReportParam(_('End Date'),'DATEENDM'), 
213                         new ReportParam(_('Compare to'),'COMPARE'), 
214                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
215                         new ReportParam(_('Graphics'),'GRAPHIC'), 
216                         new ReportParam(_('Comments'),'TEXTBOX')));
217         $reports->addReport(_('General Ledger'),708,_('Trial Balance'),
218         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
219                         new ReportParam(_('End Date'),'DATEENDM'), 
220                         new ReportParam(_('Zero values'),'YES_NO'), 
221                         new ReportParam(_('Dimension'), 'DIMENSIONS1'), 
222                         new ReportParam(_('Comments'),'TEXTBOX')));
223 }
224 else
225 {
226         $reports->addReport(_('General Ledger'),704,_('GL Account Transactions'),
227         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
228                         new ReportParam(_('End Date'),'DATEENDM'), 
229                         new ReportParam(_('From Account'),'GL_ACCOUNTS'), 
230                         new ReportParam(_('To Account'),'GL_ACCOUNTS'), 
231                         new ReportParam(_('Comments'),'TEXTBOX')));
232         $reports->addReport(_('General Ledger'),705,_('Annual Expense Breakdown'),
233         array(  new ReportParam(_('Year'),'TRANS_YEARS'),
234                         new ReportParam(_('Comments'),'TEXTBOX')));
235         $reports->addReport(_('General Ledger'),706,_('Balance Sheet'),
236         array(  new ReportParam(_('Start Date'),'DATEBEGIN'), 
237                         new ReportParam(_('End Date'),'DATEENDM'), 
238                         new ReportParam(_('Graphics'),'GRAPHIC'), 
239                         new ReportParam(_('Comments'),'TEXTBOX')));
240         $reports->addReport(_('General Ledger'),707,_('Profit and Loss Statement'),
241         array(  new ReportParam(_('Start Date'),'DATEBEGINM'), 
242                         new ReportParam(_('End Date'),'DATEENDM'), 
243                         new ReportParam(_('Compare to'),'COMPARE'), 
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(_('Comments'),'TEXTBOX')));
251 }
252 $reports->addReport(_('General Ledger'),709,_('Tax Report'),
253         array(  new ReportParam(_('Start Date'),'DATEBEGINTAX'), 
254                         new ReportParam(_('End Date'),'DATEENDTAX'), 
255                         new ReportParam(_('Summary Only'),'YES_NO'), 
256                         new ReportParam(_('Comments'),'TEXTBOX')));
257
258 echo "
259 <form method=post>
260         <input type='hidden' name='REP_ID' value=''>
261         <input type='hidden' name='PARAM_COUNT' value=''>
262         <input type='hidden' name='PARAM_0' value=''>
263         <input type='hidden' name='PARAM_1' value=''>
264         <input type='hidden' name='PARAM_2' value=''>
265         <input type='hidden' name='PARAM_3' value=''>
266         <input type='hidden' name='PARAM_4' value=''>
267         <input type='hidden' name='PARAM_5' value=''>
268         <input type='hidden' name='PARAM_6' value=''>
269
270         <script language='javascript'>
271                 function onWindowLoad() {
272                         showClass(" . $_GET['Class'] . ")
273                 }
274                 window.onload=onWindowLoad;
275         </script>
276 ";
277 echo $reports->getDisplay();
278 echo "</form>";
279
280 end_page();
281 ?>