Currently, the accrueUP function's maximum cap field is on the day that the script runs. Which means if the employee uses some time in the specified category, the next time it runs it will accrue. This function needs to honor two additional date fields. If neither are specified, then it would function as it currently does. If specified, the Maximum cap field will look for the total amount accrued for that category in the time period defined by the dates and cap at that value. By providing this functionality in the function, it really simplifies the number of buckets and code needed for clients who accrue per pay with annual maximums that may or may not fall within year boundaries.