Merge pull request #1 from deepak-srivastava/hr

CRM-12623, towards hr detail report
Merge pull request #2 from deepak-srivastava/hr

CRM-12623 mgd and other misc fixes