To prevent negative stock, just go to System > Company Preferences > Inventory tab then enable the option Prevent Negative Stock.
When you create an Invoice that would make the stock negative, this message will appear upon posting.\
To allow negative stock, just disable the Prevent Negative Stock option and you can post an Invoice that would make the stock negative.