Feature 5388: Print Invoices (documents) list gets too long. Fixed by default 180...
[fa-stable.git] / reporting / rep402.php
index 00f486d65ffede8ebde1f9fa1c203892bad26025..5cbb6994c08cb1b12fbe7b80f4b723ecf1cdcc1a 100644 (file)
@@ -43,10 +43,12 @@ function getTransactions($items, $open_only, $location)
                workorder.required_by,
                workorder.closed,
                workorder.stock_id
-               FROM ".TB_PREF."workorders as workorder,"
-                       .TB_PREF."stock_master as item,"
+               FROM ".TB_PREF."workorders as workorder
+                       LEFT JOIN ".TB_PREF."voided v ON v.id=workorder.id and v.type=".ST_WORKORDER.","
+                       .TB_PREF."stock_master as item,"
                        .TB_PREF."locations as location
-               WHERE workorder.stock_id=item.stock_id 
+               WHERE ISNULL(v.id)
+                       AND workorder.stock_id=item.stock_id 
                        AND workorder.loc_code=location.loc_code";
 
        if ($open_only != 0)
@@ -72,12 +74,12 @@ function print_gl_rows(&$rep, $result, $title)
 
     if (db_num_rows($result))
     {
-               $rep->Line($rep->row - 2);
+               $rep->Line($rep->row -= 4);
                $rep->NewLine();
                $rep->Font('italic');
                $rep->TextCol(3, 11, $title);
                $rep->Font();
-               $rep->Line($rep->row - 2);
+               $rep->Line($rep->row -= 4);
                while($myrow = db_fetch($result)) {
                        $rep->NewLine();
                        $rep->TextCol(0, 2, $systypes_array[$myrow['type']] . ' ' . $myrow['type_no'], -2);