Painless script for inventory of previous week

It'd be great if you could please not create multiple topics on the same question. It looks like you have a solution here, so let's close this one - Difference between today's sales and yesterday's sales