EST-413: Make invoice calculation less eager to support the calculation of periods outside the interval of the lease.

This is needed for leases that have the tenancy end date set back but have invoices after the new tenancy end date that must be reversed.