Right now if a beer doesn't exist during a stocktake, because of the way the transaction is opened, you can't add a new beer to the DB and then scan it in as part of the stocktake. So you have to sit it to the side and scan it in a new purchase.
Stocktake should be able to attach a barcode to a beer. The process should be that you scan all the barcodes, and stocktake tells you if a barcode (and quantity) doesn't match a beer. You can then link the barcode to a beer inst, and the stock take works. Else you should be able to create the beer and beerinst then link the barcodes to them.