Warehouese stock management

Hello,

I have one scenario where customer order 100 qty of an item but available is 50 for that item how i can get it? from which report which field.
I want to fetch using server script.

Please guide!!