Checking items stock custom script

Hi, We can’t seem to find a custom script for item stock checking. We had made a module named “stock request” and we want to make the item check the qty and the serial number and gives warning message as soon as possible.
Example:
“Item 1” stock qty is = 3pcs
and then I used the Stock request module and inserted the “Item 1” and put the qty to 10pcs.
A message will automatically and immediately appear and warns “Not enough stock item”.

Please help us.