Improve optical receipt calculation

Change-Id: I585bdca45f62724abf66ec8af1835ae67953325b