Added cancel edition hotkey
[fa-stable.git] / reporting / includes / reports_classes.inc
index fd08842fa0a54ce361367cc89f606f2ceb62f38f..1e0090a148725bb8f688f0754e07ea0b056b57cc 100644 (file)
@@ -1,4 +1,14 @@
 <?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>.
+***********************************************************************/
 class BoxReports
 {
        var $ar_classes;
@@ -34,15 +44,17 @@ class BoxReports
                        $style = $class_counter==$_REQUEST['Class'] ? '' : "style='display:none'";
                        $acc = access_string($key);
                        $st_classes .= "<a href='"
-                               .$_SERVER['PHP_SELF']."?Class=$class_counter"
-                               ."' onclick='return showClass($class_counter);'$acc[1]>$acc[0]</a> <br>";
+                               .$_SERVER['PHP_SELF']."?Class=$class_counter'"
+                               ." class='menu_option' id='".default_focus()."'"
+                               ." onclick='return showClass($class_counter);'$acc[1]>$acc[0]</a> <br>";
                        $st_reports .= "<table id='TAB_" . $class_counter ."' $style cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td><b>" . _("Reports For Class: ") . "&nbsp;$key</b></td></tr>\n";
                        foreach($value as $report)
                        {
                                $acc = access_string($report->name);
                                $st_reports .= "<tr><td><a class='printlink' href='"
-                                       .$_SERVER['PHP_SELF']."?Class=$class_counter&rep_id=$report->id"
-                                       ."'$acc[1]>$acc[0]</a><tr><td>\n";
+                                       .$_SERVER['PHP_SELF']."?Class=$class_counter&rep_id=$report->id'"
+                                       ." id='".default_focus()."'"
+                                       ."$acc[1]>$acc[0]</a><tr><td>\n";
                                if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) {
 
                                        $action = $path_to_root.'/reporting/prn_redirect.php';
@@ -51,8 +63,8 @@ class BoxReports
                                                . "<form method='POST' action='$action' target='_blank'>\n";
                                        $st_params .= hidden('REP_ID', $report->id, false);
                                        $st_params .= submit('Rep'.$report->id,  
-                                               _("Display: ") . access_string($report->name,true),
-                                               false, '', $pdf_debug==0) . '<br><br>';
+                                               _("Display: ") . access_string($report->name, true),
+                                               false, '', $pdf_debug ? false : 'default') . '<br><br>';
                                        $st_params .= $report->getDisplay() 
                                                . "\n</form></td></tr></table>\n";
                                        $Ajax->addUpdate(true, 'rep_form', $st_params);
@@ -170,6 +182,10 @@ class Report
                                        $sel = array(_("No Payment Link"), "PayPal");
                                        $st .= dup_simple_name_list("PARAM_$index", $sel);
                                        break;
+                               case 'DESTINATION':
+                                       $sel = array(_("PDF/Printer"), "Excel");
+                                       $st .= dup_simple_name_list("PARAM_$index", $sel);
+                                       break;
                                case 'COMPARE':
                                        $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget"));
                                        $st .= dup_simple_name_list("PARAM_$index", $sel);
@@ -196,8 +212,7 @@ class Report
                                        $st .= dup_simple_codeandname_list($sql, "PARAM_$index", $dummy);
                                        break;
                                case 'BANK_ACCOUNTS':
-                                       $sql = "SELECT ".TB_PREF."bank_accounts.account_code, concat(bank_account_name, if (bank_curr_code=curr_default,'', concat(' - ', bank_curr_code))) FROM ".TB_PREF."bank_accounts, ".TB_PREF."chart_master, ".TB_PREF."company
-                                               WHERE ".TB_PREF."bank_accounts.account_code=".TB_PREF."chart_master.account_code";
+                                       $sql = "SELECT ".TB_PREF."bank_accounts.id, concat(bank_account_name, if (bank_curr_code=curr_default,'', concat(' - ', bank_curr_code))) FROM ".TB_PREF."bank_accounts, ".TB_PREF."company";
                                        $st .= dup_simple_codeandname_list($sql, "PARAM_$index", $dummy);
                                        break;
                                case 'DIMENSION':