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)
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);