Merged latest changes from stable branch.
[fa-stable.git] / reporting / rep107.php
index 41483f9f41d349619defd69d8c4970965fffe7e1..69b95c97054df1d1c7b2138eee301284e382f396 100644 (file)
@@ -88,7 +88,9 @@ function print_invoices()
                $rep = new FrontReport(_('INVOICE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
        if ($orientation == 'L')
                recalculate_cols($cols);
-       for ($i = $from; $i <= $to; $i++)
+
+       $range = get_invoice_range($from, $to);
+       while($row = db_fetch($range))
        {
                        if (!exists_customer_trans(ST_SALESINVOICE, $i))
                                continue;