added a function to calculate current term for trainees in accounts.py