wip:improving tracebililty for loan transaction updates

The logic is a bit iffy (didn't get a chance to spend time on it today) but wanted to make it a habit to push in code on a daily basis.

Will test it out thoroughly tomorrow and fix known issues (unnecessary reversals even when past dated transactions do not affect transactions in future etc)