fixed issue 340 & 400

Issues regarding to loan and pentaho reports