Currency filter not working in documents.
[fa-stable.git] / reporting / rep109.php
index 0497392fba0f0cb6df11a3e5cdad3b5b53b2e24d..8b22697ad9a52a0a153d08fe22a1760c0ecba751 100644 (file)
@@ -72,6 +72,9 @@ function print_sales_orders()
        for ($i = $from; $i <= $to; $i++)
        {
                $myrow = get_sales_order_header($i, ST_SALESORDER);
+               if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) {
+                       continue;
+               }
                $baccount = get_default_bank_account($myrow['curr_code']);
                $params['bankaccount'] = $baccount['id'];
                $branch = get_branch($myrow["branch_code"]);
@@ -96,7 +99,7 @@ function print_sales_orders()
                $rep->Font();
                $rep->Info($params, $cols, null, $aligns);
 
-               $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], false);
+               $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], true);
                $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESORDER, $contacts);
                $rep->NewPage();