Implemented Selectable Print Orientation (Portrait, Landscape) for all reports in...
[fa-stable.git] / reporting / rep303.php
index a7beebc1988b1ba5b0a39a83b44acc6a18be8b63..9c2a493bdf9831300e726c8a88d6605997358003 100644 (file)
@@ -71,13 +71,15 @@ function print_stock_check()
        $shortage = $_POST['PARAM_4'];
        $no_zeros = $_POST['PARAM_5'];
        $comments = $_POST['PARAM_6'];
-               $destination = $_POST['PARAM_7'];
+               $orientation = $_POST['PARAM_7'];
+               $destination = $_POST['PARAM_8'];
 
        if ($destination)
                include_once($path_to_root . "/reporting/includes/excel_report.inc");
        else
                include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
+       $orientation = ($orientation ? 'L' : 'P');
        if ($category == ALL_NUMERIC)
                $category = 0;
        if ($category == 0)
@@ -128,7 +130,9 @@ function print_stock_check()
        else
                $user_comp = "";
 
-       $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize());
+       $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize(), 9, $orientation);
+    if ($orientation == 'L')
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);