To show a warning message, please go to More icon >> General settings >> Sales >> Enable the option Warn user while creating invoice when price is less than purchase price of the item >> Update settings.