Improved layout on documents etc and new empty language file.
[fa-stable.git] / reporting / rep409.php
index f454c41f431f668f07aa3d5179e521ebea7f9aac..bf6bb3d466fe0b75ac78b170a37df1718a8477bd 100644 (file)
@@ -9,10 +9,11 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-$page_security = 2;
+$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
+       'SA_MANUFTRANSVIEW' : 'SA_MANUFBULKREP';
 // ----------------------------------------------------------------
 // $ Revision: 2.0 $
-// Creator:    Janusz Dobrwolski
+// Creator:    Janusz Dobrowolski
 // date_:      2008-01-14
 // Title:      Print Workorders
 // draft version!
@@ -32,7 +33,7 @@ print_workorders();
 
 function print_workorders()
 {
-       global $path_to_root;
+       global $path_to_root, $SysPrefs;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -102,7 +103,7 @@ function print_workorders()
                                $qoh = get_qoh_on_date($myrow2["stock_id"], $myrow2["loc_code"], $date_);
 
                        if ($show_qoh && ($myrow2["units_req"] * $myrow["units_issued"] > $qoh) &&
-                               !sys_prefs::allow_negative_stock())
+                               !$SysPrefs->allow_negative_stock())
                        {
                                // oops, we don't have enough of one of the component items
                                $has_marked = true;
@@ -130,7 +131,7 @@ function print_workorders()
                $rep->NewLine(1);
                $rep->TextCol(0, 5," *** = "._("Insufficient stock"), -2);
 
-               $comments = get_comments(26, $i);
+               $comments = get_comments(ST_WORKORDER, $i);
                if ($comments && db_num_rows($comments))
                {
                        $rep->NewLine();