X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=blobdiff_plain;f=manufacturing%2Fincludes%2Fdb%2Fwork_orders_db.inc;h=5c7210e5b8572cd5fa6c97a09cb698b12d3b561b;hp=e1b0329edf34e1629ff8692b1a524c1c9ed8a12b;hb=e9edcdc75487682714ecf16d682d49d0a332abc9;hpb=5a3cbfe6d2df1c8c32edcab8bf93e8a8432a15fc diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index e1b0329e..5c7210e5 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -312,11 +312,13 @@ function get_sql_for_work_orders($outstanding_only, $stock_id, $location = ALL_T workorder.released, workorder.stock_id, unit.decimals - FROM ".TB_PREF."workorders as workorder," + 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."item_units as unit," .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 AND item.units=unit.abbr";