compute totals from sales