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