Fix adding classes to wrong rows in Purchase