Fix for broken  Template Documents tab on Loan UI

similarly to https://github.com/openMF/mifosx-community-apps/pull/406 for Client, the UGD tab on Loan was also broken.. not with the same JS, the templates ARE listed on the tab, but clicking on them leads to a missing function error (which this fixes).

I would be grateful if you could pull & integrate this ASAP and update https://demo.openmf.org/?&mode=dev# with it (that's probably automatic) - this would enable us to demo UGD more easily e.g. at the upcoming Mifos summit.

Thank you!