A characterization of orders of finite lattice type