Added Print for documents in /admin/view_print_transaction.php (according to our...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 21 Feb 2008 15:41:35 +0000 (15:41 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 21 Feb 2008 15:41:35 +0000 (15:41 +0000)
CHANGELOG.txt
admin/view_print_transaction.php
applications/setup.php

index 7a0d12df920377b7cf794d26b96e5f6a5201fc59..8a0ec98f15083eae152c1999441a3a346695ebaf 100644 (file)
@@ -19,6 +19,11 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+21-Feb-2008 Joe Hunt
++ Added Print for documents in /admin/view_print_transaction.php (according to our new routines).
+$ /admin/view_print_transaction.php
+  /applications/setup.php
+  
 17-Feb-2008 Joe Hunt
 ! Minor change in menu and function in view_print_transaction.php
 $ /admin/view_print_transaction.php
index 0b3a2c8857f239a36041d3eec406483f763593c3..70c5ca51620b9cd048d7fde52173c6c9b7368938 100644 (file)
@@ -13,12 +13,13 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
 $js = "";
 if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
-page(_("View Transactions"), false, false, "", $js);
+page(_("View or Print Transactions"), false, false, "", $js);
 
 //----------------------------------------------------------------------------------------
 
 function viewing_controls()
 {
+       display_note(_("Only documents can be printed."));
     start_form(false, true);
 
     start_table("class='tablestyle_noborder'");
@@ -102,12 +103,25 @@ function handle_search()
                        echo _("There are no transactions for the given parameters.");
                        return;
                }
-
-               start_table($table_style);
-               if ($trans_ref)
-                       $th = array(_("#"), _("Reference"), _("View"), _("GL"));
+               $print_type = $_POST['filterType'];
+               $print_out = ($print_type == 10 || $print_type == 11 || $print_type == systypes::cust_dispatch() ||
+                       $print_type == systypes::po() || $print_type == systypes::sales_order());
+               if ($print_out)
+               {
+                       print_hidden_script($print_type);
+                       if ($trans_ref)
+                               $th = array(_("#"), _("Reference"), _("View"), _("Print"), _("GL"));
+                       else
+                               $th = array(_("#"), _("View"), _("Print"), _("GL"));
+               }
                else
-                       $th = array(_("#"), _("View"), _("GL"));
+               {
+                       if ($trans_ref)
+                               $th = array(_("#"), _("Reference"), _("View"), _("GL"));
+                       else
+                               $th = array(_("#"), _("View"), _("GL"));
+               }
+               start_table($table_style);
                table_header($th);
                $k = 0;
                while ($line = db_fetch($result))
@@ -119,6 +133,8 @@ function handle_search()
                        if ($trans_ref)
                                label_cell($line[$trans_ref]);
                        label_cell(get_trans_view_str($_POST['filterType'],$line[$trans_no_name], _("View")));
+                       if ($print_out)
+                               label_cell(print_document_link($line[$trans_no_name], _("Print"), true, $print_type));
                label_cell(get_gl_view_str($_POST['filterType'], $line[$trans_no_name], _("View GL")));
 
                end_row();
index df850c3db026dd4dd1d03801f63ce5fab48cb4c4..1bc46c461c76c42ea04e0a28e9afa77ac811f6d9 100644 (file)
@@ -26,7 +26,7 @@
 
                        $this->add_module(_("Maintanance"));
                        $this->add_lapp_function(2, _("Void a Transaction"),"admin/void_transaction.php?");
-                       $this->add_lapp_function(2, _("View Transactions"),"admin/view_print_transaction.php?");
+                       $this->add_lapp_function(2, _("View or Print Transactions"),"admin/view_print_transaction.php?");
                        $this->add_rapp_function(2, _("Backup and Restore"),"admin/backups.php?", 15);
                        $this->add_rapp_function(2, _("Create/Update Companies"),"admin/create_coy.php?", 14);
                        $this->add_rapp_function(2, _("Install/Update Languages"),"admin/inst_lang.php?", 14);