SUM(qty) AS qty FROM ".TB_PREF."stock_master AS s, ".TB_PREF."stock_moves AS m
WHERE s.stock_id=m.stock_id ";
if ($type == 1)
- $sql .= "AND s.mb_flag='M' ";
+ $sql .= "AND s.mb_flag='M' AND m.type <> ".ST_CUSTDELIVERY." AND m.type <> ".ST_CUSTCREDIT." ";
elseif ($type == 2)
$sql .= "AND s.mb_flag='F' ";
}