Implemented Selectable Print Orientation (Portrait, Landscape) for all reports in...
[fa-stable.git] / reporting / rep210.php
index 136f0d2c9fe355b542fc8dd06cbad64d5f112d27..de184220d10c7941ee764926a1b0afef0f341d96 100644 (file)
@@ -70,9 +70,11 @@ function print_remittances()
        $currency = $_POST['PARAM_2'];
        $email = $_POST['PARAM_3'];
        $comments = $_POST['PARAM_4'];
+       $orientation = $_POST['PARAM_5'];
 
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -90,13 +92,9 @@ function print_remittances()
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
-       {
-               $rep = new FrontReport(_('REMITTANCE'), "RemittanceBulk", user_pagesize());
-               $rep->SetHeaderType('Header2');
-               $rep->currency = $cur;
-               $rep->Font();
-               $rep->Info($params, $cols, null, $aligns);
-       }
+               $rep = new FrontReport(_('REMITTANCE'), "RemittanceBulk", user_pagesize(), 9, $orientation);
+    if ($orientation == 'L')
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
@@ -115,16 +113,15 @@ function print_remittances()
 
                        if ($email == 1)
                        {
-                               $rep = new FrontReport("", "", user_pagesize());
-                               $rep->SetHeaderType('Header2');
-                               $rep->currency = $cur;
-                               $rep->Font();
+                               $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
                                $rep->title = _('REMITTANCE');
                                $rep->filename = "Remittance" . $i . ".pdf";
-                               $rep->Info($params, $cols, null, $aligns);
                        }
-                       else
-                               $rep->title = _('REMITTANCE');
+                       $rep->SetHeaderType('Header2');
+                       $rep->currency = $cur;
+                       $rep->Font();
+                       $rep->Info($params, $cols, null, $aligns);
+
                        $contacts = get_supplier_contacts($myrow['supplier_id'], 'invoice');
                        $rep->SetCommonData($myrow, null, $myrow, $baccount, ST_SUPPAYMENT, $contacts);
                        $rep->NewPage();