Dynamics GP Payment Term dates are sometimes difficult to calculate, there are several different types of calcs that are possible.
This post documents how to call the native taCalcDueDateRM stored procedure, all the calcs are doe for you.