Modified yearend code to do year closing by department