Added invoice cutoff function