(($resql = $db->query('select stock_available from llx_product p where p.rowid = '.($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id))))? (($objsql = $db->fetch_object($resql))?$objsql->stock_available:0) :0)