Implemented unit test and logic to generate invoice period dates.