fixed MIFOSX-301 issues and added loan type and template type to loan