fix dumb bug and sort invoice items