performance fix in inventory

performance fix in inventory - fixed query in getStock() function