fix updating default consumption when product doesn't have valid code

http://manage.dimagi.com/default.asp?124149
I'm not a fan of single-letter variable names in multi-line contexts. Feel free to self-merge if you disagree.