Switch to new access levels system
[fa-stable.git] / reporting / reports_main.php
index 7f8ecde66fb162cd99cf51c57dc01c4a7051b6b6..7536d2b2b88e7cbc0ae739c38e5e7281c48dcc8f 100644 (file)
@@ -1,7 +1,16 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $path_to_root="..";
-$page_security = 5;
+$page_security = 'SA_OPEN';
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -11,7 +20,7 @@ include_once($path_to_root . "/reporting/includes/reports_classes.inc");
 $js = "";
 if ($use_date_picker)
        $js .= get_js_date_picker();
-page(_("Reports and Analysis"), false, false, "", $js, true);
+page(_("Reports and Analysis"), false, false, "", $js);
 
 $reports = new BoxReports;
 
@@ -19,40 +28,50 @@ $dim = get_company_pref('use_dimension');
 
 $reports->addReportClass(_('Customer'));
 $reports->addReport(_('Customer'),101,_('Customer &Balances'),
-       array(  new ReportParam(_('End Date'),'DATE'),
+       array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
+                       new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),102,_('&Aged Customer Analysis'),
        array(  new ReportParam(_('End Date'),'DATE'),
                        new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
                        new ReportParam(_('Summary Only'),'YES_NO'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),103,_('Customer &Detail Listing'),
        array(  new ReportParam(_('Activity Since'),'DATEBEGIN'),
                        new ReportParam(_('Sales Areas'),'AREAS'),
-                       new ReportParam(_('Sales Folk'),'SALESMEN'), new ReportParam(_('Activity Greater Than'),'TEXT'), new ReportParam(_('Activity Less Than'),'TEXT'), new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Sales Folk'),'SALESMEN'), 
+                       new ReportParam(_('Activity Greater Than'),'TEXT'), 
+                       new ReportParam(_('Activity Less Than'),'TEXT'), 
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),104,_('&Price Listing'),
        array(  new ReportParam(_('Currency Filter'),'CURRENCY'),
                        new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Sales Types'),'SALESTYPES'),
                        new ReportParam(_('Show Pictures'),'YES_NO'),
                        new ReportParam(_('Show GP %'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),105,_('&Order Status Listing'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Stock Location'),'LOCATIONS'),
                        new ReportParam(_('Back Orders Only'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),106,_('&Salesman Listing'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Summary Only'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Customer'),107,_('Print &Invoices/Credit Notes'),
        array(  new ReportParam(_('From'),'INVOICE'),
                        new ReportParam(_('To'),'INVOICE'),
@@ -83,25 +102,30 @@ $reports->addReport(_('Customer'),109,_('&Print Sales Orders'),
 
 $reports->addReportClass(_('Supplier'));
 $reports->addReport(_('Supplier'),201,_('Supplier &Balances'),
-       array(  new ReportParam(_('End Date'),'DATE'),
+       array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
+                       new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Supplier'),202,_('&Aged Supplier Analyses'),
        array(  new ReportParam(_('End Date'),'DATE'),
                        new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
                        new ReportParam(_('Summary Only'),'YES_NO'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Supplier'),203,_('&Payment Report'),
        array(  new ReportParam(_('End Date'),'DATE'),
                        new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Supplier'),204,_('Outstanding &GRNs Report'),
        array(  new ReportParam(_('Supplier'),'SUPPLIERS_NO_FILTER'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Supplier'),209,_('Print Purchase &Orders'),
        array(  new ReportParam(_('From'),'PO'),
                        new ReportParam(_('To'),'PO'),
@@ -115,38 +139,55 @@ $reports->addReport(_('Inventory'),301,_('Inventory &Valuation Report'),
        array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Location'),'LOCATIONS'),
                        new ReportParam(_('Detailed Report'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Inventory'),302,_('Inventory &Planning Report'),
        array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Location'),'LOCATIONS'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Inventory'),303,_('Stock &Check Sheets'),
        array(  new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Location'),'LOCATIONS'),
                        new ReportParam(_('Show Pictures'),'YES_NO'),
                        new ReportParam(_('Inventory Column'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Show Shortage'),'YES_NO'),
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('Inventory'),304,_('Inventory &Sales Report'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Inventory Category'),'CATEGORIES'),
                        new ReportParam(_('Location'),'LOCATIONS'),
-                       new ReportParam(_('Detailed Report'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
+$reports->addReport(_('Inventory'),305,_('&GRN Valuation Report'),
+       array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
+                       new ReportParam(_('End Date'),'DATEENDM'),
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 
-$reports->addReportClass(_('Manufactoring'));
-$reports->addReport(_('Manufactoring'),401,_('&Bill of Material Listing'),
+$reports->addReportClass(_('Manufacturing'));
+$reports->addReport(_('Manufacturing'),401,_('&Bill of Material Listing'),
        array(  new ReportParam(_('From component'),'ITEMS'),
                        new ReportParam(_('To component'),'ITEMS'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
-       $reports->addReportClass(_('Dimensions'));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
+$reports->addReport(_('Manufacturing'),409,_('Print &Work Orders'),
+       array(  new ReportParam(_('From'),'WORKORDER'),
+                       new ReportParam(_('To'),'WORKORDER'),
+                       new ReportParam(_('Email Locations'),'YES_NO'),
+                       new ReportParam(_('Comments'),'TEXTBOX')));
+$reports->addReportClass(_('Dimensions'));
 if ($dim > 0)
 {
        $reports->addReport(_('Dimensions'),501,_('Dimension &Summary'),
        array(  new ReportParam(_('From Dimension'),'DIMENSION'),
                        new ReportParam(_('To Dimension'),'DIMENSION'),
                        new ReportParam(_('Show Balance'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        //$reports->addReport(_('Dimensions'),502,_('Dimension Details'),
        //array(        new ReportParam(_('Dimension'),'DIMENSIONS'),
        //              new ReportParam(_('Comments'),'TEXTBOX')));
@@ -156,17 +197,20 @@ $reports->addReportClass(_('Banking'));
        array(  new ReportParam(_('Bank Accounts'),'BANK_ACCOUNTS'),
                        new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 
 $reports->addReportClass(_('General Ledger'));
 $reports->addReport(_('General Ledger'),701,_('Chart of &Accounts'),
        array(  new ReportParam(_('Show Balances'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 $reports->addReport(_('General Ledger'),702,_('List of &Journal Entries'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Type'),'SYS_TYPES'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 //$reports->addReport(_('General Ledger'),703,_('GL Account Group Summary'),
 //     array(  new ReportParam(_('Comments'),'TEXTBOX')));
 if ($dim == 2)
@@ -178,19 +222,22 @@ if ($dim == 2)
                        new ReportParam(_('To Account'),'GL_ACCOUNTS'),
                        new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
                        new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
        array(  new ReportParam(_('Year'),'TRANS_YEARS'),
                        new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
                        new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
        array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
                        new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
@@ -198,14 +245,17 @@ if ($dim == 2)
                        new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
                        new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Zero values'),'YES_NO'),
+                       new ReportParam(_('Only balances'),'YES_NO'),
                        new ReportParam(_('Dimension')." 1", 'DIMENSIONS1'),
                        new ReportParam(_('Dimension')." 2", 'DIMENSIONS2'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 }
 else if ($dim == 1)
 {
@@ -215,30 +265,36 @@ else if ($dim == 1)
                        new ReportParam(_('From Account'),'GL_ACCOUNTS'),
                        new ReportParam(_('To Account'),'GL_ACCOUNTS'),
                        new ReportParam(_('Dimension'), 'DIMENSIONS1'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
        array(  new ReportParam(_('Year'),'TRANS_YEARS'),
                        new ReportParam(_('Dimension'), 'DIMENSIONS1'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
        array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Dimension'), 'DIMENSIONS1'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Compare to'),'COMPARE'),
                        new ReportParam(_('Dimension'), 'DIMENSIONS1'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Zero values'),'YES_NO'),
+                       new ReportParam(_('Only balances'),'YES_NO'),
                        new ReportParam(_('Dimension'), 'DIMENSIONS1'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 }
 else
 {
@@ -247,46 +303,47 @@ else
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('From Account'),'GL_ACCOUNTS'),
                        new ReportParam(_('To Account'),'GL_ACCOUNTS'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),705,_('Annual &Expense Breakdown'),
        array(  new ReportParam(_('Year'),'TRANS_YEARS'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),706,_('&Balance Sheet'),
        array(  new ReportParam(_('Start Date'),'DATEBEGIN'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),707,_('&Profit and Loss Statement'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Compare to'),'COMPARE'),
                        new ReportParam(_('Graphics'),'GRAPHIC'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
        $reports->addReport(_('General Ledger'),708,_('Trial &Balance'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
                        new ReportParam(_('End Date'),'DATEENDM'),
                        new ReportParam(_('Zero values'),'YES_NO'),
-                       new ReportParam(_('Comments'),'TEXTBOX')));
+                       new ReportParam(_('Only balances'),'YES_NO'),
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 }
 $reports->addReport(_('General Ledger'),709,_('Ta&x Report'),
        array(  new ReportParam(_('Start Date'),'DATEBEGINTAX'),
                        new ReportParam(_('End Date'),'DATEENDTAX'),
                        new ReportParam(_('Summary Only'),'YES_NO'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
+$reports->addReport(_('General Ledger'),710,_('Audit Trail'),
+       array(  new ReportParam(_('Start Date'),'DATEBEGINM'),
+                       new ReportParam(_('End Date'),'DATEENDM'),
+                       new ReportParam(_('Type'),'SYS_TYPES_ALL'),
+                       new ReportParam(_('User'),'USERS'),
+                       new ReportParam(_('Comments'),'TEXTBOX'),
+                       new ReportParam(_('Destination'),'DESTINATION')));
 
-echo "
-<form method=post>
-       <input type='hidden' name='REP_ID' value=''>
-       <input type='hidden' name='PARAM_COUNT' value=''>
-       <input type='hidden' name='PARAM_0' value=''>
-       <input type='hidden' name='PARAM_1' value=''>
-       <input type='hidden' name='PARAM_2' value=''>
-       <input type='hidden' name='PARAM_3' value=''>
-       <input type='hidden' name='PARAM_4' value=''>
-       <input type='hidden' name='PARAM_5' value=''>
-       <input type='hidden' name='PARAM_6' value=''>
-
-       <script language='javascript'>
+echo "<script language='javascript'>
                function onWindowLoad() {
                        showClass(" . $_GET['Class'] . ")
                }
@@ -294,7 +351,6 @@ echo "
        </script>
 ";
 echo $reports->getDisplay();
-echo "</form>";
 
 end_page();
 ?>
\ No newline at end of file