Optional additional security roles inscludable from modules/extensions.
[fa-stable.git] / reporting / rep111.php
index 4272dbf6aec9f5cb9bbc2038d0e180f5e7aa8f30..a16a1d7fc0efd7fc7e23657804b90aa9542453f1 100644 (file)
@@ -37,9 +37,8 @@ function print_sales_quotations()
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
        $currency = $_POST['PARAM_2'];
-       $bankaccount = $_POST['PARAM_3'];
-       $email = $_POST['PARAM_4'];
-       $comments = $_POST['PARAM_5'];
+       $email = $_POST['PARAM_3'];
+       $comments = $_POST['PARAM_4'];
 
        if ($from == null)
                $from = 0;
@@ -52,10 +51,8 @@ function print_sales_quotations()
        // $headers in doctext.inc
        $aligns = array('left', 'left', 'right', 'left', 'right', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
+       $params = array('comments' => $comments);
 
-       $baccount = get_bank_account($params['bankaccount']);
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
@@ -68,7 +65,9 @@ function print_sales_quotations()
 
        for ($i = $from; $i <= $to; $i++)
        {
-               $myrow = get_sales_order_header($i, 32);
+               $myrow = get_sales_order_header($i, ST_SALESQUOTE);
+               $baccount = get_default_bank_account($myrow['curr_code']);
+               $params['bankaccount'] = $baccount['id'];
                $branch = get_branch($myrow["branch_code"]);
                if ($email == 1)
                {
@@ -81,7 +80,7 @@ function print_sales_quotations()
                $rep->title = _("SALES QUOTATION");
                $rep->Header2($myrow, $branch, $myrow, $baccount, 7);
 
-               $result = get_sales_order_details($i, 32);
+               $result = get_sales_order_details($i, ST_SALESQUOTE);
                $SubTotal = 0;
                while ($myrow2=db_fetch($result))
                {