Rerun of implemented Selectable Print Orientation (Portrait, Landscape) for all repor...
[fa-stable.git] / reporting / rep708.php
index 9ff9b2964783a21f4966185605b06ed8d5fe2c38..17854bca712e68c4c90ea3c3d0fb54004c6f1d5f 100644 (file)
@@ -147,23 +147,27 @@ function print_trial_balance()
                $dimension = $_POST['PARAM_4'];
                $dimension2 = $_POST['PARAM_5'];
                $comments = $_POST['PARAM_6'];
-               $destination = $_POST['PARAM_7'];
+               $orientation = $_POST['PARAM_7'];
+               $destination = $_POST['PARAM_8'];
        }
        else if ($dim == 1)
        {
                $dimension = $_POST['PARAM_4'];
                $comments = $_POST['PARAM_5'];
-               $destination = $_POST['PARAM_6'];
+               $orientation = $_POST['PARAM_6'];
+               $destination = $_POST['PARAM_7'];
        }
        else
        {
                $comments = $_POST['PARAM_4'];
-               $destination = $_POST['PARAM_5'];
+               $orientation = $_POST['PARAM_5'];
+               $destination = $_POST['PARAM_6'];
        }
        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');
        $dec = user_price_dec();
 
        $cols2 = array(0, 50, 190, 310, 430, 530);
@@ -203,8 +207,12 @@ function print_trial_balance()
                                    1 => array('text' => _('Period'),'from' => $from, 'to' => $to));
     }
 
-       $rep = new FrontReport(_('Trial Balance'), "TrialBalance", user_pagesize());
-
+       $rep = new FrontReport(_('Trial Balance'), "TrialBalance", user_pagesize(), 9, $orientation);
+    if ($orientation == 'L')
+    {
+       recalculate_cols($cols);
+       recalculate_cols($cols2);
+       }
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
        $rep->NewPage();