Check if the object is an order, and do a sum over line_items instead