Fix getting the accounting period start date when the date passed is at a period boundary