ordertable2points function

Calculate points from an order table