$demandqty = get_demand_qty($trans['stock_id'], $loc_code);
$demandqty += get_demand_asm_qty($trans['stock_id'], $loc_code);
$onorder = get_on_porder_qty($trans['stock_id'], $loc_code);
- $onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
+ $flag = get_mb_flag($trans['stock_id']);
+ if ($flag == 'M')
+ $onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0)
continue;
if ($catt != $trans['cat_description'])