To enable lot number go to, Settings -> Purchases -> Enable Lot number
Check the Enable Lot number checkbox and update settings.
If the lot number is enabled as described above then when adding purchase stock it will display the lot number field for entering the lot number.
If lot number is enabled then when adding opening stock it displays the input field to enter lot number.