Fixes bug in getSalesByProduct