
Property changes on: .
___________________________________________________________________
Name: svn:ignore
   - bin
docs
build
dist
Mifos_log.log.200*
junit13459892.properties
.metadata

   + bin
docs
build
dist
Mifos_log.log.200*
junit13459892.properties
.metadata
classes


Index: test/org/mifos/application/collectionsheet/business/CollectionSheetBOTest.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetBOTest.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetBOTest.java	(revision 0)
@@ -0,0 +1,36 @@
+package org.mifos.application.collectionsheet.business;
+
+import java.sql.Date;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.collectionsheet.persistence.CollectionSheetPersistence;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.DateUtils;
+
+public class CollectionSheetBOTest extends MifosTestCase {
+	public void testRetrieveCollectionSheetMeetingDateReturnsAllCollectionSheetsForSpecifiedMeeting()
+			throws Exception {
+		Session session = HibernateUtil.getSessionTL();
+		Transaction transaction = session.beginTransaction();
+		Date year2010 = DateUtils.getSqlDate(2010, Calendar.JANUARY, 1);
+		CollectionSheetBO collectionSheet = new CollectionSheetBO();
+		collectionSheet.setCollSheetDate(year2010);
+		collectionSheet.setRunDate(new Date(System.currentTimeMillis()));
+		collectionSheet.create();
+		HashMap queryParameters = new HashMap();
+		queryParameters.put("MEETING_DATE", year2010);
+		List matchingCollectionSheets = new CollectionSheetPersistence()
+				.executeNamedQuery(
+						NamedQueryConstants.COLLECTION_SHEETS_FOR_MEETING_DATE,
+						queryParameters);
+		assertEquals(1, matchingCollectionSheets.size());
+		assertEquals(collectionSheet, matchingCollectionSheets.get(0));
+		transaction.rollback();
+	}
+}
Index: test/org/mifos/application/collectionsheet/business/CollectionSheetSavingDetailsEntityFixture.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetSavingDetailsEntityFixture.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetSavingDetailsEntityFixture.java	(revision 0)
@@ -0,0 +1,11 @@
+package org.mifos.application.collectionsheet.business;
+
+public class CollectionSheetSavingDetailsEntityFixture {
+
+	public static CollSheetSavingsDetailsEntity createSavingsDetails(Integer accountId) {
+		CollSheetSavingsDetailsEntity savingDetails = new CollSheetSavingsDetailsEntity();
+		savingDetails.setAccountId(accountId);
+		return savingDetails;
+	}
+
+}
Index: test/org/mifos/application/collectionsheet/business/CollectionSheetLoanDetailsEntityFixture.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetLoanDetailsEntityFixture.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetLoanDetailsEntityFixture.java	(revision 0)
@@ -0,0 +1,16 @@
+package org.mifos.application.collectionsheet.business;
+
+
+public class CollectionSheetLoanDetailsEntityFixture {
+
+	public static CollSheetLnDetailsEntity createLoanDetails() {
+		return new CollSheetLnDetailsEntity();
+	}
+
+	public static CollSheetLnDetailsEntity createLoanDetails(Integer accountId) {
+		CollSheetLnDetailsEntity collectionSheet = new CollSheetLnDetailsEntity();
+		collectionSheet.setAccountId(accountId);
+		return collectionSheet;
+	}
+
+}
Index: test/org/mifos/application/collectionsheet/business/CollectionSheetReportTestSuite.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetReportTestSuite.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetReportTestSuite.java	(revision 0)
@@ -0,0 +1,19 @@
+package org.mifos.application.collectionsheet.business;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.mifos.application.reports.business.service.CollectionSheetReportServiceTest;
+import org.mifos.application.reports.business.service.CollectionSheetServiceTest;
+
+
+public class CollectionSheetReportTestSuite extends TestSuite {
+	public static Test suite() throws Exception {
+		TestSuite suite = new TestSuite();
+		suite.addTestSuite(CollectionSheetBOTest.class);
+		suite.addTestSuite(CollectionSheetReportServiceTest.class);
+		suite.addTestSuite(CollectionSheetServiceTest.class);
+		return suite;
+	}
+}
Index: test/org/mifos/application/collectionsheet/business/CollectionSheetBOFixture.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetBOFixture.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetBOFixture.java	(revision 0)
@@ -0,0 +1,13 @@
+package org.mifos.application.collectionsheet.business;
+
+import java.util.HashSet;
+
+import org.mifos.framework.util.helpers.DateUtils;
+
+public class CollectionSheetBOFixture {
+
+	public static CollectionSheetBO createCollectionSheet() {
+		return new CollectionSheetBO(DateUtils.sqlToday(), DateUtils.sqlToday(), new HashSet<CollSheetCustBO>(), null);
+	}
+
+}
Index: test/org/mifos/application/collectionsheet/business/CollectionSheetCustomerBOFixture.java
===================================================================
--- test/org/mifos/application/collectionsheet/business/CollectionSheetCustomerBOFixture.java	(revision 0)
+++ test/org/mifos/application/collectionsheet/business/CollectionSheetCustomerBOFixture.java	(revision 0)
@@ -0,0 +1,10 @@
+package org.mifos.application.collectionsheet.business;
+
+public class CollectionSheetCustomerBOFixture {
+
+	public static CollSheetCustBO createCollectionSheet() {
+		CollSheetCustBO collectionSheet = new CollSheetCustBO();
+		collectionSheet.setCollectionSheet(CollectionSheetBOFixture.createCollectionSheet());
+		return collectionSheet;
+	}
+}
Index: test/org/mifos/application/reports/persistence/DateSelectionItemPersistenceTest.java
===================================================================
--- test/org/mifos/application/reports/persistence/DateSelectionItemPersistenceTest.java	(revision 0)
+++ test/org/mifos/application/reports/persistence/DateSelectionItemPersistenceTest.java	(revision 0)
@@ -0,0 +1,44 @@
+package org.mifos.application.reports.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.util.helpers.DateUtils;
+
+public class DateSelectionItemPersistenceTest extends MifosTestCase {
+
+	private static final Date FROM_DATE = DateUtils.getDate(2007,
+								Calendar.JUNE, 1);
+	private static final Short LOAN_OFFICER_ID = Short.valueOf("19");
+	private static final Short BRANCH_ID = Short.valueOf("2");
+
+	public void testRetrievesMeetingDatesFromNamedQueryParamForCenter() throws Exception {
+		List<DateSelectionItem> meetingDates = null;
+		try {
+			meetingDates = new DateSelectionItemPersistence().getMeetingDates(
+					BRANCH_ID, LOAN_OFFICER_ID, 5609,
+					CustomerLevel.CENTER.getValue(), FROM_DATE);
+		}
+		catch (Exception e) {
+			fail("Should not throw any exceptions");
+		}
+		assertFalse(meetingDates.isEmpty());
+	}
+
+	public void testRetrievesMeetingDatesFromNamedQueryParamForGroupLevel() throws Exception {
+		List<DateSelectionItem> meetingDates = null;
+		try {
+			meetingDates = new DateSelectionItemPersistence().getMeetingDates(
+					BRANCH_ID, LOAN_OFFICER_ID, 5612,
+					CustomerLevel.GROUP.getValue(), FROM_DATE);
+		}
+		catch (Exception e) {
+			fail("Should not throw any exceptions");
+		}
+		assertFalse(meetingDates.isEmpty());
+	}
+}
Index: test/org/mifos/application/reports/struts/action/BirtReportValidationFilterTest.java
===================================================================
--- test/org/mifos/application/reports/struts/action/BirtReportValidationFilterTest.java	(revision 0)
+++ test/org/mifos/application/reports/struts/action/BirtReportValidationFilterTest.java	(revision 0)
@@ -0,0 +1,24 @@
+package org.mifos.application.reports.struts.action;
+
+import junit.framework.TestCase;
+import servletunit.FilterChainSimulator;
+import servletunit.HttpServletRequestSimulator;
+import servletunit.HttpServletResponseSimulator;
+import servletunit.ServletContextSimulator;
+
+public class BirtReportValidationFilterTest extends TestCase {
+	public void testValidationForCollectionSheetReportWhenBranchIdIsSelect()
+			throws Exception {
+		BirtReportValidationFilter validationFilter = new BirtReportValidationFilter();
+		HttpServletRequestSimulator request = new HttpServletRequestSimulator(
+						new ServletContextSimulator());
+		HttpServletResponseSimulator response = new HttpServletResponseSimulator();
+		FilterChainSimulator filterChain = new FilterChainSimulator();
+		request.setParameterValue("branchId", new String[]{"-2"});
+		validationFilter.doFilter(request,
+				response, filterChain);
+		assertEquals(HttpServletResponseSimulator.SC_MOVED_TEMPORARILY,response.getStatusCode());
+		assertEquals("/mifos", response.getHeader("Location"));
+		
+	}
+}
Index: test/org/mifos/application/reports/business/DetailedAgingPortfolioReportParametersTest.java
===================================================================
--- test/org/mifos/application/reports/business/DetailedAgingPortfolioReportParametersTest.java	(revision 0)
+++ test/org/mifos/application/reports/business/DetailedAgingPortfolioReportParametersTest.java	(revision 0)
@@ -0,0 +1,65 @@
+package org.mifos.application.reports.business;
+
+import org.mifos.application.reports.business.validator.Errors;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+
+import junit.framework.TestCase;
+
+public class DetailedAgingPortfolioReportParametersTest extends TestCase {
+
+	private Errors errorsMock;
+
+	public void testValidatorNoErrorIfAllParamsValid() throws Exception {
+		DetailedAgingPortfolioReportParameters reportParameters = new DetailedAgingPortfolioReportParameters(
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID);
+		replay(errorsMock);
+		reportParameters.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsErrorIfBranchIdIsSelect() throws Exception {
+		DetailedAgingPortfolioReportParameters reportParameters = new DetailedAgingPortfolioReportParameters(
+				DetailedAgingPortfolioReportParameters.INVALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID);
+		errorsMock.rejectValue(DetailedAgingPortfolioReportParameters.BRANCH_ID_PARAM, 
+				DetailedAgingPortfolioReportParameters.BRANCH_ID_INVALID_MSG);
+		replay(errorsMock);
+		reportParameters.validate(errorsMock);
+		verify(errorsMock);
+	}
+	
+	public void testValidatorReturnsErrorIfLoanOfficerIsSelect() throws Exception {
+		DetailedAgingPortfolioReportParameters reportParameters = new DetailedAgingPortfolioReportParameters(
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.INVALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID);
+		errorsMock.rejectValue(DetailedAgingPortfolioReportParameters.LOAN_OFFICER_ID_PARAM, 
+				DetailedAgingPortfolioReportParameters.LOAN_OFFICER_ID_INVALID_MSG);
+		replay(errorsMock);
+		reportParameters.validate(errorsMock);
+		verify(errorsMock);
+	}
+	
+	public void testValidatorReturnsErrorIfLoanProductIsSelect() throws Exception {
+		DetailedAgingPortfolioReportParameters reportParameters = new DetailedAgingPortfolioReportParameters(
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.VALID_ID,
+				DetailedAgingPortfolioReportParameters.INVALID_ID);
+		errorsMock.rejectValue(DetailedAgingPortfolioReportParameters.LOAN_PRODUCT_ID,
+				DetailedAgingPortfolioReportParameters.LOAN_PRODUCT_ID_INVALID_MSG);
+		replay(errorsMock);
+		reportParameters.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		errorsMock = createMock(Errors.class);
+	}
+}
Index: test/org/mifos/application/reports/business/service/CollectionSheetReportServiceTest.java
===================================================================
--- test/org/mifos/application/reports/business/service/CollectionSheetReportServiceTest.java	(revision 0)
+++ test/org/mifos/application/reports/business/service/CollectionSheetReportServiceTest.java	(revision 0)
@@ -0,0 +1,890 @@
+package org.mifos.application.reports.business.service;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_GROUP_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.framework.util.CollectionUtils.asList;
+import static org.mifos.framework.util.helpers.NumberUtils.convertIntegerToShort;
+import static org.mifos.framework.util.helpers.NumberUtils.convertShortToInteger;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.accounts.business.service.AccountBusinessService;
+import org.mifos.application.accounts.loan.business.LoanBO;
+import org.mifos.application.accounts.savings.business.SavingsBO;
+import org.mifos.application.collectionsheet.business.CollSheetCustBO;
+import org.mifos.application.collectionsheet.business.CollSheetLnDetailsEntity;
+import org.mifos.application.collectionsheet.business.CollSheetSavingsDetailsEntity;
+import org.mifos.application.collectionsheet.business.CollectionSheetCustomerBOFixture;
+import org.mifos.application.collectionsheet.business.CollectionSheetLoanDetailsEntityFixture;
+import org.mifos.application.collectionsheet.business.CollectionSheetSavingDetailsEntityFixture;
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.business.service.CustomerBusinessService;
+import org.mifos.application.customer.center.business.CenterBO;
+import org.mifos.application.customer.group.business.GroupBO;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.office.business.OfficeBO;
+import org.mifos.application.office.business.OfficecFixture;
+import org.mifos.application.office.business.service.OfficeBusinessService;
+import org.mifos.application.personnel.business.CustomerFixture;
+import org.mifos.application.personnel.business.PersonnelBO;
+import org.mifos.application.personnel.business.PersonnelFixture;
+import org.mifos.application.personnel.business.service.PersonnelBusinessService;
+import org.mifos.application.productdefinition.business.LoanOfferingBO;
+import org.mifos.application.productdefinition.business.SavingsOfferingBO;
+import org.mifos.application.productdefinition.business.service.LoanPrdBusinessService;
+import org.mifos.application.productdefinition.business.service.SavingsPrdBusinessService;
+import org.mifos.application.reports.business.dto.CollectionSheetReportDTO;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.application.reports.ui.SelectionItemFixture;
+import org.mifos.framework.components.logger.MifosLogManager;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.FilePaths;
+
+public class CollectionSheetReportServiceTest extends
+		AbstractCollectionSheetTestCase {
+
+	private static final Integer PERSONNEL_ANY_ID = Integer.valueOf(100);
+	private static final Short PERSONNEL_ANY_SHORT_ID = convertIntegerToShort(PERSONNEL_ANY_ID);
+	private static final Short BSKL_PRODUCT_OFFERING_ID = Short.valueOf("1");
+	private static final Short CL_PRODUCT_OFFERING_ID = Short.valueOf("2");
+	private static final Short MM1_SAVINGS_PRODUCT_ID = Short.valueOf("4");
+	private static final Short MM2_SAVINGS_PRODUCT_ID = Short.valueOf("5");
+	private static final Short SK_SAVING_PRD_OFFERING_ID = Short.valueOf("7");
+
+	private static final Integer CL_LOAN_ACCNT_ID = Integer.valueOf(1);
+	private static final Integer BSKL_LOAN_ACCNT_ID = Integer.valueOf(2);
+	private static final Integer MM1_SAVINGS_ACCNT_ID = Integer.valueOf(3);
+	private static final Integer SK_SAVINGS_ACCNT_ID = Integer.valueOf(4);
+
+	private static final OfficeBO OFFICE = OfficecFixture
+			.createOffice(BRANCH_SHORT_ID);
+	private static final SelectionItem OFFICE_SELECTION_ITEM = new SelectionItem(
+			OFFICE.getOfficeId(), OFFICE.getOfficeName());
+	private static final PersonnelBO ANY_PERSONNEL = PersonnelFixture
+			.createNonLoanOfficer(PERSONNEL_ANY_SHORT_ID);
+	private OfficeBusinessService officeBusinessServiceMock;
+	private CollectionSheetReportService collectionSheetReportService;
+	private CustomerBusinessService customerBusinessServiceMock;
+	private List<OfficeBO> branchOffices;
+	private List<SelectionItem> branchOfficesSelectionItems;
+	private PersonnelBusinessService personnelBusinessServiceMock;
+	private List<PersonnelBO> loanOfficers;
+	private List<SelectionItem> loanOfficersSelectionItems;
+	private List<CustomerBO> centers;
+	private List<SelectionItem> centerSelectionItems;
+	private PersonnelBO anyPersonnel;
+	private OfficeBO anyOffice;
+	private CollectionSheetService collectionSheetServiceMock;
+	private java.sql.Date sqlMeetingDate;
+	private Date meetingDate;
+	private List<CollSheetCustBO> anyCollectionSheetCustomer;
+	private AccountBusinessService accountBusinessServiceMock;
+	private LoanPrdBusinessService loanProductBusinessServiceMock;
+	private List<CollSheetCustBO> centerCollectionSheets;
+	private List<CollSheetCustBO> groupsCollectionSheets;
+	private List<CollSheetCustBO> customerCollectionSheets;
+	private CenterBO center;
+	private GroupBO group;
+	private CollSheetCustBO groupCollectionSheet;
+	private CollSheetCustBO centerCollectionSheet;
+	private CollSheetCustBO collectionSheet;
+	private CollSheetLnDetailsEntity bsklLoanDetailsEntity;
+	private LoanOfferingBO bsklLoanProductOffering;
+	private LoanOfferingBO clLoanProductOffering;
+	private CollSheetLnDetailsEntity clLoanDetailsEntity;
+	private SavingsPrdBusinessService savingsProductBusinessServiceMock;
+	private SavingsOfferingBO mm1SavingsProductOffering;
+	private CollSheetSavingsDetailsEntity mm1SavingDetailsEntity;
+	private SavingsOfferingBO skSavingsProductOffering;
+	private CollSheetSavingsDetailsEntity skSavingDetailsEntity;
+	private ReportProductOfferingService reportProductOfferingService;
+	private IReportsParameterService reportsParameterServiceMock;
+
+	public void testGetBranchesCallsOfficeBusinessServiceAndChecksSelect()
+			throws Exception {
+		PersonnelBO personnel = PersonnelFixture
+				.createPersonnel(PERSONNEL_ANY_SHORT_ID);
+
+		expect(
+				reportsParameterServiceMock
+						.getActiveBranchesUnderUser(personnel
+								.getOfficeSearchId())).andReturn(
+				branchOfficesSelectionItems);
+		List<SelectionItem> returnedBranchOffices = retrieveBranchOffices(
+				branchOfficesSelectionItems, personnel);
+		assertEquals(MAX_COUNT + 1, returnedBranchOffices.size());
+		assertEquals(SELECT_BRANCH_OFFICE_SELECTION_ITEM, returnedBranchOffices
+				.get(0));
+	}
+
+	public void testGetNotApplicableBranchOfficeIfNoneExists() throws Exception {
+		List<SelectionItem> returnedBranchOffices = retrieveBranchOffices(
+				new ArrayList<SelectionItem>(), null);
+		assertEquals(1, returnedBranchOffices.size());
+		assertEquals(NA_BRANCH_OFFICE_SELECTION_ITEM, returnedBranchOffices
+				.get(0));
+	}
+
+	private List<SelectionItem> retrieveBranchOffices(
+			List<SelectionItem> branchOffices, PersonnelBO personnel)
+			throws ServiceException, PersistenceException {
+		expect(
+				personnelBusinessServiceMock
+						.getPersonnel(PERSONNEL_ANY_SHORT_ID)).andReturn(
+				personnel);
+		replay(reportsParameterServiceMock);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> returnedBranchOffices = collectionSheetReportService
+				.getBranchOffices(PERSONNEL_ANY_ID);
+		verify(reportsParameterServiceMock);
+		verify(personnelBusinessServiceMock);
+		return returnedBranchOffices;
+	}
+
+	public void testGetNotApplicableLoanOfficerIfBranchNotApplicable()
+			throws Exception {
+		replay(personnelBusinessServiceMock);
+		retrieveAndAssertLoanOfficer(NA_BRANCH_OFFICE_SELECTION_ITEM.getId(),
+				NA_LOAN_OFFICER_SELECTION_ITEM);
+	}
+
+	private void setExpectationForAnyUserWhenRetrievingLoanOfficer()
+			throws ServiceException {
+		expect(
+				personnelBusinessServiceMock
+						.getPersonnel(PERSONNEL_ANY_SHORT_ID)).andReturn(
+				ANY_PERSONNEL);
+	}
+
+	public void testGetSelectLoanOfficerIfBranchIdIsSelect() throws Exception {
+		replay(personnelBusinessServiceMock);
+		retrieveAndAssertLoanOfficer(SELECT_BRANCH_OFFICE_SELECTION_ITEM
+				.getId(), SELECT_LOAN_OFFICER_SELECTION_ITEM);
+	}
+
+	public void testGetActiveLoanOfficersWithOptionForAllLoanOfficer()
+			throws Exception {
+		expect(
+				personnelBusinessServiceMock
+						.getPersonnel(PERSONNEL_ANY_SHORT_ID)).andReturn(
+				ANY_PERSONNEL);
+		expect(
+				reportsParameterServiceMock
+						.getActiveLoanOfficersUnderOffice(ANY_SHORT_ID))
+				.andReturn(loanOfficersSelectionItems);
+		replay(personnelBusinessServiceMock);
+		replay(reportsParameterServiceMock);
+		List<SelectionItem> activeLoanOfficers = collectionSheetReportService
+				.getActiveLoanOfficers(PERSONNEL_ANY_ID, ANY_ID);
+		verify(personnelBusinessServiceMock);
+		verify(reportsParameterServiceMock);
+		assertEquals(MAX_COUNT + 1, activeLoanOfficers.size());
+		assertEquals(ALL_LOAN_OFFICER_SELECTION_ITEM, activeLoanOfficers.get(0));
+	}
+
+	public void testWhenBranchOfficeIdIsNull() throws Exception {
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> activeLoanOfficers = collectionSheetReportService
+				.getActiveLoanOfficers(PERSONNEL_ANY_ID, null);
+		verify(personnelBusinessServiceMock);
+		assertEquals(1, activeLoanOfficers.size());
+		assertEquals(SELECT_LOAN_OFFICER_SELECTION_ITEM, activeLoanOfficers
+				.get(0));
+	}
+
+	public void testRetrieveLoanOfficersReturnNAWhenUserIdDoesNotExist()
+			throws Exception {
+		expect(personnelBusinessServiceMock.getPersonnel(ANY_SHORT_ID))
+				.andReturn(null);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> loanOfficers = collectionSheetReportService
+				.getActiveLoanOfficers(ANY_ID, ANY_ID);
+		verify(personnelBusinessServiceMock);
+		assertEquals(1, loanOfficers.size());
+		assertSame(NA_LOAN_OFFICER_SELECTION_ITEM, loanOfficers.get(0));
+	}
+
+	public void testOnlySelfLoanOfficerPopulatedIfUserIsLoanOfficer()
+			throws Exception {
+		expect(
+				personnelBusinessServiceMock
+						.getPersonnel(PERSONNEL_ANY_SHORT_ID)).andReturn(
+				LOAN_OFFICER);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> activeLoanOfficers = collectionSheetReportService
+				.getActiveLoanOfficers(PERSONNEL_ANY_ID, BRANCH_ID);
+		assertEquals(1, activeLoanOfficers.size());
+		assertEquals(new SelectionItem(LOAN_OFFICER.getPersonnelId(),
+				LOAN_OFFICER.getDisplayName()), activeLoanOfficers.get(0));
+		verify(personnelBusinessServiceMock);
+	}
+
+	public void testLoanOfficerNAWhenNoneExistsForABranch() throws Exception {
+		setExpectationForAnyUserWhenRetrievingLoanOfficer();
+		expect(
+				reportsParameterServiceMock
+						.getActiveLoanOfficersUnderOffice(ANY_SHORT_ID))
+				.andReturn(new ArrayList<SelectionItem>());
+		replay(personnelBusinessServiceMock);
+		replay(reportsParameterServiceMock);
+		retrieveAndAssertLoanOfficer(anyOffice.getOfficeId(),
+				NA_LOAN_OFFICER_SELECTION_ITEM);
+		verify(personnelBusinessServiceMock);
+		verify(reportsParameterServiceMock);
+	}
+
+	private void retrieveAndAssertLoanOfficer(Short officeId,
+			SelectionItem expectedLoanOfficer) throws ServiceException,
+			PersistenceException {
+		List<SelectionItem> activeLoanOfficers = collectionSheetReportService
+				.getActiveLoanOfficers(PERSONNEL_ANY_ID,
+						convertShortToInteger(officeId));
+		verify(personnelBusinessServiceMock);
+		assertEquals(1, activeLoanOfficers.size());
+		assertEquals(expectedLoanOfficer, activeLoanOfficers.get(0));
+	}
+
+	public void testCenterIsSelectLoanOfficerIsSelect() throws Exception {
+		retrieveAndAssertCenterBO(SELECT_LOAN_OFFICER_SELECTION_ITEM.getId(),
+				SelectionItem.SELECT_CENTER_SELECTION_ITEM);
+	}
+
+	public void testCenterForLoanOfficerIsNotApplicable() throws Exception {
+		retrieveAndAssertCenterBO(NA_LOAN_OFFICER_SELECTION_ITEM.getId(),
+				SelectionItem.NA_CENTER_SELECTION_ITEM);
+	}
+
+	public void testCenterWhenLoanOfficerIdNull() throws Exception {
+		retrieveAndAssertCenterBO(null,
+				SelectionItem.SELECT_CENTER_SELECTION_ITEM);
+	}
+
+	public void testCenterForExistingLoanOfficer() throws Exception {
+		expect(
+				reportsParameterServiceMock.getActiveCentersUnderUser(
+						BRANCH_SHORT_ID, anyPersonnel
+								.getPersonnelId())).andReturn(
+				centerSelectionItems);
+		expect(personnelBusinessServiceMock.getPersonnel(ANY_SHORT_ID))
+				.andReturn(anyPersonnel);
+		replay(reportsParameterServiceMock);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> activeCenters = collectionSheetReportService
+				.getActiveCentersForLoanOfficer(ANY_ID, BRANCH_ID);
+		assertEquals(MAX_COUNT + 1, activeCenters.size());
+		assertEquals(SelectionItem.ALL_CENTER_SELECTION_ITEM, activeCenters
+				.get(0));
+		verify(reportsParameterServiceMock);
+		verify(personnelBusinessServiceMock);
+	}
+
+	public void testCenterForAllLoanOfficers() throws Exception {
+		ArrayList<SelectionItem> personnels = new ArrayList<SelectionItem>();
+		SelectionItem otherPersonnel = SelectionItemFixture
+						.createSelectionItem(new Short("2"));
+		personnels.add(otherPersonnel);
+		personnels.add(SelectionItemFixture.createSelectionItem(anyPersonnel.getPersonnelId()));
+		expect(
+				reportsParameterServiceMock
+						.getActiveLoanOfficersUnderOffice(BRANCH_SHORT_ID))
+				.andReturn(personnels);
+		ArrayList<SelectionItem> anyCustomers = new ArrayList<SelectionItem>();
+		SelectionItem anyOneCustomer = SelectionItemFixture
+				.createSelectionItem(1);
+		anyCustomers.add(anyOneCustomer);
+		anyCustomers.add(SelectionItemFixture.createSelectionItem(2));
+		ArrayList<SelectionItem> otherCustomers = new ArrayList<SelectionItem>();
+		SelectionItem otherOneCustomer = SelectionItemFixture
+				.createSelectionItem(3);
+		otherCustomers.add(otherOneCustomer);
+		otherCustomers.add(SelectionItemFixture.createSelectionItem(4));
+		expect(
+				reportsParameterServiceMock.getActiveCentersUnderUser(
+						BRANCH_SHORT_ID, anyPersonnel
+								.getPersonnelId())).andReturn(anyCustomers);
+		expect(
+				reportsParameterServiceMock.getActiveCentersUnderUser(
+						BRANCH_SHORT_ID,
+						otherPersonnel.getId())).andReturn(
+				otherCustomers);
+		replay(reportsParameterServiceMock);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> activeCenters = collectionSheetReportService
+				.getActiveCentersForLoanOfficer(
+						s2i(ALL_LOAN_OFFICER_SELECTION_ITEM.getId()), BRANCH_ID);
+		assertEquals(5, activeCenters.size());
+		assertEquals(SelectionItem.ALL_CENTER_SELECTION_ITEM, activeCenters
+				.get(0));
+		assertTrue(activeCenters.contains(anyOneCustomer));
+		assertTrue(activeCenters.contains(otherOneCustomer));
+		verify(reportsParameterServiceMock);
+		verify(personnelBusinessServiceMock);
+	}
+
+	private void retrieveAndAssertCenterBO(Short loanOfficerId,
+			SelectionItem expectedCenter) throws ServiceException,
+			PersistenceException {
+		List<SelectionItem> centersForLoanOfficer = collectionSheetReportService
+				.getActiveCentersForLoanOfficer(
+						convertShortToInteger(loanOfficerId), null);
+		assertEquals(1, centersForLoanOfficer.size());
+		assertEquals(expectedCenter, centersForLoanOfficer.get(0));
+	}
+
+	private void retrieveAndAssertGroupBO(Short loanOfficerId,
+			SelectionItem expectedGroup) throws ServiceException,
+			PersistenceException {
+		List<SelectionItem> groupsForLoanOfficer = collectionSheetReportService
+				.getActiveGroupsForLoanOfficer(
+						convertShortToInteger(loanOfficerId), BRANCH_ID);
+		assertEquals(1, groupsForLoanOfficer.size());
+		assertEquals(expectedGroup, groupsForLoanOfficer.get(0));
+	}
+
+	public void testGetCollectionSheetForGivenBranchLoanOfficerCenterAndMeetingDate()
+			throws Exception {
+		expect(customerBusinessServiceMock.getCustomer(CENTER_ID)).andReturn(
+				center);
+		expect(
+				collectionSheetServiceMock
+						.getCollectionSheetForCustomerOnMeetingDate(
+								sqlMeetingDate, CENTER_ID,
+								LOAN_OFFICER_SHORT_ID, CustomerLevel.CENTER))
+				.andReturn(centerCollectionSheets);
+		expect(
+				collectionSheetServiceMock.getCollectionSheetForGroups(
+						sqlMeetingDate, centerCollectionSheets.get(0),
+						LOAN_OFFICER_SHORT_ID)).andReturn(
+				groupsCollectionSheets);
+
+		expect(
+				collectionSheetServiceMock.getCollectionSheetForCustomers(
+						sqlMeetingDate, groupsCollectionSheets.get(0),
+						LOAN_OFFICER_SHORT_ID)).andReturn(
+				customerCollectionSheets);
+
+		setProductOfferingExpectation();
+		expect(officeBusinessServiceMock.getOffice(BRANCH_SHORT_ID)).andReturn(
+				OFFICE);
+		replay(collectionSheetServiceMock);
+		replay(customerBusinessServiceMock);
+		replay(officeBusinessServiceMock);
+		replay(loanProductBusinessServiceMock);
+		replay(savingsProductBusinessServiceMock);
+		replay(reportProductOfferingService);
+		List<CollectionSheetReportDTO> collectionSheets = collectionSheetReportService
+				.getCollectionSheets(BRANCH_ID, LOAN_OFFICER_ID, CENTER_ID,
+						sqlMeetingDate, s2i(CustomerLevel.CENTER.getValue()));
+		verify(collectionSheetServiceMock);
+		verify(customerBusinessServiceMock);
+		verify(officeBusinessServiceMock);
+		verify(loanProductBusinessServiceMock);
+		verify(savingsProductBusinessServiceMock);
+		verify(reportProductOfferingService);
+		assertEquals(2, collectionSheets.size());
+	}
+
+	private void setProductOfferingExpectation() throws ServiceException {
+		setLoanOfferingExpectation(
+				CollectionSheetReportServiceTest.BSKL_PRODUCT_OFFERING_ID,
+				CollectionSheetReportServiceTest.CL_PRODUCT_OFFERING_ID);
+		setSavingsOfferingExpectation(
+				CollectionSheetReportServiceTest.MM1_SAVINGS_PRODUCT_ID,
+				CollectionSheetReportServiceTest.MM2_SAVINGS_PRODUCT_ID);
+
+	}
+
+	private void setSavingsOfferingExpectation(Short savingProductOffering1,
+			Short savingProductOffering2) throws ServiceException {
+		expect(reportProductOfferingService.getSavingsProduct1()).andReturn(
+				savingProductOffering1);
+		expect(
+				savingsProductBusinessServiceMock
+						.getSavingsProduct(savingProductOffering1)).andReturn(
+				new SavingsOfferingBO(savingProductOffering1));
+		expect(reportProductOfferingService.getSavingsProduct2()).andReturn(
+				savingProductOffering2);
+		expect(
+				savingsProductBusinessServiceMock
+						.getSavingsProduct(savingProductOffering2)).andReturn(
+				new SavingsOfferingBO(savingProductOffering2));
+	}
+
+	private void setLoanOfferingExpectation(Short loanProductOffering1,
+			Short loanProductOffering2) throws ServiceException {
+		expect(reportProductOfferingService.getLoanProduct1()).andReturn(
+				loanProductOffering1);
+		expect(
+				loanProductBusinessServiceMock
+						.getLoanOffering(loanProductOffering1)).andReturn(
+				new LoanOfferingBO(loanProductOffering1));
+		expect(reportProductOfferingService.getLoanProduct2()).andReturn(
+				loanProductOffering2);
+		expect(
+				loanProductBusinessServiceMock
+						.getLoanOffering(loanProductOffering2)).andReturn(
+				new LoanOfferingBO(loanProductOffering2));
+	}
+
+	public void testGetCollectionSheetForAllCenterOffices() throws Exception {
+		expect(personnelBusinessServiceMock.getPersonnel(LOAN_OFFICER_SHORT_ID))
+				.andReturn(LOAN_OFFICER);
+		expect(
+				customerBusinessServiceMock
+						.getActiveCentersUnderUser(LOAN_OFFICER)).andReturn(
+				centers);
+		expect(officeBusinessServiceMock.getOffice(BRANCH_SHORT_ID)).andReturn(
+				OFFICE);
+
+		for (CustomerBO center : centers) {
+			expect(
+					collectionSheetServiceMock
+							.getCollectionSheetForCustomerOnMeetingDate(
+									sqlMeetingDate, center.getCustomerId(),
+									center.getPersonnel().getPersonnelId(),
+									CustomerLevel.CENTER)).andReturn(
+					centerCollectionSheets);
+			expect(
+					collectionSheetServiceMock.getCollectionSheetForGroups(
+							sqlMeetingDate, centerCollectionSheets.get(0),
+							LOAN_OFFICER_SHORT_ID)).andReturn(
+					groupsCollectionSheets);
+
+			expect(
+					collectionSheetServiceMock.getCollectionSheetForCustomers(
+							sqlMeetingDate, groupCollectionSheet,
+							LOAN_OFFICER_SHORT_ID)).andReturn(
+					anyCollectionSheetCustomer);
+			setProductOfferingExpectation();
+		}
+
+		replay(customerBusinessServiceMock);
+		replay(personnelBusinessServiceMock);
+		replay(collectionSheetServiceMock);
+		replay(officeBusinessServiceMock);
+		replay(loanProductBusinessServiceMock);
+		replay(savingsProductBusinessServiceMock);
+		replay(reportProductOfferingService);
+		List<CollectionSheetReportDTO> collectionSheets = collectionSheetReportService
+				.getCollectionSheets(BRANCH_ID, LOAN_OFFICER_ID, ALL_CENTER_ID,
+						meetingDate, s2i(CustomerLevel.CENTER.getValue()));
+		verify(customerBusinessServiceMock);
+		verify(personnelBusinessServiceMock);
+		verify(collectionSheetServiceMock);
+		verify(officeBusinessServiceMock);
+		verify(loanProductBusinessServiceMock);
+		verify(savingsProductBusinessServiceMock);
+		verify(reportProductOfferingService);
+		assertEquals(MAX_COUNT, collectionSheets.size());
+	}
+
+	public void testCollectionSheetForAllLoanOfficerAllCenterOffices()
+			throws Exception {
+		expect(
+				personnelBusinessServiceMock
+						.getActiveLoanOfficersUnderOffice(convertIntegerToShort(BRANCH_ID)))
+				.andReturn(loanOfficers);
+		int centerId = 100;
+		for (PersonnelBO loanOfficer : loanOfficers) {
+			centerId++;
+			ArrayList<CustomerBO> center = new ArrayList<CustomerBO>();
+			center.add(CustomerFixture.createCenterBO(
+					Integer.valueOf(centerId), loanOfficer));
+			expect(
+					customerBusinessServiceMock
+							.getActiveCentersUnderUser(loanOfficer)).andReturn(
+					center);
+			expect(
+					collectionSheetServiceMock
+							.getCollectionSheetForCustomerOnMeetingDate(
+									sqlMeetingDate, Integer.valueOf(centerId),
+									loanOfficer.getPersonnelId(),
+									CustomerLevel.CENTER)).andReturn(
+					centerCollectionSheets);
+			expect(
+					collectionSheetServiceMock.getCollectionSheetForGroups(
+							sqlMeetingDate, centerCollectionSheet, loanOfficer
+									.getPersonnelId())).andReturn(
+					groupsCollectionSheets);
+			expect(
+					collectionSheetServiceMock.getCollectionSheetForCustomers(
+							sqlMeetingDate, groupCollectionSheet, loanOfficer
+									.getPersonnelId())).andReturn(
+					customerCollectionSheets);
+			setProductOfferingExpectation();
+		}
+		expect(officeBusinessServiceMock.getOffice(BRANCH_SHORT_ID)).andReturn(
+				OFFICE);
+		replay(personnelBusinessServiceMock);
+		replay(customerBusinessServiceMock);
+		replay(collectionSheetServiceMock);
+		replay(officeBusinessServiceMock);
+		replay(loanProductBusinessServiceMock);
+		replay(savingsProductBusinessServiceMock);
+		replay(reportProductOfferingService);
+		List<CollectionSheetReportDTO> collectionSheets = collectionSheetReportService
+				.getCollectionSheets(BRANCH_ID, ALL_LOAN_OFFICER_ID,
+						ALL_CENTER_ID, meetingDate, s2i(CustomerLevel.CENTER
+								.getValue()));
+		verify(personnelBusinessServiceMock);
+		verify(customerBusinessServiceMock);
+		verify(collectionSheetServiceMock);
+		verify(officeBusinessServiceMock);
+		verify(loanProductBusinessServiceMock);
+		verify(savingsProductBusinessServiceMock);
+		verify(reportProductOfferingService);
+		assertEquals(MAX_COUNT * 2, collectionSheets.size());
+	}
+
+	public void testBsklProductFilterReturnsLoanProductWithBsklOfferingType()
+			throws Exception {
+		expect(
+				loanProductBusinessServiceMock
+						.getLoanOffering(BSKL_PRODUCT_OFFERING_ID)).andReturn(
+				bsklLoanProductOffering);
+
+		expect(accountBusinessServiceMock.getAccount(BSKL_LOAN_ACCNT_ID))
+				.andReturn(new LoanBO(bsklLoanProductOffering));
+
+		replay(accountBusinessServiceMock);
+		replay(loanProductBusinessServiceMock);
+
+		CollSheetLnDetailsEntity filteredLoanDetailEntity = collectionSheetReportService
+				.getLoanProduct(collectionSheet, collectionSheetReportService
+						.getLoanOffering(BSKL_PRODUCT_OFFERING_ID));
+		assertNotNull(filteredLoanDetailEntity);
+		assertSame(bsklLoanDetailsEntity, filteredLoanDetailEntity);
+		verify(accountBusinessServiceMock);
+		verify(loanProductBusinessServiceMock);
+	}
+
+	public void testClLoanProductFilterReturnsLoanProductWithClLoanOfferingType()
+			throws Exception {
+		expect(
+				loanProductBusinessServiceMock
+						.getLoanOffering(CL_PRODUCT_OFFERING_ID)).andReturn(
+				clLoanProductOffering);
+
+		expect(accountBusinessServiceMock.getAccount(CL_LOAN_ACCNT_ID))
+				.andReturn(new LoanBO(clLoanProductOffering));
+		expect(accountBusinessServiceMock.getAccount(BSKL_LOAN_ACCNT_ID))
+				.andReturn(new LoanBO(bsklLoanProductOffering));
+
+		replay(accountBusinessServiceMock);
+		replay(loanProductBusinessServiceMock);
+
+		CollSheetLnDetailsEntity filteredLoanDetailEntity = collectionSheetReportService
+				.getLoanProduct(collectionSheet, collectionSheetReportService
+						.getLoanOffering(CL_PRODUCT_OFFERING_ID));
+		assertNotNull(filteredLoanDetailEntity);
+		assertSame(clLoanDetailsEntity, filteredLoanDetailEntity);
+		verify(accountBusinessServiceMock);
+		verify(loanProductBusinessServiceMock);
+	}
+
+	public void testMm1SavingsProductFilterReturnsSavingsProductWithMm1OfferingType()
+			throws Exception {
+		expect(
+				savingsProductBusinessServiceMock
+						.getSavingsProduct(MM1_SAVINGS_PRODUCT_ID)).andReturn(
+				mm1SavingsProductOffering);
+
+		expect(accountBusinessServiceMock.getAccount(MM1_SAVINGS_ACCNT_ID))
+				.andReturn(new SavingsBO(mm1SavingsProductOffering));
+		expect(accountBusinessServiceMock.getAccount(SK_SAVINGS_ACCNT_ID))
+				.andReturn(new SavingsBO(skSavingsProductOffering));
+
+		replay(savingsProductBusinessServiceMock);
+		replay(accountBusinessServiceMock);
+
+		CollSheetSavingsDetailsEntity filteredSavingsDetailEntity = collectionSheetReportService
+				.getSavingProduct(collectionSheet, collectionSheetReportService
+						.getSavingsOffering(MM1_SAVINGS_PRODUCT_ID));
+		assertNotNull(filteredSavingsDetailEntity);
+		assertSame(mm1SavingDetailsEntity, filteredSavingsDetailEntity);
+		verify(savingsProductBusinessServiceMock);
+		verify(accountBusinessServiceMock);
+	}
+
+	public void testGetMeetingDatesForCenterWhenSpecifiedBranchOfficerAndCenter()
+			throws Exception {
+		expect(
+				reportsParameterServiceMock.getMeetingDates(BRANCH_SHORT_ID,
+						LOAN_OFFICER_SHORT_ID, CENTER_ID, CustomerLevel.CENTER,
+						DateUtils.getSqlDate(2007, Calendar.JUNE, 30)))
+				.andReturn(new ArrayList<DateSelectionItem>());
+		replay(reportsParameterServiceMock);
+		collectionSheetReportService.getMeetingDatesForCenter(BRANCH_ID,
+				CENTER_ID, LOAN_OFFICER_ID);
+		verify(reportsParameterServiceMock);
+	}
+
+	public void testGetMeetingDatesForGroupsWhenSpecifiedBranchOfficerAndCenter()
+	throws Exception {
+		expect(
+				reportsParameterServiceMock.getMeetingDates(BRANCH_SHORT_ID,
+						LOAN_OFFICER_SHORT_ID, GROUP_ID, CustomerLevel.GROUP,
+						DateUtils.getSqlDate(2007, Calendar.JUNE, 30)))
+						.andReturn(new ArrayList<DateSelectionItem>());
+		replay(reportsParameterServiceMock);
+		collectionSheetReportService.getMeetingDatesForGroup(BRANCH_ID,
+				GROUP_ID, LOAN_OFFICER_ID);
+		verify(reportsParameterServiceMock);
+	}
+	
+	public void testGetMeetingDatesForCeneterWhenSpecifiedBranchAllOfficerAndCenterParameters()
+			throws Exception {
+		expect(reportsParameterServiceMock.getMeetingDates(BRANCH_SHORT_ID,
+				center.getPersonnel().getPersonnelId(), CENTER_ID, CustomerLevel.CENTER,
+				DateUtils.getSqlDate(2007, Calendar.JUNE, 30))).andReturn(new ArrayList<DateSelectionItem>());
+		expect(customerBusinessServiceMock.getCustomer(CENTER_ID)).andReturn(
+				center);
+		replay(customerBusinessServiceMock);
+		replay(reportsParameterServiceMock);
+		collectionSheetReportService.getMeetingDatesForCenter(BRANCH_ID,
+				CENTER_ID, ALL_LOAN_OFFICER_ID);
+		verify(customerBusinessServiceMock);
+		verify(reportsParameterServiceMock);
+	}
+
+	public void testGetMeetingDatesForGroupsWhenSpecifiedBranchAllOfficerAndCenterParameters()
+	throws Exception {
+		expect(reportsParameterServiceMock.getMeetingDates(BRANCH_SHORT_ID,
+				center.getPersonnel().getPersonnelId(), GROUP_ID, CustomerLevel.GROUP,
+				DateUtils.getSqlDate(2007, Calendar.JUNE, 30))).andReturn(new ArrayList<DateSelectionItem>());
+		expect(customerBusinessServiceMock.getCustomer(GROUP_ID)).andReturn(
+				group);
+		replay(customerBusinessServiceMock);
+		replay(reportsParameterServiceMock);
+		collectionSheetReportService.getMeetingDatesForGroup(BRANCH_ID,
+				GROUP_ID, ALL_LOAN_OFFICER_ID);
+		verify(customerBusinessServiceMock);
+		verify(reportsParameterServiceMock);
+	}
+	
+	public void testGetMeetingDatesForCenterWhenNACenter() throws Exception {
+		List<org.mifos.application.reports.ui.DateSelectionItem> meetingDates = collectionSheetReportService
+				.getMeetingDatesForCenter(
+						BRANCH_ID,
+						convertShortToInteger(NA_CENTER_SELECTION_ITEM.getId()),
+						convertShortToInteger(NA_LOAN_OFFICER_SELECTION_ITEM
+								.getId()));
+		assertEquals(1, meetingDates.size());
+	}
+
+	public void testMeetingDateForGroupForNACenter() throws Exception {
+		List<org.mifos.application.reports.ui.DateSelectionItem> meetingDates = collectionSheetReportService
+		.getMeetingDatesForGroup(
+				BRANCH_ID,
+				convertShortToInteger(NA_CENTER_SELECTION_ITEM.getId()),
+				convertShortToInteger(NA_LOAN_OFFICER_SELECTION_ITEM
+						.getId()));
+		assertEquals(1, meetingDates.size());
+	}
+	
+	public void testForALoanOfficerUserOnlyBranchOfficeRelatedPopulated()
+			throws Exception {
+		expect(personnelBusinessServiceMock.getPersonnel(LOAN_OFFICER_SHORT_ID))
+				.andReturn(LOAN_OFFICER);
+		expect(
+				reportsParameterServiceMock
+						.getActiveBranchesUnderUser(LOAN_OFFICER
+								.getOfficeSearchId())).andReturn(
+				asList(OFFICE_SELECTION_ITEM));
+		replay(personnelBusinessServiceMock);
+		replay(reportsParameterServiceMock);
+		List<SelectionItem> offices = collectionSheetReportService
+				.getBranchOffices(LOAN_OFFICER_ID);
+		verify(personnelBusinessServiceMock);
+		verify(reportsParameterServiceMock);
+		assertEquals(2, offices.size());
+		assertSame(SELECT_BRANCH_OFFICE_SELECTION_ITEM, offices.get(0));
+		assertSame(OFFICE_SELECTION_ITEM, offices.get(1));
+	}
+
+	public void testGroupIsSelectLoanOfficerIsSelect() throws Exception {
+		retrieveAndAssertGroupBO(
+				SelectionItem.SELECT_LOAN_OFFICER_SELECTION_ITEM.getId(),
+				SelectionItem.SELECT_GROUP_SELECTION_ITEM);
+	}
+
+	public void testGroupForLoanOfficerIsNotApplicable() throws Exception {
+		retrieveAndAssertGroupBO(SelectionItem.NA_LOAN_OFFICER_SELECTION_ITEM
+				.getId(), SelectionItem.NA_GROUP_SELECTION_ITEM);
+	}
+
+	public void testGroupWhenLoanOfficerIdNull() throws Exception {
+		retrieveAndAssertGroupBO(null,
+				SelectionItem.SELECT_GROUP_SELECTION_ITEM);
+	}
+
+	public void testGetActiveGroupsForLoanOfficerAndBranch() throws Exception {
+		expect(
+				reportsParameterServiceMock.getActiveGroupsUnderUser(
+						BRANCH_SHORT_ID, LOAN_OFFICER.getPersonnelId()))
+				.andReturn(asList(new SelectionItem(Short.valueOf("1"), "")));
+		expect(
+				personnelBusinessServiceMock.getPersonnel(LOAN_OFFICER
+						.getPersonnelId())).andReturn(LOAN_OFFICER);
+		replay(reportsParameterServiceMock);
+		replay(personnelBusinessServiceMock);
+		List<SelectionItem> activeGroupsUnderUser = collectionSheetReportService
+				.getActiveGroupsForLoanOfficer(LOAN_OFFICER_ID, BRANCH_ID);
+		assertEquals(2, activeGroupsUnderUser.size());
+		assertEquals(ALL_GROUP_SELECTION_ITEM, activeGroupsUnderUser.get(0));
+		verify(reportsParameterServiceMock);
+		verify(personnelBusinessServiceMock);
+	}
+
+	public void testGroupForAllLoanOfficers() throws Exception {
+		ArrayList<SelectionItem> personnels = new ArrayList<SelectionItem>();
+		personnels.add(SelectionItemFixture.createSelectionItem(anyPersonnel
+				.getPersonnelId()));
+		SelectionItem otherPersonnel = SelectionItemFixture
+				.createSelectionItem(new Short("2"));
+		personnels.add(otherPersonnel);
+
+		ArrayList<SelectionItem> anyCustomers = new ArrayList<SelectionItem>();
+		SelectionItem anyOneCustomer = SelectionItemFixture
+				.createSelectionItem(new Integer(1));
+		anyCustomers.add(anyOneCustomer);
+		anyCustomers.add(SelectionItemFixture.createSelectionItem(2));
+
+		ArrayList<SelectionItem> otherCustomers = new ArrayList<SelectionItem>();
+		SelectionItem otherOneCustomer = SelectionItemFixture
+				.createSelectionItem(3);
+		otherCustomers.add(otherOneCustomer);
+		otherCustomers.add(SelectionItemFixture.createSelectionItem(4));
+		expect(
+				reportsParameterServiceMock
+						.getActiveLoanOfficersUnderOffice(ANY_SHORT_ID))
+				.andReturn(personnels);
+		expect(
+				reportsParameterServiceMock.getActiveGroupsUnderUser(
+						ANY_SHORT_ID, anyPersonnel.getPersonnelId()))
+				.andReturn(anyCustomers);
+		expect(
+				reportsParameterServiceMock.getActiveGroupsUnderUser(
+						ANY_SHORT_ID, otherPersonnel.getId())).andReturn(
+				otherCustomers);
+
+		replay(reportsParameterServiceMock);
+		replay(personnelBusinessServiceMock);
+
+		List<SelectionItem> activeGroups = collectionSheetReportService
+				.getActiveGroupsForLoanOfficer(ALL_LOAN_OFFICER_ID, ANY_ID);
+		assertEquals(5, activeGroups.size());
+		assertEquals(SelectionItem.ALL_GROUP_SELECTION_ITEM, activeGroups
+				.get(0));
+		assertTrue(activeGroups.contains(new SelectionItem(anyOneCustomer
+				.getId(), anyOneCustomer.getDisplayName())));
+		assertTrue(activeGroups.contains(new SelectionItem(otherOneCustomer
+				.getId(), otherOneCustomer.getDisplayName())));
+		verify(reportsParameterServiceMock);
+		verify(personnelBusinessServiceMock);
+	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		meetingDate = DateUtils.getDate(2000, Calendar.JANUARY, 1);
+		sqlMeetingDate = DateUtils.convertToSqlDate(meetingDate);
+		MifosLogManager.configure(FilePaths.LOGFILE);
+		collectionSheetServiceMock = createMock(CollectionSheetService.class);
+		officeBusinessServiceMock = createMock(OfficeBusinessService.class);
+		personnelBusinessServiceMock = createMock(PersonnelBusinessService.class);
+		customerBusinessServiceMock = createMock(CustomerBusinessService.class);
+		accountBusinessServiceMock = createMock(AccountBusinessService.class);
+		loanProductBusinessServiceMock = createMock(LoanPrdBusinessService.class);
+		savingsProductBusinessServiceMock = createMock(SavingsPrdBusinessService.class);
+		reportProductOfferingService = createMock(ReportProductOfferingService.class);
+		reportsParameterServiceMock = createMock(ReportsParameterService.class);
+		collectionSheetReportService = new CollectionSheetReportService(
+				collectionSheetServiceMock, officeBusinessServiceMock,
+				personnelBusinessServiceMock, customerBusinessServiceMock,
+				accountBusinessServiceMock, loanProductBusinessServiceMock,
+				savingsProductBusinessServiceMock,
+				reportProductOfferingService, reportsParameterServiceMock);
+		branchOffices = new ArrayList<OfficeBO>();
+		branchOfficesSelectionItems = new ArrayList<SelectionItem>();
+		loanOfficers = new ArrayList<PersonnelBO>();
+		loanOfficersSelectionItems = new ArrayList<SelectionItem>();
+		centers = new ArrayList<CustomerBO>();
+		centerSelectionItems = new ArrayList<SelectionItem>();
+		for (int i = 0; i < MAX_COUNT; i++) {
+			OfficeBO office = OfficecFixture.createOffice(String.valueOf(i));
+			branchOffices.add(office);
+			branchOfficesSelectionItems.add(new SelectionItem(office
+					.getOfficeId(), office.getOfficeName()));
+			PersonnelBO loanOfficer = PersonnelFixture
+					.createPersonnel(new Short(String.valueOf(i)));
+			loanOfficers.add(loanOfficer);
+			loanOfficersSelectionItems.add(new SelectionItem(loanOfficer
+					.getPersonnelId(), loanOfficer.getDisplayName()));
+			CenterBO centerBO = CustomerFixture.createCenterBO(Integer
+					.valueOf(i), LOAN_OFFICER);
+			centers.add(centerBO);
+			centerSelectionItems.add(new SelectionItem(i2s(centerBO
+					.getCustomerId()), centerBO.getDisplayName()));
+		}
+		anyPersonnel = PersonnelFixture.createPersonnel(ANY_SHORT_ID);
+		anyOffice = OfficecFixture.createOffice(ANY_SHORT_ID);
+		anyCollectionSheetCustomer = new ArrayList<CollSheetCustBO>();
+		anyCollectionSheetCustomer.add(CollectionSheetCustomerBOFixture
+				.createCollectionSheet());
+
+		centerCollectionSheets = new ArrayList<CollSheetCustBO>();
+		centerCollectionSheet = generateCollectionSheet(CENTER_ID,
+				LOAN_OFFICER_SHORT_ID, CustomerLevel.CENTER);
+		centerCollectionSheets.add(centerCollectionSheet);
+
+		groupsCollectionSheets = new ArrayList<CollSheetCustBO>();
+		groupCollectionSheet = generateCollectionSheet(GROUP_ID,
+				LOAN_OFFICER_SHORT_ID, CustomerLevel.GROUP);
+		groupsCollectionSheets.add(groupCollectionSheet);
+
+
+		customerCollectionSheets = generateClientCollectionSheets(700,
+				groupCollectionSheet, LOAN_OFFICER_SHORT_ID);
+
+		center = CustomerFixture.createCenterBO(CENTER_ID, LOAN_OFFICER);
+		group = CustomerFixture.createGroupBO(GROUP_ID, LOAN_OFFICER);
+
+		collectionSheet = CollectionSheetCustomerBOFixture
+				.createCollectionSheet();
+		clLoanDetailsEntity = CollectionSheetLoanDetailsEntityFixture
+				.createLoanDetails(CL_LOAN_ACCNT_ID);
+		bsklLoanDetailsEntity = CollectionSheetLoanDetailsEntityFixture
+				.createLoanDetails(BSKL_LOAN_ACCNT_ID);
+		mm1SavingDetailsEntity = CollectionSheetSavingDetailsEntityFixture
+				.createSavingsDetails(MM1_SAVINGS_ACCNT_ID);
+		skSavingDetailsEntity = CollectionSheetSavingDetailsEntityFixture
+				.createSavingsDetails(SK_SAVINGS_ACCNT_ID);
+		collectionSheet.addCollectionSheetLoanDetail(clLoanDetailsEntity);
+		collectionSheet.addCollectionSheetLoanDetail(bsklLoanDetailsEntity);
+		collectionSheet.addCollectionSheetSavingsDetail(mm1SavingDetailsEntity);
+		collectionSheet.addCollectionSheetSavingsDetail(skSavingDetailsEntity);
+		bsklLoanProductOffering = new LoanOfferingBO(BSKL_PRODUCT_OFFERING_ID);
+		clLoanProductOffering = new LoanOfferingBO(CL_PRODUCT_OFFERING_ID);
+		mm1SavingsProductOffering = new SavingsOfferingBO(
+				MM1_SAVINGS_PRODUCT_ID);
+		skSavingsProductOffering = new SavingsOfferingBO(
+				SK_SAVING_PRD_OFFERING_ID);
+
+	}
+}
Index: test/org/mifos/application/reports/business/service/AbstractCollectionSheetTestCase.java
===================================================================
--- test/org/mifos/application/reports/business/service/AbstractCollectionSheetTestCase.java	(revision 0)
+++ test/org/mifos/application/reports/business/service/AbstractCollectionSheetTestCase.java	(revision 0)
@@ -0,0 +1,83 @@
+package org.mifos.application.reports.business.service;
+
+import static org.mifos.application.reports.ui.SelectionItem.ALL_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.framework.util.helpers.NumberUtils.*;
+import java.sql.Date;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.mifos.application.collectionsheet.business.CollSheetCustBO;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.personnel.business.PersonnelBO;
+import org.mifos.application.personnel.business.PersonnelFixture;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.NumberUtils;
+
+public class AbstractCollectionSheetTestCase extends MifosTestCase {
+
+	protected static final Integer ANY_ID = new Integer("1");
+	protected static final Short ANY_SHORT_ID = NumberUtils
+			.convertIntegerToShort(ANY_ID);
+	protected static final Integer BRANCH_ID = Integer.valueOf(400);
+	protected static final Short BRANCH_SHORT_ID = NumberUtils
+			.convertIntegerToShort(BRANCH_ID);
+	protected static final Integer CENTER_ID = Integer.valueOf(500);
+	protected static final Integer LOAN_OFFICER_ID = Integer.valueOf(600);
+	protected static final Short LOAN_OFFICER_SHORT_ID = Short
+			.valueOf(LOAN_OFFICER_ID.shortValue());
+	protected static final int GROUP_ID = Integer.valueOf(200);
+	protected static final Integer ANOTHER_GROUP_ID = Integer.valueOf(201);
+	protected static final Date TODAYS_DATE = DateUtils.currentDateAsSqlDate();
+	protected static final int MAX_COUNT = 10;
+	protected static final Integer ALL_CENTER_ID = convertShortToInteger(ALL_CENTER_SELECTION_ITEM
+			.getId());
+	protected static final Short ALL_LOAN_OFFICER_SHORT_ID = ALL_LOAN_OFFICER_SELECTION_ITEM
+			.getId();
+	protected static final Integer ALL_LOAN_OFFICER_ID = NumberUtils
+			.convertShortToInteger(ALL_LOAN_OFFICER_SHORT_ID);
+	protected static final PersonnelBO LOAN_OFFICER = PersonnelFixture
+			.createLoanOfficer(LOAN_OFFICER_SHORT_ID);
+	protected CollectionSheetService collectionSheetService;
+	protected CollSheetCustBO center;
+	protected CollSheetCustBO group;
+
+	protected Integer s2i(Short s) {
+		return NumberUtils.convertShortToInteger(s);
+	}
+
+	protected Short i2s(Integer s) {
+		return NumberUtils.convertIntegerToShort(s);
+	}
+
+	protected List<CollSheetCustBO> generateClientCollectionSheets(
+			int idStartFrom, CollSheetCustBO parentGroup, Short loanOfficerId) {
+		List<CollSheetCustBO> generatedCollectionSheets = new ArrayList<CollSheetCustBO>();
+		for (int i = idStartFrom; i < idStartFrom + 2; i++) {
+			CollSheetCustBO customer = generateCollectionSheet(i,
+					loanOfficerId, CustomerLevel.CLIENT);
+			customer.setParentCustomerId(parentGroup.getCustId());
+			generatedCollectionSheets.add(customer);
+		}
+		return generatedCollectionSheets;
+	}
+
+	protected CollSheetCustBO generateCollectionSheet(int custId,
+			Short loanOfficerId, CustomerLevel customerLevel) {
+		return new CollSheetCustBO(Integer.valueOf(custId),
+				"Sample Individual Customer", customerLevel.getValue(),
+				ANY_SHORT_ID, "", loanOfficerId);
+	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		center = new CollSheetCustBO(CENTER_ID, "Sample Center",
+				CustomerLevel.CENTER.getValue(), ANY_SHORT_ID, "",
+				LOAN_OFFICER_SHORT_ID);
+		group = new CollSheetCustBO(GROUP_ID, "Sample Group",
+				CustomerLevel.GROUP.getValue(), ANY_SHORT_ID, "",
+				LOAN_OFFICER_SHORT_ID);
+	}
+}
Index: test/org/mifos/application/reports/business/service/CollectionSheetServiceTest.java
===================================================================
--- test/org/mifos/application/reports/business/service/CollectionSheetServiceTest.java	(revision 0)
+++ test/org/mifos/application/reports/business/service/CollectionSheetServiceTest.java	(revision 0)
@@ -0,0 +1,127 @@
+package org.mifos.application.reports.business.service;
+
+import java.sql.Date;
+import java.util.Calendar;
+import java.util.HashSet;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.mifos.application.collectionsheet.business.CollSheetCustBO;
+import org.mifos.application.collectionsheet.business.CollectionSheetBO;
+import org.mifos.application.collectionsheet.util.helpers.CollectionSheetConstants;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.CollectionUtils;
+import org.mifos.framework.util.helpers.DateUtils;
+
+public class CollectionSheetServiceTest extends AbstractCollectionSheetTestCase {
+	private Session session;
+	private Transaction transaction;
+	HashSet<CollSheetCustBO> generatedCollectionSheets;
+	private Date meetingDate;
+	private CollSheetCustBO anotherGroup;
+
+	public void testReturnsCollectionSheetForMeetingDateCenter()
+			throws Exception {
+		List<CollSheetCustBO> retrievedCenterCollectionSheets = collectionSheetService
+				.getCollectionSheetForCustomerOnMeetingDate(meetingDate,
+						CENTER_ID, LOAN_OFFICER_SHORT_ID, CustomerLevel.CENTER);
+		assertEquals(1, retrievedCenterCollectionSheets.size());
+		assertEquals(center, retrievedCenterCollectionSheets.get(0));
+	}
+
+	public void testReturnsCollectionSheetsForGroup() throws Exception {
+		List<CollSheetCustBO> meetingsForGroups = collectionSheetService
+				.getCollectionSheetForGroups(meetingDate, center,
+						LOAN_OFFICER_SHORT_ID);
+		assertEquals(2, meetingsForGroups.size());
+		assertTrue(meetingsForGroups.contains(group));
+		assertTrue(meetingsForGroups.contains(anotherGroup));
+	}
+
+	public void testCollectionSheetForIndividualCustomer() throws Exception {
+		List<CollSheetCustBO> collectionSheet = collectionSheetService
+				.getCollectionSheetForCustomers(meetingDate, group,
+						LOAN_OFFICER_SHORT_ID);
+		assertEquals(2, collectionSheet.size());
+	}
+
+//	public void testGetCollectionSheetForSpecifiedCenterBranchLoanOfficer()
+//			throws Exception {
+//		List<CollectionSheetBO> collectionSheet = collectionSheetService
+//				.getCollectionSheet(BRANCH_SHORT_ID, CENTER_ID,
+//						LOAN_OFFICER_SHORT_ID, meetingDate, CustomerLevel.CENTER);
+//		assertEquals(1, collectionSheet.size());
+//	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();		
+		collectionSheetService = new CollectionSheetService();
+		CollSheetCustBO centerUnderDifferentLoanOfficer = new CollSheetCustBO(
+				CENTER_ID, "Sample Center Under Different Loan Officer",
+				CustomerLevel.CENTER.getValue(), ANY_SHORT_ID, "", ANY_SHORT_ID);
+		CollSheetCustBO groupUnderDifferentLoanOfficer = new CollSheetCustBO(
+				GROUP_ID, "Sample Group", CustomerLevel.GROUP.getValue(),
+				ANY_SHORT_ID, "", ANY_SHORT_ID);
+		anotherGroup = new CollSheetCustBO(ANOTHER_GROUP_ID,
+				"Another Sample Group", CustomerLevel.GROUP.getValue(),
+				ANY_SHORT_ID, "", LOAN_OFFICER_SHORT_ID);
+
+		generatedCollectionSheets = new HashSet<CollSheetCustBO>();
+		group.setParentCustomerId(CENTER_ID);
+		groupUnderDifferentLoanOfficer.setParentCustomerId(CENTER_ID);
+		anotherGroup.setParentCustomerId(CENTER_ID);
+		generatedCollectionSheets.add(center);
+		generatedCollectionSheets.add(centerUnderDifferentLoanOfficer);
+		generatedCollectionSheets.add(group);
+		generatedCollectionSheets.add(groupUnderDifferentLoanOfficer);
+		generatedCollectionSheets.add(anotherGroup);
+
+
+		generatedCollectionSheets.addAll(generateClientCollectionSheets(300,
+				group, LOAN_OFFICER_SHORT_ID));
+		generatedCollectionSheets.addAll(generateClientCollectionSheets(302,
+				anotherGroup, LOAN_OFFICER_SHORT_ID));
+		generatedCollectionSheets.addAll(generateClientCollectionSheets(304,
+				anotherGroup, ANY_SHORT_ID));
+
+		meetingDate = DateUtils.getSqlDate(2001, Calendar.JANUARY, 1);
+		CollectionSheetBO collectionSheetBO = new CollectionSheetBO(
+				meetingDate, TODAYS_DATE, generatedCollectionSheets,
+				CollectionSheetConstants.COLLECTION_SHEET_GENERATION_SUCCESSFUL);
+
+		CollSheetCustBO customerForMeetingDateAfterSpecifiedDate = new CollSheetCustBO(
+				CENTER_ID,
+				"Customer with collectionsheet after specified meeting date",
+				CustomerLevel.CENTER.getValue(), BRANCH_SHORT_ID, "",
+				LOAN_OFFICER_SHORT_ID);
+		CollectionSheetBO collectionSheetBOForCenterBranchLoanOfficer = new CollectionSheetBO(
+				DateUtils.getSqlDate(2002, Calendar.FEBRUARY, 2), TODAYS_DATE,
+				CollectionUtils.asSet(customerForMeetingDateAfterSpecifiedDate),
+				CollectionSheetConstants.COLLECTION_SHEET_GENERATION_SUCCESSFUL);
+		
+		CollSheetCustBO customerForMeetingDateBeforeSpecifiedDate = new CollSheetCustBO(
+				CENTER_ID,
+				"Customer with collection sheet before meeting date",
+				CustomerLevel.CENTER.getValue(), BRANCH_SHORT_ID, "",
+				LOAN_OFFICER_SHORT_ID);
+		CollectionSheetBO collectionSheetBOBeforeSpecifiedMeetingDate = new CollectionSheetBO(
+				DateUtils.getSqlDate(2000, Calendar.DECEMBER, 31), TODAYS_DATE,
+				CollectionUtils.asSet(customerForMeetingDateBeforeSpecifiedDate),
+				CollectionSheetConstants.COLLECTION_SHEET_GENERATION_SUCCESSFUL);
+
+		session = HibernateUtil.getSessionTL();
+		transaction = session.beginTransaction();
+		session.save(collectionSheetBO);
+		session.save(collectionSheetBOForCenterBranchLoanOfficer);
+		session.save(collectionSheetBOBeforeSpecifiedMeetingDate);
+	}
+
+	@Override
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		transaction.rollback();
+	}
+}
Index: test/org/mifos/application/reports/business/CollectionSheetReportParametersTest.java
===================================================================
--- test/org/mifos/application/reports/business/CollectionSheetReportParametersTest.java	(revision 0)
+++ test/org/mifos/application/reports/business/CollectionSheetReportParametersTest.java	(revision 0)
@@ -0,0 +1,103 @@
+package org.mifos.application.reports.business;
+
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.mifos.application.reports.ui.SelectionItem.NA_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_LOAN_OFFICER_SELECTION_ITEM;
+
+import java.text.ParseException;
+
+import org.mifos.application.reports.business.validator.Errors;
+import org.mifos.framework.MifosTestCase;
+
+
+public class CollectionSheetReportParametersTest extends MifosTestCase {
+
+	private static final String VALID_DATE = "07/03/2007 12:00:00 AM";
+	private static final String VALID_ID = "0";
+	private CollectionSheetReportParameters reportParams;
+	private Errors errorsMock;
+
+	public void testValidatorReturnsErrorIfBranchIdIsSelect() throws Exception {
+		reportParams = new CollectionSheetReportParameters(String
+				.valueOf(SELECT_BRANCH_OFFICE_SELECTION_ITEM
+						.getId()), VALID_ID, VALID_ID, VALID_DATE);
+		errorsMock.rejectValue("branchId", "branchId.invalid");
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsLoanOfficerInvalidIfLoanOfficerIsSelect()
+			throws Exception {
+		reportParams = new CollectionSheetReportParameters(VALID_ID, String
+				.valueOf(SELECT_LOAN_OFFICER_SELECTION_ITEM
+						.getId()), VALID_ID, VALID_DATE);
+		errorsMock.rejectValue("loanOfficerId", "loanOfficerId.invalid");
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsLoanOfficerInvalidIfLoanOfficerIsNA()
+			throws Exception {
+		reportParams = new CollectionSheetReportParameters(VALID_ID, String
+				.valueOf(NA_LOAN_OFFICER_SELECTION_ITEM
+						.getId()), VALID_ID, VALID_DATE);
+		errorsMock.rejectValue("loanOfficerId", "loanOfficerId.invalid");
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsCenterInvalidIfCenterIsSelect()
+			throws Exception {
+		reportParams = new CollectionSheetReportParameters(VALID_ID, VALID_ID,
+				String.valueOf(SELECT_CENTER_SELECTION_ITEM
+						.getId()), VALID_DATE);
+		errorsMock.rejectValue("centerId", "centerId.invalid");
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsCenterInvalidIfCenterIsNA()
+			throws Exception {
+		reportParams = new CollectionSheetReportParameters(VALID_ID, VALID_ID,
+				String.valueOf(NA_CENTER_SELECTION_ITEM
+						.getId()), VALID_DATE);
+		errorsMock.rejectValue("centerId", "centerId.invalid");
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testValidatorReturnsMeetingDateInvalidIfMeetingDateIsSelect()
+			throws Exception {
+		reportParams = new CollectionSheetReportParameters(VALID_ID, VALID_ID,
+				VALID_ID, VALID_DATE);
+		replay(errorsMock);
+		reportParams.validate(errorsMock);
+		verify(errorsMock);
+	}
+
+	public void testReportDateFormat() throws Exception {
+		try {
+			CollectionSheetReportParameters.REPORT_DATE_PARAM_FORMAT
+					.parse("01/01/1970 05:30:00 AM");
+		}
+		catch (ParseException e) {			
+			fail("Should be parsing given date");
+		}		
+	}
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		errorsMock = createMock(Errors.class);
+	}
+}
Index: test/org/mifos/application/reports/ui/SelectionItemTest.java
===================================================================
--- test/org/mifos/application/reports/ui/SelectionItemTest.java	(revision 0)
+++ test/org/mifos/application/reports/ui/SelectionItemTest.java	(revision 0)
@@ -0,0 +1,66 @@
+package org.mifos.application.reports.ui;
+
+import java.util.List;
+
+import org.mifos.application.reports.persistence.SelectionItemPersistence;
+import org.mifos.framework.MifosTestCase;
+
+public class SelectionItemTest extends MifosTestCase {
+	private static final Short LOAN_OFFICER_ID = Short.valueOf("1");
+	private static final Short BRANCH_ID = Short.valueOf("3");
+	private SelectionItemPersistence selectionItemPersistence;
+
+	public void testRetrievesOfficesThroughNamedQuery() throws Exception {
+		List<SelectionItem> activeBranchesUnderUser = null;
+		try {
+			activeBranchesUnderUser = selectionItemPersistence
+					.getActiveBranchesUnderUser("1.1");
+		}
+		catch (Exception e) {
+			fail("Should not fail while retrieving SelectionItem");
+		}
+		assertFalse(activeBranchesUnderUser.isEmpty());
+	}
+
+	public void testRetrievesLoanOfficersThroughNamedQuery() throws Exception {
+		List<SelectionItem> activeLoanOfficers = null;
+		try {
+			activeLoanOfficers = selectionItemPersistence
+					.getActiveLoanOfficersUnderOffice(Short.valueOf("2"));
+		}
+		catch (Exception e) {
+			fail("Should not fail while retrieving SelectionItem");
+		}
+		assertFalse(activeLoanOfficers.isEmpty());
+	}
+
+	public void testRetrievesActiveCentersThroughNamedQuery() throws Exception {
+		List<SelectionItem> activeCentersUnderUser = null;
+		try {
+			activeCentersUnderUser = selectionItemPersistence
+					.getActiveCentersUnderUser(BRANCH_ID, LOAN_OFFICER_ID);
+		}
+		catch (Exception e) {
+			fail("Should not fail while retrieving SelectionItem");
+		}
+		assertFalse(activeCentersUnderUser.isEmpty());
+	}
+
+	public void testRetrievesActiveGroupsThroughNamedQuery() throws Exception {
+		List<SelectionItem> activeGroupsUnderUser = null;
+		try {
+			activeGroupsUnderUser = selectionItemPersistence
+					.getActiveGroupsUnderUser(BRANCH_ID, LOAN_OFFICER_ID);
+		}
+		catch (Exception e) {
+			fail("Should not fail while retrieving SelectionItem");
+		}
+		assertFalse(activeGroupsUnderUser.isEmpty());
+	}
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		selectionItemPersistence = new SelectionItemPersistence();
+	}
+}
Index: test/org/mifos/application/reports/ui/SelectionItemFixture.java
===================================================================
--- test/org/mifos/application/reports/ui/SelectionItemFixture.java	(revision 0)
+++ test/org/mifos/application/reports/ui/SelectionItemFixture.java	(revision 0)
@@ -0,0 +1,12 @@
+package org.mifos.application.reports.ui;
+
+import static org.mifos.framework.util.helpers.NumberUtils.*;
+public class SelectionItemFixture {
+	public static SelectionItem createSelectionItem(Integer id) {
+		return new SelectionItem(convertIntegerToShort(id), "");
+	}
+
+	public static SelectionItem createSelectionItem(Short personnelId) {
+		return new SelectionItem(personnelId, "");
+	}
+}
Index: test/org/mifos/application/office/business/OfficecFixture.java
===================================================================
--- test/org/mifos/application/office/business/OfficecFixture.java	(revision 12247)
+++ test/org/mifos/application/office/business/OfficecFixture.java	(working copy)
@@ -8,4 +8,7 @@
 		return office;
 	}
 
+	public static OfficeBO createOffice(Short officeId) {
+		return new OfficeBO(officeId, "Some Office", null, null);
+	}
 }
Index: test/org/mifos/application/ApplicationTestSuite.java
===================================================================
--- test/org/mifos/application/ApplicationTestSuite.java	(revision 12247)
+++ test/org/mifos/application/ApplicationTestSuite.java	(working copy)
@@ -142,8 +142,9 @@
 		suite.addTest(SurveysTestSuite.suite());
 		suite.addTest(PPITestSuite.suite());
 		suite.addTest(ApplicationAcceptedPaymentTypeTestSuite.suite());
-		
+		suite.addTest(CollectionSheetTestSuite.suite());
 		return suite;
 	}
 }
 
+
Index: test/org/mifos/application/personnel/business/CustomerFixture.java
===================================================================
--- test/org/mifos/application/personnel/business/CustomerFixture.java	(revision 0)
+++ test/org/mifos/application/personnel/business/CustomerFixture.java	(revision 0)
@@ -0,0 +1,26 @@
+package org.mifos.application.personnel.business;
+
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.business.CustomerLevelEntity;
+import org.mifos.application.customer.center.business.CenterBO;
+import org.mifos.application.customer.group.business.GroupBO;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+
+public class CustomerFixture {
+
+	public static CenterBO createCenterBO(Integer customerId) {
+		return createCenterBO(customerId, null);
+	}
+
+	public static CenterBO createCenterBO(Integer customerId,
+			PersonnelBO loanOfficer) {
+		CenterBO center = new CenterBO(customerId, new CustomerLevelEntity(
+				CustomerLevel.CENTER), null, loanOfficer, customerId.toString());
+		return center;
+	}
+	
+	public static GroupBO createGroupBO(Integer customerId, PersonnelBO loanOfficer) {
+		return new GroupBO(customerId, new CustomerLevelEntity(
+				CustomerLevel.CENTER), null, loanOfficer, customerId.toString());
+	}
+}
Index: test/org/mifos/application/personnel/business/PersonnelFixture.java
===================================================================
--- test/org/mifos/application/personnel/business/PersonnelFixture.java	(revision 12247)
+++ test/org/mifos/application/personnel/business/PersonnelFixture.java	(working copy)
@@ -2,6 +2,7 @@
 
 import org.mifos.application.office.business.OfficeBO;
 import org.mifos.application.office.business.OfficecFixture;
+import org.mifos.application.personnel.util.helpers.PersonnelLevel;
 
 public class PersonnelFixture {
 
@@ -12,4 +13,23 @@
 		return personnel;
 	}
 
+	public static PersonnelBO createPersonnel(Short personnelId) {
+		PersonnelBO personnel = new PersonnelBO(personnelId, null, null, null);
+		personnel.setOffice(OfficecFixture.createOffice(Short.valueOf("1")));
+		return personnel;
+	}
+
+	public static PersonnelBO createLoanOfficer(Short personnelId) {
+		PersonnelBO personnel = createPersonnel(personnelId);
+		personnel
+				.setLevel(new PersonnelLevelEntity(PersonnelLevel.LOAN_OFFICER));
+		return personnel;
+	}
+
+	public static PersonnelBO createNonLoanOfficer(Short personnelId) {
+		PersonnelBO personnel = createPersonnel(personnelId);
+		personnel.setLevel(new PersonnelLevelEntity(
+				PersonnelLevel.NON_LOAN_OFFICER));
+		return personnel;
+	}
 }
Index: test/org/mifos/framework/util/helpers/MockObjectHelpers.java
===================================================================
--- test/org/mifos/framework/util/helpers/MockObjectHelpers.java	(revision 0)
+++ test/org/mifos/framework/util/helpers/MockObjectHelpers.java	(revision 0)
@@ -0,0 +1,20 @@
+package org.mifos.framework.util.helpers;
+
+import org.easymock.EasyMock;
+import org.easymock.IArgumentMatcher;
+
+public class MockObjectHelpers {
+
+	public static java.sql.Date eqAnySqlDate() {
+		EasyMock.reportMatcher(new IArgumentMatcher() {
+			public void appendTo(StringBuffer message) {
+				return;
+			}
+	
+			public boolean matches(Object other) {
+				return true;
+			}});
+		return null;
+	}	
+
+}
Index: BirtWebViewer/webcontent/birt/pages/parameter/ComboBoxParameterFragment.jsp
===================================================================
--- BirtWebViewer/webcontent/birt/pages/parameter/ComboBoxParameterFragment.jsp	(revision 12247)
+++ BirtWebViewer/webcontent/birt/pages/parameter/ComboBoxParameterFragment.jsp	(working copy)
@@ -29,8 +29,9 @@
 %>
 <!--For Mifos Birt reports-->
 <TR>
-	<TD NOWRAP>
-	</TD>
+    <!-- below TD commented for alignment -->
+	<!-- <TD NOWRAP>
+	</TD>-->
 	<TD NOWRAP class = "fontnormal" align="right">
 	<%if ( parameterBean.isRequired( ) )
 		{
@@ -44,7 +45,8 @@
 		
 		
 	</TD>
-	<TD NOWRAP></TD>
+	<!-- below TD commented for alignment -->
+	<!-- <TD NOWRAP></TD> -->
 	<TD NOWRAP WIDTH="50%">
 		<INPUT TYPE="HIDDEN"
 			ID="<%= encodedParameterName + "_value" %>"
@@ -157,4 +159,4 @@
 	%>
 	</TD>
 </TR>
-<!--End-->
\ No newline at end of file
+<!--End-->
Index: BirtWebViewer/webcontent/birt/pages/parameter/HiddenParameterFragment.jsp
===================================================================
--- BirtWebViewer/webcontent/birt/pages/parameter/HiddenParameterFragment.jsp	(revision 12247)
+++ BirtWebViewer/webcontent/birt/pages/parameter/HiddenParameterFragment.jsp	(working copy)
@@ -37,9 +37,22 @@
 		<INPUT TYPE="HIDDEN"
 			NAME="<%= encodedParameterName %>"
 			VALUE="<%= value %>"/>		
+		    <!-- For Mifos Birt report -->
+		    <font class="fontnormalRedBold">
+		    <%
+			    String message = request.getParameter("mifosErrorMessage");
+	 		    if (message != null && request.getAttribute("errorHasBeenShown") == null) { 
+	 		        request.setAttribute("errorHasBeenShown", "true");			    		 		    
+			    	String[] messages = message.split("~");
+			    	for(int i=0;i<messages.length;i++){	    
+			    		out.println("<li>" + messages[i] + "</li>");
+			    	}
+			    }
+		    %>
+		    </font>						
 	</TD>
 </TR>
 
 <%
 	}
-%>
\ No newline at end of file
+%>
Index: BirtWebViewer/webcontent/birt/pages/parameter/ParameterGroupFragment.jsp
===================================================================
--- BirtWebViewer/webcontent/birt/pages/parameter/ParameterGroupFragment.jsp	(revision 12247)
+++ BirtWebViewer/webcontent/birt/pages/parameter/ParameterGroupFragment.jsp	(working copy)
@@ -22,7 +22,7 @@
 -----------------------------------------------------------------------------%>
 <jsp:useBean id="fragments" type="java.util.Collection" scope="request" />
 <jsp:useBean id="attributeBean" type="org.eclipse.birt.report.context.BaseAttributeBean" scope="request" />
-
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%-----------------------------------------------------------------------------
 	Content fragment
 -----------------------------------------------------------------------------%>
@@ -62,6 +62,17 @@
 	}
 %>	
 		<TABLE CLASS="birtviewer_parameter_dialog_Label">
+		<TR><TD COLSPAN="2" ALIGN="CENTER">
+
+		<c:if test="${reportErrors ne null}">
+			Error occurred while generating report
+			<div align="left"><ul class="fontnormalRedBold">
+			<c:forEach items="${reportErrors.allErrorMessages}" var="error">
+				<li><c:out value="${error}"/></li>
+			</c:forEach>
+			</ul></div>
+		</c:if>
+		</TD></TR>
 		<%
 			if ( fragments != null )
 			{
@@ -78,4 +89,4 @@
 		%>
 		</TABLE>
 	</TD>
-</TR>
\ No newline at end of file
+</TR>
Index: BirtWebViewer/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp
===================================================================
--- BirtWebViewer/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp	(revision 12247)
+++ BirtWebViewer/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp	(working copy)
@@ -27,17 +27,11 @@
 	String encodedParameterName = ParameterAccessor.htmlEncode( parameterBean.getName( ) );
 %>
 <TR>
-	<TD NOWRAP>
-	<!-- For Mifos Birt reports hide
+	<!--<TD NOWRAP>
 		<IMG SRC="birt/images/parameter.gif" ALT="<%= parameterBean.getDisplayName( ) %>" TITLE="<%= parameterBean.getToolTip( ) %>"/>
-	-->	
-	</TD>
-	<TD NOWRAP>
-	    <!-- For Mifos Birt reports hide
-		<FONT TITLE="<%= parameterBean.getToolTip( ) %>">
-		
-		<LABEL FOR="<%= encodedParameterName %>"><%= parameterBean.getDisplayName( ) %>:</LABEL></FONT>
-		-->	
+	</TD>-->
+	<TD NOWRAP class = "fontnormal" align="right">
+		<FONT TITLE="<%= parameterBean.getToolTip( ) %>"><LABEL FOR="<%= encodedParameterName %>"><%= parameterBean.getDisplayName( ) %>:</LABEL></FONT>
 		<%-- is required --%>
 		<%
 		if ( parameterBean.isRequired( ) )
@@ -48,9 +42,9 @@
 		}
 		%>
 	</TD>
-</TR>
+<!--</TR>
 <TR>
-	<TD NOWRAP></TD>
+	<TD NOWRAP></TD>-->
 	<TD NOWRAP WIDTH="100%">
 <%
 	if ( parameterBean.allowNull( ) )
@@ -81,7 +75,6 @@
 <%
 	}
 %>
-<!-- For Mifos Birt reports hide
 		<INPUT CLASS="BirtViewer_parameter_dialog_Input"
 			TYPE="<%= parameterBean.isValueConcealed( )? "PASSWORD" : "TEXT" %>"
 			NAME="<%= encodedParameterName %>"
@@ -90,43 +83,7 @@
 			VALUE="<%= ParameterAccessor.htmlEncode( ( parameterBean.getValue( ) == null )? "" : parameterBean.getValue( ) ) %>" 
 			<%= ( parameterBean.allowNull( ) && parameterBean.getValue( ) == null )? "DISABLED='true'" : "" %>
             >
--->
-<!-- For Mifos Birt reports add-->
-        <table width="70%" cellspacing="0" cellpadding="0" border="0">
-             <tbody>
-                  <tr>
-                    <td class="headingorange" width="70%" valign="top" height="24" align="left">
-                        <LABEL><%= ParameterAccessor.htmlEncode( ( parameterBean.getValue( ) == null )? "" : parameterBean.getValue( ) ) %></LABEL>
-                        <br/>
-                    </td>
-                  </tr>
-             </tbody>
-         </table>
-         <div class="fontnormal">
-         <LABEL>Enter the parameters on which the report will be generated. The report will be generated as a pdf. 
-		     <FONT COLOR="red"><LABEL>*</LABEL></FONT><LABEL>Fields marked with an asterisk are required. </LABEL>
-             </br>
-         </div>
-         <div class="fontnormalbold">
-             </br>
-             <LABEL>&nbsp;Generate Report:</LABEL>
-         </div>
-         <!-- For Mifos Birt report -->
-	    <font class="fontnormalRedBold">
-	    <%
-		    String message = request.getParameter("message");
-		    if (message != null) {
-		    	String[] messages = message.split("~");
-		    	for(int i=0;i<messages.length;i++){
-	    %>
-	    <%
-		    		out.println("<li>" + messages[i] + "</li>");
-		    	}
-		    }
-	    %>
-	    </font>
-	    <!-- END -->
-<!-- End -->
+
 <%
 	if ( parameterBean.allowNull( ) && !parameterBean.allowBlank( ) )
 	{
@@ -153,4 +110,4 @@
 	}
 %>
 	</TD>
-</TR>
\ No newline at end of file
+</TR>
Index: BirtWebViewer/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js
===================================================================
--- BirtWebViewer/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js	(revision 12247)
+++ BirtWebViewer/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js	(working copy)
@@ -541,8 +541,14 @@
 				param.value = this.__parameter[i].value;
 				
 				//replace the URL parameter			
-				var reg = new RegExp( "&" + param.name + "[^&]*&*", "g" );
-				action = action.replace( reg, "&" );
+				// commented - let's not remove query param from URL even if
+				// the same param exists as POST param, because the cascade param
+				// dropdown does not send the userId if it's only a hidden param
+				
+				//var reg = new RegExp( "&" + param.name + "[^&]*&*", "g" );
+				//action = action.replace( reg, "&" );
+				
+				// end comment
 			}
 		}
 
@@ -605,4 +611,4 @@
 		birtUtility.setButtonsDisabled ( "navigationBar", false );		
 	}
 }
-);
\ No newline at end of file
+);
Index: conf/build.properties
===================================================================
--- conf/build.properties	(revision 12247)
+++ conf/build.properties	(working copy)
@@ -43,7 +43,7 @@
 db.ip=localhost
 db.port=3306
 db.user=root
-db.pwd=mysql
+db.pwd=password
 
 ######################################################################
 #test db related properties, used by the target build_test_db
@@ -52,4 +52,4 @@
 testdb.ip=localhost
 testdb.port=3306
 testdb.user=root
-testdb.pwd=mysql
\ No newline at end of file
+testdb.pwd=password
\ No newline at end of file
Index: conf/HibernateTest.properties
===================================================================
--- conf/HibernateTest.properties	(revision 12247)
+++ conf/HibernateTest.properties	(working copy)
@@ -1,7 +1,7 @@
 hibernate.connection.driver_class=com.mysql.jdbc.Driver
 hibernate.connection.url=jdbc:mysql://localhost:3306/test
 hibernate.connection.username=root
-hibernate.connection.password=mysql
+hibernate.connection.password=password
 hibernate.dialect=org.hibernate.dialect.MySQLDialect
 hibernate.show_sql=false
 hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
Index: conf/hibernate.properties
===================================================================
--- conf/hibernate.properties	(revision 12247)
+++ conf/hibernate.properties	(working copy)
@@ -1,7 +1,7 @@
 hibernate.connection.driver_class=com.mysql.jdbc.Driver
 hibernate.connection.url=jdbc:mysql://localhost:3306/mifos?useUnicode=true&characterEncoding=UTF-8
 hibernate.connection.username=root
-hibernate.connection.password=mysql
+hibernate.connection.password=password
 hibernate.dialect=org.hibernate.dialect.MySQLDialect
 hibernate.show_sql=false
 hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
Index: BirtReportDesign/LayoutReport.rptconfig
===================================================================
--- BirtReportDesign/LayoutReport.rptconfig	(revision 0)
+++ BirtReportDesign/LayoutReport.rptconfig	(revision 0)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Written by Eclipse BIRT 2.0 -->
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6" id="1"/>
Index: BirtReportDesign/LayoutReport.rptdesign
===================================================================
--- BirtReportDesign/LayoutReport.rptdesign	(revision 0)
+++ BirtReportDesign/LayoutReport.rptdesign	(revision 0)
@@ -0,0 +1,2764 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Written by Eclipse BIRT 2.0 -->
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6" id="1">
+    <property name="createdBy">Eclipse BIRT Designer Version 2.1.2.v20070205-1728 Build &lt;20070205-1728></property>
+    <property name="units">in</property>
+    <property name="includeResource">BirtReportResource/GrameenKootaCollectionSheetReportResource</property>
+    <property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name here>></property>
+    <parameters>
+        <cascading-parameter-group name="branch_loanofficer_center" id="905">
+            <property name="dataSetMode">multiple</property>
+            <parameters>
+                <scalar-parameter name="branchId" id="906">
+                    <property name="valueType">dynamic</property>
+                    <property name="dataType">integer</property>
+                    <text-property name="promptText" key="collection.sheet.report.parameter.branch">Select Branch</text-property>
+                    <property name="allowNull">false</property>
+                    <property name="controlType">list-box</property>
+                    <property name="dataSetName">BranchOffices</property>
+                    <expression name="valueExpr">row["ds_branchId"]</expression>
+                    <expression name="labelExpr">row["ds_branchName"]</expression>
+                    <property name="mustMatch">true</property>
+                    <property name="defaultValue">-3</property>
+                    <structure name="format">
+                        <property name="category">Unformatted</property>
+                    </structure>
+                </scalar-parameter>
+                <scalar-parameter name="loanOfficerId" id="907">
+                    <property name="valueType">dynamic</property>
+                    <property name="dataType">integer</property>
+                    <text-property name="promptText" key="collection.sheet.report.parameter.loanofficer">Select Loan Officer</text-property>
+                    <property name="allowNull">false</property>
+                    <property name="controlType">list-box</property>
+                    <property name="dataSetName">LoanOfficers</property>
+                    <expression name="valueExpr">row["ds_loanOfficerId"]</expression>
+                    <expression name="labelExpr">row["ds_loanOfficerName"]</expression>
+                    <property name="mustMatch">true</property>
+                    <property name="defaultValue">-3</property>
+                    <structure name="format">
+                        <property name="category">Unformatted</property>
+                    </structure>
+                </scalar-parameter>
+                <scalar-parameter name="centerId" id="908">
+                    <property name="valueType">dynamic</property>
+                    <property name="dataType">integer</property>
+                    <text-property name="promptText" key="collection.sheet.report.parameter.center">Select Center</text-property>
+                    <property name="allowNull">false</property>
+                    <property name="controlType">list-box</property>
+                    <property name="dataSetName">Centers</property>
+                    <expression name="valueExpr">row["ds_centerId"]</expression>
+                    <expression name="labelExpr">row["ds_centerName"]</expression>
+                    <property name="mustMatch">true</property>
+                    <property name="defaultValue">-3</property>
+                    <structure name="format">
+                        <property name="category">Unformatted</property>
+                    </structure>
+                </scalar-parameter>
+                <scalar-parameter name="meetingDate" id="961">
+                    <property name="valueType">dynamic</property>
+                    <property name="dataType">dateTime</property>
+                    <text-property name="promptText">Select Meeting Date</text-property>
+                    <property name="allowNull">false</property>
+                    <property name="controlType">list-box</property>
+                    <property name="dataSetName">MeetingDates</property>
+                    <expression name="valueExpr">row["ds_meetingDate"]</expression>
+                    <expression name="labelExpr">row["ds_meetingDisplayDate"]</expression>
+                    <property name="mustMatch">true</property>
+                    <property name="defaultValue">01/01/1970</property>
+                    <structure name="format">
+                        <property name="category">Unformatted</property>
+                    </structure>
+                </scalar-parameter>
+            </parameters>
+        </cascading-parameter-group>
+        <scalar-parameter name="userId" id="996">
+            <property name="hidden">true</property>
+            <property name="valueType">static</property>
+            <property name="dataType">integer</property>
+            <property name="controlType">text-box</property>
+            <structure name="format">
+                <property name="category">Unformatted</property>
+            </structure>
+        </scalar-parameter>
+    </parameters>
+    <data-sources>
+        <script-data-source name="MifosCollectionSheet" id="259">
+            <method name="open"><![CDATA[logger = Packages.java.util.logging.Logger.getLogger("");
+
+ALL_ID = new Packages.java.lang.Integer(-1);
+SELECT_ID = new Packages.java.lang.Integer(-2);
+NA_ID = new Packages.java.lang.Integer(-3);
+userId = params["userId"];
+CUSTOMER_LEVEL_GROUP  = 2;
+CUSTOMER_LEVEL_CENTER = 3;
+MAX_PRODUCT_COUNT = 2;
+//user config variable: customerLevel
+//set this to either CUSTOMER_LEVEL_CENTER or CUSTOMER_LEVEL_GROUP
+customerLevel = CUSTOMER_LEVEL_CENTER;
+
+customerLevelLabel = (customerLevel == CUSTOMER_LEVEL_CENTER) ? "Center" : "Group";
+
+try {
+	dateFormat = new Packages.java.text.SimpleDateFormat("dd/MM/yyyy");
+    //collectionSheetService = new Packages.org.mifos.application.reports.business.service.CollectionSheetReportService();
+    collectionSheetService = Packages.org.mifos.application.reports.business.service.CollectionSheetReportServiceFactory.getCacheEnabledCollectionSheetReportService();
+} catch (e) {
+	logger.info("MCSReport: Ds-open: exception : MifosScriptedDS : "+e);
+}]]></method>
+            <method name="close"><![CDATA[collectionSheetService = null;]]></method>
+        </script-data-source>
+    </data-sources>
+    <data-sets>
+        <script-data-set name="Collections" id="260">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">member_id</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">2</property>
+                    <property name="name">group_id</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">3</property>
+                    <property name="name">center_id</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">4</property>
+                    <property name="name">member_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">5</property>
+                    <property name="name">group_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">6</property>
+                    <property name="name">center_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">7</property>
+                    <property name="name">loan_1_balance</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">8</property>
+                    <property name="name">loan_1_issues</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">9</property>
+                    <property name="name">loan_1_due</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">10</property>
+                    <property name="name">loan_2_balance</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">11</property>
+                    <property name="name">loan_2_issues</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">12</property>
+                    <property name="name">loan_2_due</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">13</property>
+                    <property name="name">savings_1_balance</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">14</property>
+                    <property name="name">savings_1_due</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">15</property>
+                    <property name="name">savings_2_balance</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">16</property>
+                    <property name="name">savings_2_due</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">17</property>
+                    <property name="name">other_fee</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">18</property>
+                    <property name="name">other_fine</property>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="position">19</property>
+                    <property name="name">loan_officer_id</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">20</property>
+                    <property name="name">loan_officer_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">21</property>
+                    <property name="name">branch_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">22</property>
+                    <property name="name">loan_1_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">23</property>
+                    <property name="name">loan_2_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">24</property>
+                    <property name="name">savings_1_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">25</property>
+                    <property name="name">savings_2_name</property>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="position">26</property>
+                    <property name="name">customer_level_label</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">member_id</property>
+                </structure>
+                <structure>
+                    <property name="columnName">group_id</property>
+                </structure>
+                <structure>
+                    <property name="columnName">center_id</property>
+                </structure>
+                <structure>
+                    <property name="columnName">member_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">balance_bskl</property>
+                </structure>
+                <structure>
+                    <property name="columnName">center_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_1_balance</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_2_balance</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_1_balance</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_2_balance</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_1_due</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_2_due</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_1_due</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_2_due</property>
+                </structure>
+                <structure>
+                    <property name="columnName">group_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">kendra_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_officer_id</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_officer_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">branch_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_1_issues</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_2_issues</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_1_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">loan_2_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_1_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">savings_2_name</property>
+                </structure>
+                <structure>
+                    <property name="columnName">customer_level_label</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">member_id</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">group_id</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">3</property>
+                        <property name="name">center_id</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">4</property>
+                        <property name="name">member_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">5</property>
+                        <property name="name">group_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">6</property>
+                        <property name="name">center_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">7</property>
+                        <property name="name">loan_1_balance</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">8</property>
+                        <property name="name">loan_1_issues</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">9</property>
+                        <property name="name">loan_1_due</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">10</property>
+                        <property name="name">loan_2_balance</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">11</property>
+                        <property name="name">loan_2_issues</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">12</property>
+                        <property name="name">loan_2_due</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">13</property>
+                        <property name="name">savings_1_balance</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">14</property>
+                        <property name="name">savings_1_due</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">15</property>
+                        <property name="name">savings_2_balance</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">16</property>
+                        <property name="name">savings_2_due</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">17</property>
+                        <property name="name">other_fee</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">18</property>
+                        <property name="name">other_fine</property>
+                        <property name="dataType">float</property>
+                    </structure>
+                    <structure>
+                        <property name="position">19</property>
+                        <property name="name">loan_officer_id</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">20</property>
+                        <property name="name">loan_officer_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">21</property>
+                        <property name="name">branch_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">22</property>
+                        <property name="name">loan_1_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">23</property>
+                        <property name="name">loan_2_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">24</property>
+                        <property name="name">savings_1_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">25</property>
+                        <property name="name">savings_2_name</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                    <structure>
+                        <property name="position">26</property>
+                        <property name="name">customer_level_label</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">MifosCollectionSheet</property>
+            <method name="open"><![CDATA[collectionSheetReportsIterator = collectionSheetService.getCollectionSheets(params["branchId"],params["loanOfficerId"],
+    params["centerId"],params["meetingDate"], customerLevel).iterator();]]></method>
+            <method name="fetch"><![CDATA[if(!collectionSheetReportsIterator.hasNext()) return false;
+var collectionSheetRow = collectionSheetReportsIterator.next();
+row["member_id"] = collectionSheetRow.getCustomerId();
+row["group_id"] = collectionSheetRow.getGroupId();
+row["center_id"] = collectionSheetRow.getCenterId();
+row["loan_officer_id"] = collectionSheetRow.getLoanOfficerId();
+row["member_name"] = collectionSheetRow.getCustomerName();
+row["branch_name"] = collectionSheetRow.getBranchName();
+row["center_name"] = collectionSheetRow.getCenterName();
+row["group_name"] = collectionSheetRow.getGroupName();
+row["loan_officer_name"] = collectionSheetRow.getLoanOfficerName();
+row["customer_level_label"] = customerLevelLabel;
+
+for(var i=0;i<MAX_PRODUCT_COUNT;i++){
+	var loanProduct = collectionSheetRow.getLoanProduct(i);
+	row["loan_"+(i+1)+"_balance"] = loanProduct.getBalance();
+	row["loan_"+(i+1)+"_due"] = loanProduct.getDue();
+	row["loan_"+(i+1)+"_issues"] = loanProduct.getIssues();
+	row["loan_"+(i+1)+"_name"] = loanProduct.getOfferingShortName();
+}
+
+for(var i=0;i<MAX_PRODUCT_COUNT;i++){
+	var savingsProduct = collectionSheetRow.getSavingsProduct(i);
+	row["savings_"+(i+1)+"_balance"] = savingsProduct.getBalance();
+	row["savings_"+(i+1)+"_due"] = savingsProduct.getDue();
+	row["savings_"+(i+1)+"_name"] = savingsProduct.getOfferingShortName();
+}
+
+row["other_fine"] = collectionSheetRow.getOtherFine();
+row["other_fee"] = collectionSheetRow.getOtherFee();
+
+return true;]]></method>
+            <method name="close"><![CDATA[collectionSheetReportsIterator=null;]]></method>
+        </script-data-set>
+        <script-data-set name="BranchOffices" id="902">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">ds_branchId</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">2</property>
+                    <property name="name">ds_branchName</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">ds_branchId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">ds_branchName</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">ds_branchId</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">ds_branchName</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">MifosCollectionSheet</property>
+            <method name="open"><![CDATA[try {
+	branchOfficeIterator = collectionSheetService.getBranchOffices(userId).iterator();
+} catch(e) {
+	logger.info("MCSReport: BranchOffices: open: exception : "+e);
+}]]></method>
+            <method name="fetch"><![CDATA[if (!branchOfficeIterator.hasNext()) return false;
+
+var branchOffice = branchOfficeIterator.next();
+row["ds_branchId"] = branchOffice.getId();
+row["ds_branchName"] = branchOffice.getDisplayName();
+return true;]]></method>
+        </script-data-set>
+        <script-data-set name="LoanOfficers" id="903">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">0</property>
+                    <property name="name">ds_loanOfficerId</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">ds_loanOfficerName</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">ds_loanOfficerId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">ds_loanOfficerName</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">ds_loanOfficerId</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">ds_loanOfficerName</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">MifosCollectionSheet</property>
+            <method name="open"><![CDATA[try {
+	var branchId = params["branchId"];
+	loanOfficerIterator = collectionSheetService.getActiveLoanOfficers(userId, branchId).iterator();
+} catch(e) {
+	logger.info("MCSReport: LoanOfficers: open: exception : "+e);
+}]]></method>
+            <method name="fetch"><![CDATA[if(!loanOfficerIterator.hasNext()) return false;
+
+var loanOfficer = loanOfficerIterator.next();
+row["ds_loanOfficerId"] = loanOfficer.getId();
+row["ds_loanOfficerName"] = loanOfficer.getDisplayName();
+return true;]]></method>
+            <method name="close"><![CDATA[loanOfficerIterator = null;]]></method>
+        </script-data-set>
+        <script-data-set name="Centers" id="904">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">0</property>
+                    <property name="name">ds_centerId</property>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">ds_centerName</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">ds_centerId</property>
+                </structure>
+                <structure>
+                    <property name="columnName">ds_centerName</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">ds_centerId</property>
+                        <property name="dataType">integer</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">ds_centerName</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">MifosCollectionSheet</property>
+            <method name="open"><![CDATA[try {
+	var branch = params["branchId"];
+	var officer = params["loanOfficerId"];
+	
+	if(!(officer instanceof Packages.java.lang.Integer)) {
+		var pbs = new Packages.org.mifos.application.personnel.business.service.PersonnelBusinessService();
+		//logger.info("User"+params["userId"]);
+		officer = pbs.getPersonnel(Packages.java.lang.Short.valueOf(""+params["userId"])).isLoanOfficer() ? -2 : -1;
+	}  
+	if(customerLevel == CUSTOMER_LEVEL_CENTER){
+	    centerIterator = collectionSheetService.getActiveCentersForLoanOfficer(officer, branch).iterator();
+	}else if(customerLevel == CUSTOMER_LEVEL_GROUP){
+	    centerIterator = collectionSheetService.getActiveGroupsForLoanOfficer(officer,branch).iterator();
+	}else{
+	    logger.info("MCSReport : Centers open: Invalid customer level:" + customerLevel);
+	}
+} catch(e) {
+	logger.info("MCSReport: CenterOffices: open: exception : "+e);
+}]]></method>
+            <method name="fetch"><![CDATA[if(!centerIterator.hasNext()) return false;
+	
+var center = centerIterator.next();
+row["ds_centerId"] = center.getId();
+row["ds_centerName"] = center.getDisplayName();
+return true;]]></method>
+            <method name="close"><![CDATA[centerIterator = null;]]></method>
+        </script-data-set>
+        <script-data-set name="MeetingDates" id="909">
+            <list-property name="resultSetHints">
+                <structure>
+                    <property name="position">1</property>
+                    <property name="name">ds_meetingDate</property>
+                    <property name="dataType">date-time</property>
+                </structure>
+                <structure>
+                    <property name="position">2</property>
+                    <property name="name">ds_meetingDisplayDate</property>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <list-property name="columnHints">
+                <structure>
+                    <property name="columnName">ds_meetingDate</property>
+                </structure>
+                <structure>
+                    <property name="columnName">ds_meetingDisplayDate</property>
+                </structure>
+            </list-property>
+            <structure name="cachedMetaData">
+                <list-property name="resultSet">
+                    <structure>
+                        <property name="position">1</property>
+                        <property name="name">ds_meetingDate</property>
+                        <property name="dataType">date-time</property>
+                    </structure>
+                    <structure>
+                        <property name="position">2</property>
+                        <property name="name">ds_meetingDisplayDate</property>
+                        <property name="dataType">string</property>
+                    </structure>
+                </list-property>
+            </structure>
+            <property name="dataSource">MifosCollectionSheet</property>
+            <method name="open"><![CDATA[try {
+	var branchId = params["branchId"];
+	var loanOfficerId = params["loanOfficerId"];
+	if(loanOfficerId instanceof Packages.java.lang.Integer && NA_ID.equals(loanOfficerId) && !NA_ID.equals(branchId)) {
+		loanOfficerId = ALL_ID;
+	}  
+	if(!(loanOfficerId instanceof Packages.java.lang.Integer)) {
+		loanOfficerId = SELECT_ID.equals(branchId) ? SELECT_ID : ALL_ID;
+	}  
+	var centerId = params["centerId"];
+	if(!(centerId instanceof Packages.java.lang.Integer)) {
+		centerId = SELECT_ID.equals(loanOfficerId)? SELECT_ID : ALL_ID;		
+	}
+	
+	if(customerLevel == 3){
+        meetingDateIterator = collectionSheetService.getMeetingDatesForCenter(
+		    branchId, centerId,loanOfficerId).iterator();	
+	}else if(customerLevel == 2){
+	    meetingDateIterator = collectionSheetService.getMeetingDatesForGroup(
+		    branchId, centerId,loanOfficerId).iterator();	
+	}else {
+	    logger.info("MCSReport: MeetingDates: open: invalid customerLevel:" + customerLevel);
+	}
+	
+} catch(e) {
+	logger.info("MCSReport: MeetingDates: open: exception : "+e);
+}]]></method>
+            <method name="fetch"><![CDATA[if(!meetingDateIterator.hasNext()) return false;
+var meetingDate = meetingDateIterator.next();
+row["ds_meetingDate"] = meetingDate.getDate();
+row["ds_meetingDisplayDate"] = meetingDate.getDisplayDate();
+return true;]]></method>
+            <method name="close"><![CDATA[meetingDateIterator = null;]]></method>
+        </script-data-set>
+    </data-sets>
+    <styles>
+        <style name="pageNumber" id="53">
+            <property name="textAlign">center</property>
+            <property name="verticalAlign">top</property>
+        </style>
+        <style name="pageHeaderLeft" id="62">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">18pt</property>
+        </style>
+        <style name="pageHeaderRight" id="63">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">25pt</property>
+            <property name="color">#C0C0C0</property>
+            <property name="textAlign">right</property>
+            <property name="verticalAlign">top</property>
+        </style>
+        <style name="pageHeader" id="64">
+            <property name="borderBottomStyle">solid</property>
+            <property name="borderBottomWidth">2pt</property>
+        </style>
+        <style name="tableHeader" id="239">
+            <property name="backgroundColor">#C0C0C0</property>
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">12pt</property>
+            <property name="fontWeight">bold</property>
+            <property name="textAlign">center</property>
+        </style>
+        <style name="tableSubheader" id="240">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">9pt</property>
+            <property name="fontWeight">bold</property>
+            <property name="textAlign">center</property>
+        </style>
+        <style name="tableMainSubheader" id="245">
+            <property name="backgroundColor">#C0C0C0</property>
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">10pt</property>
+            <property name="fontWeight">bold</property>
+            <property name="textAlign">center</property>
+            <property name="verticalAlign">top</property>
+        </style>
+        <style name="pageSubheaderRight" id="251">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">10pt</property>
+            <property name="textAlign">right</property>
+        </style>
+        <style name="pageSubheaderLeft" id="252">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">10pt</property>
+        </style>
+        <style name="pageSubheader" id="253">
+            <property name="marginBottom">10pt</property>
+        </style>
+        <style name="groupFooter" id="379">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">8pt</property>
+            <property name="borderBottomStyle">double</property>
+            <property name="borderBottomWidth">2pt</property>
+            <property name="borderTopStyle">solid</property>
+            <property name="borderTopWidth">1pt</property>
+            <property name="paddingRight">5px</property>
+            <property name="textAlign">right</property>
+        </style>
+        <style name="rightColumnBorder" id="381">
+            <property name="borderRightStyle">solid</property>
+            <property name="borderRightWidth">1pt</property>
+        </style>
+        <style name="rightBorder" id="382">
+            <property name="borderRightStyle">solid</property>
+            <property name="borderRightWidth">1pt</property>
+        </style>
+        <style name="aggregateHeader" id="694">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">12pt</property>
+            <property name="fontWeight">bold</property>
+        </style>
+        <style name="groupRowHeader" id="757">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">10pt</property>
+            <property name="fontWeight">bold</property>
+        </style>
+        <style name="reportSummaryHeader" id="759">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">12pt</property>
+            <property name="fontWeight">bold</property>
+            <property name="borderBottomStyle">solid</property>
+            <property name="borderBottomWidth">1pt</property>
+            <property name="borderTopStyle">solid</property>
+            <property name="borderTopWidth">1.5pt</property>
+            <property name="verticalAlign">bottom</property>
+        </style>
+        <style name="summaryText" id="824">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">12pt</property>
+        </style>
+        <style name="idText" id="835">
+            <property name="textAlign">center</property>
+        </style>
+        <style name="numberFormat" id="836">
+            <property name="fontFamily">"Arial"</property>
+            <property name="paddingRight">5px</property>
+            <property name="textAlign">right</property>
+        </style>
+        <style name="signatureLine" id="871">
+            <property name="borderBottomStyle">dotted</property>
+            <property name="borderBottomWidth">1pt</property>
+        </style>
+        <style name="rowText" id="995">
+            <property name="fontFamily">"Arial"</property>
+            <property name="fontSize">8pt</property>
+        </style>
+    </styles>
+    <page-setup>
+        <simple-master-page name="Simple MasterPage" id="2">
+            <property name="type">a4</property>
+            <property name="orientation">landscape</property>
+            <property name="topMargin">0.5cm</property>
+            <property name="leftMargin">0.5cm</property>
+            <property name="bottomMargin">0.5cm</property>
+            <property name="rightMargin">0.5cm</property>
+            <page-header>
+                <grid id="48">
+                    <property name="style">pageNumber</property>
+                    <property name="width">100%</property>
+                    <column id="49"/>
+                    <row id="50">
+                        <cell id="51">
+                            <text id="52">
+                                <property name="contentType">html</property>
+                                <text-property name="content"><![CDATA[Page <value-of>pageNumber</value-of>]]></text-property>
+                            </text>
+                        </cell>
+                    </row>
+                </grid>
+            </page-header>
+        </simple-master-page>
+    </page-setup>
+    <body>
+        <table id="135">
+            <property name="width">100%</property>
+            <property name="dataSet">Collections</property>
+            <list-property name="boundDataColumns">
+                <structure>
+                    <property name="name">member_id</property>
+                    <expression name="expression">dataSetRow["member_id"]</expression>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="name">member_name</property>
+                    <expression name="expression">dataSetRow["member_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_1_balance</property>
+                    <expression name="expression">dataSetRow["loan_1_balance"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_2_balance</property>
+                    <expression name="expression">dataSetRow["loan_2_balance"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_1_balance</property>
+                    <expression name="expression">dataSetRow["savings_1_balance"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_2_balance</property>
+                    <expression name="expression">dataSetRow["savings_2_balance"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_1_due</property>
+                    <expression name="expression">dataSetRow["loan_1_due"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_2_due</property>
+                    <expression name="expression">dataSetRow["loan_2_due"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_1_due</property>
+                    <expression name="expression">dataSetRow["savings_1_due"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_2_due</property>
+                    <expression name="expression">dataSetRow["savings_2_due"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">due_total</property>
+                    <expression name="expression">row["loan_1_due"]+row["loan_2_due"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">other_fee</property>
+                    <expression name="expression">dataSetRow["other_fee"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">other_fine</property>
+                    <expression name="expression">dataSetRow["other_fine"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">group_id</property>
+                    <expression name="expression">row["group_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">center_id</property>
+                    <expression name="expression">dataSetRow["center_id"]</expression>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="name">group_name</property>
+                    <expression name="expression">dataSetRow["group_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">center_name</property>
+                    <expression name="expression">dataSetRow["center_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_1_balance_total</property>
+                    <expression name="expression">Total.sum(row["loan_1_balance"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_1_balance_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_1_balance_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_2_balance_total</property>
+                    <expression name="expression">Total.sum(row["loan_2_balance"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_savings_1_balance_total</property>
+                    <expression name="expression">Total.sum(row["savings_1_balance"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_savings_2_balance_total</property>
+                    <expression name="expression">Total.sum(row["savings_2_balance"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_1_due_total</property>
+                    <expression name="expression">Total.sum(row["loan_1_due"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_2_due_total</property>
+                    <expression name="expression">Total.sum(row["loan_2_due"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_savings_1_due_total</property>
+                    <expression name="expression">Total.sum(row["savings_1_due"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_savings_2_due_total</property>
+                    <expression name="expression">Total.sum(row["savings_2_due"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_due_total</property>
+                    <expression name="expression">Total.sum(row["due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_other_fee_total</property>
+                    <expression name="expression">Total.sum(row["other_fee"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">group_other_fine_total</property>
+                    <expression name="expression">Total.sum(row["other_fine"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_2_balance_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_2_balance_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_other_fine_total</property>
+                    <expression name="expression">Total.sum(row["group_other_fine_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_savings_1_balance_total</property>
+                    <expression name="expression">Total.sum(row["group_savings_1_balance_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_savings_2_balance_total</property>
+                    <expression name="expression">Total.sum(row["group_savings_2_balance_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_1_due_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_1_due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_2_due_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_2_due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_savings_1_due_total</property>
+                    <expression name="expression">Total.sum(row["group_savings_1_due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_savings_2_due_total</property>
+                    <expression name="expression">Total.sum(row["group_savings_2_due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_due_total</property>
+                    <expression name="expression">Total.sum(row["group_due_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_other_fee_total</property>
+                    <expression name="expression">Total.sum(row["group_other_fee_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_officer_id</property>
+                    <expression name="expression">dataSetRow["loan_officer_id"]</expression>
+                    <property name="dataType">integer</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_officer_name</property>
+                    <expression name="expression">dataSetRow["loan_officer_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">branch_name</property>
+                    <expression name="expression">dataSetRow["branch_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">rpt_center_name</property>
+                    <expression name="expression">row["center_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">due_collection</property>
+                    <expression name="expression">row["center_due_total"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">other_collection</property>
+                    <expression name="expression">row["center_other_fine_total"]+row["center_other_fee_total"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">total_collection</property>
+                    <expression name="expression">row["other_collection"]+row["due_collection"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">rpt_branch</property>
+                    <expression name="expression">row["branch_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">rpt_center</property>
+                    <expression name="expression">row["center_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">rpt_loanOfficer</property>
+                    <expression name="expression">row["loan_officer_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">rpt_meetingDate</property>
+                    <expression name="expression">new Packages.java.text.SimpleDateFormat("dd/MM/yyyy").format(params["meetingDate"])</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_1_issues</property>
+                    <expression name="expression">dataSetRow["loan_1_issues"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_1_issues_total</property>
+                    <expression name="expression">Total.sum(row["loan_1_issues"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_1_issues_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_1_issues_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_2_issues</property>
+                    <expression name="expression">dataSetRow["loan_2_issues"]</expression>
+                    <property name="dataType">float</property>
+                </structure>
+                <structure>
+                    <property name="name">group_loan_2_issues_total</property>
+                    <expression name="expression">Total.sum(row["loan_2_issues"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">group</property>
+                </structure>
+                <structure>
+                    <property name="name">center_loan_2_issues_total</property>
+                    <expression name="expression">Total.sum(row["group_loan_2_issues_total"])</expression>
+                    <property name="dataType">float</property>
+                    <property name="aggregateOn">center_group</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_1_name</property>
+                    <expression name="expression">dataSetRow["loan_1_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">loan_2_name</property>
+                    <expression name="expression">dataSetRow["loan_2_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_1_name</property>
+                    <expression name="expression">dataSetRow["savings_1_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">savings_2_name</property>
+                    <expression name="expression">dataSetRow["savings_2_name"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+                <structure>
+                    <property name="name">customer_level_label</property>
+                    <expression name="expression">dataSetRow["customer_level_label"]</expression>
+                    <property name="dataType">string</property>
+                </structure>
+            </list-property>
+            <column id="175">
+                <property name="width">1cm</property>
+            </column>
+            <column id="176">
+                <property name="width">4cm</property>
+            </column>
+            <column id="177">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="178">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="179">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="180">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="181">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="182">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="183">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="184">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="185">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="186">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="208">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="851">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="978">
+                <property name="width">1.7cm</property>
+            </column>
+            <column id="866">
+                <property name="width">1cm</property>
+            </column>
+            <group id="727">
+                <property name="groupName">loan_officer_group</property>
+                <property name="interval">none</property>
+                <property name="sortDirection">asc</property>
+                <expression name="keyExpr">row["loan_officer_id"]</expression>
+                <expression name="toc">row["loan_officer_name"]</expression>
+                <property name="repeatHeader">false</property>
+                <property name="hideDetail">false</property>
+                <property name="pageBreakAfter">always-excluding-last</property>
+                <property name="pageBreakBefore">auto</property>
+                <header>
+                    <row id="945">
+                        <property name="height">0.1in</property>
+                        <list-property name="visibility">
+                            <structure>
+                                <property name="format">all</property>
+                                <expression name="valueExpr">true</expression>
+                            </structure>
+                        </list-property>
+                        <cell id="946"/>
+                        <cell id="947"/>
+                        <cell id="948"/>
+                        <cell id="949"/>
+                        <cell id="950"/>
+                        <cell id="951"/>
+                        <cell id="952"/>
+                        <cell id="953"/>
+                        <cell id="954"/>
+                        <cell id="955"/>
+                        <cell id="956"/>
+                        <cell id="957"/>
+                        <cell id="958"/>
+                        <cell id="959"/>
+                        <cell id="962"/>
+                        <cell id="960"/>
+                    </row>
+                </header>
+            </group>
+            <group id="538">
+                <property name="groupName">center_group</property>
+                <property name="interval">none</property>
+                <property name="sortDirection">asc</property>
+                <expression name="keyExpr">row["center_id"]</expression>
+                <expression name="toc">row["center_name"]</expression>
+                <property name="repeatHeader">false</property>
+                <property name="hideDetail">false</property>
+                <property name="pageBreakAfter">always-excluding-last</property>
+                <property name="pageBreakBefore">auto</property>
+                <header>
+                    <row id="539">
+                        <cell id="436">
+                            <property name="colSpan">16</property>
+                            <property name="rowSpan">1</property>
+                            <grid id="54">
+                                <property name="width">100%</property>
+                                <column id="55"/>
+                                <column id="56"/>
+                                <row id="57">
+                                    <cell id="58">
+                                        <property name="style">pageHeader</property>
+                                        <label id="60">
+                                            <property name="style">pageHeaderLeft</property>
+                                            <text-property name="text" key="collection.sheet.title">Collection Sheet Report</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="59">
+                                        <property name="style">pageHeader</property>
+                                        <label id="61">
+                                            <property name="style">pageHeaderRight</property>
+                                            <property name="color">#808080</property>
+                                            <text-property name="text" key="collection.sheet.local.title">Grameen Foundation</text-property>
+                                        </label>
+                                    </cell>
+                                </row>
+                            </grid>
+                        </cell>
+                    </row>
+                    <row id="568">
+                        <cell id="422">
+                            <property name="colSpan">16</property>
+                            <property name="rowSpan">1</property>
+                            <grid id="65">
+                                <property name="style">pageSubheader</property>
+                                <property name="borderBottomColor">#000000</property>
+                                <property name="borderBottomStyle">solid</property>
+                                <property name="borderBottomWidth">thin</property>
+                                <property name="width">100%</property>
+                                <column id="66">
+                                    <property name="width">0.67in</property>
+                                </column>
+                                <column id="921"/>
+                                <column id="67">
+                                    <property name="width">7.7in</property>
+                                </column>
+                                <column id="924"/>
+                                <row id="68">
+                                    <cell id="69">
+                                        <property name="style">pageSubheaderLeft</property>
+                                        <label id="926">
+                                            <text-property name="text" key="collection.sheet.branch.label"></text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="919">
+                                        <property name="style">pageSubheaderLeft</property>
+                                        <data id="898">
+                                            <property name="resultSetColumn">rpt_branch</property>
+                                        </data>
+                                    </cell>
+                                    <cell id="70">
+                                        <property name="style">pageSubheaderRight</property>
+                                        <label id="927">
+                                            <text-property name="text" key="collection.sheet.loanofficer.label"></text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="922">
+                                        <property name="style">pageSubheaderRight</property>
+                                        <property name="textAlign">left</property>
+                                        <data id="900">
+                                            <property name="resultSetColumn">rpt_loanOfficer</property>
+                                        </data>
+                                    </cell>
+                                </row>
+                                <row id="71">
+                                    <cell id="72">
+                                        <property name="style">pageSubheaderLeft</property>
+                                        <text-data id="998">
+                                            <expression name="valueExpr">row["customer_level_label"]</expression>
+                                            <property name="contentType">html</property>
+                                        </text-data>
+                                    </cell>
+                                    <cell id="920">
+                                        <property name="style">pageSubheaderLeft</property>
+                                        <data id="899">
+                                            <property name="resultSetColumn">rpt_center</property>
+                                        </data>
+                                    </cell>
+                                    <cell id="73">
+                                        <property name="style">pageSubheaderRight</property>
+                                        <label id="928">
+                                            <text-property name="text" key="collection.sheet.meetingdate.label"></text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="923">
+                                        <property name="style">pageSubheaderRight</property>
+                                        <property name="textAlign">left</property>
+                                        <data id="901">
+                                            <property name="resultSetColumn">rpt_meetingDate</property>
+                                        </data>
+                                    </cell>
+                                </row>
+                            </grid>
+                        </cell>
+                    </row>
+                    <row id="610">
+                        <cell id="137">
+                            <property name="style">tableHeader</property>
+                            <label id="187">
+                                <text-property name="text" key="collection.sheet.table.member.id">ID</text-property>
+                            </label>
+                        </cell>
+                        <cell id="138">
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="188">
+                                <text-property name="text" key="collection.sheet.table.member.name">Member</text-property>
+                            </label>
+                        </cell>
+                        <cell id="139">
+                            <property name="colSpan">4</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="202">
+                                <text-property name="text" key="collection.sheet.table.balances">Balances</text-property>
+                            </label>
+                        </cell>
+                        <cell id="143">
+                            <property name="colSpan">4</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableHeader</property>
+                            <label id="203">
+                                <text-property name="text" key="collection.sheet.table.due">Due</text-property>
+                            </label>
+                        </cell>
+                        <cell id="244">
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="148">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="209">
+                                <text-property name="text" key="collection.sheet.table.other.collection">Other Collection</text-property>
+                            </label>
+                        </cell>
+                        <cell id="839">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <text id="891">
+                                <property name="contentType">html</property>
+                                <text-property name="content" key="collection.sheet.table.issues"><![CDATA[Issues]]></text-property>
+                            </text>
+                        </cell>
+                        <cell id="854">
+                            <property name="style">tableHeader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="890">
+                                <text-property name="text" key="collection.sheet.table.att">Att</text-property>
+                            </label>
+                        </cell>
+                    </row>
+                    <row id="596">
+                        <cell id="190">
+                            <property name="style">tableMainSubheader</property>
+                        </cell>
+                        <cell id="191">
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="192">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="224">
+                                <text-property name="text" key="collection.sheet.table.balances.loan">Loan Instance</text-property>
+                            </label>
+                        </cell>
+                        <cell id="194">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="225">
+                                <text-property name="text" key="collection.sheet.table.balances.savings">Savings Instance</text-property>
+                            </label>
+                        </cell>
+                        <cell id="196">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="226">
+                                <text-property name="text" key="collection.sheet.table.due.loan">Loan Instance</text-property>
+                            </label>
+                        </cell>
+                        <cell id="198">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="227">
+                                <text-property name="text" key="collection.sheet.table.balances.savings">Savings Instance</text-property>
+                            </label>
+                        </cell>
+                        <cell id="200">
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="228">
+                                <text-property name="text" key="collection.sheet.table.due.loan.total">Total Due</text-property>
+                            </label>
+                        </cell>
+                        <cell id="201">
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="205">
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="840">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <text id="979">
+                                <property name="contentType">html</property>
+                                <text-property name="content" key="collection.sheet.table.issues.subheader"><![CDATA[Loan Instance]]></text-property>
+                            </text>
+                        </cell>
+                        <cell id="855">
+                            <property name="style">tableMainSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                    </row>
+                    <row id="582">
+                        <cell id="211">
+                            <property name="style">tableSubheader</property>
+                        </cell>
+                        <cell id="212">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="213">
+                            <property name="style">tableSubheader</property>
+                            <data id="985">
+                                <property name="resultSetColumn">loan_1_name</property>
+                            </data>
+                        </cell>
+                        <cell id="214">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="986">
+                                <property name="resultSetColumn">loan_2_name</property>
+                            </data>
+                        </cell>
+                        <cell id="215">
+                            <property name="style">tableSubheader</property>
+                            <data id="987">
+                                <property name="resultSetColumn">savings_1_name</property>
+                            </data>
+                        </cell>
+                        <cell id="216">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="988">
+                                <property name="resultSetColumn">savings_2_name</property>
+                            </data>
+                        </cell>
+                        <cell id="217">
+                            <property name="style">tableSubheader</property>
+                            <data id="989">
+                                <property name="resultSetColumn">loan_1_name</property>
+                            </data>
+                        </cell>
+                        <cell id="218">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="990">
+                                <property name="resultSetColumn">loan_2_name</property>
+                            </data>
+                        </cell>
+                        <cell id="219">
+                            <property name="style">tableSubheader</property>
+                            <data id="991">
+                                <property name="resultSetColumn">savings_1_name</property>
+                            </data>
+                        </cell>
+                        <cell id="220">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="992">
+                                <property name="resultSetColumn">savings_2_name</property>
+                            </data>
+                        </cell>
+                        <cell id="221">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                        <cell id="222">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="237">
+                                <text-property name="text" key="collection.sheet.table.other.collection.fees">Fees</text-property>
+                            </label>
+                        </cell>
+                        <cell id="223">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <label id="238">
+                                <text-property name="text" key="collection.sheet.table.other.collection.fines">Fine</text-property>
+                            </label>
+                        </cell>
+                        <cell id="841">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="993">
+                                <property name="resultSetColumn">loan_1_name</property>
+                            </data>
+                        </cell>
+                        <cell id="967">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="994">
+                                <property name="resultSetColumn">loan_2_name</property>
+                            </data>
+                        </cell>
+                        <cell id="856">
+                            <property name="style">tableSubheader</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                    </row>
+                </header>
+                <footer>
+                    <row id="553">
+                        <list-property name="visibility">
+                            <structure>
+                                <property name="format">all</property>
+                                <expression name="valueExpr">customerLevel == CUSTOMER_LEVEL_GROUP</expression>
+                            </structure>
+                        </list-property>
+                        <cell id="554"/>
+                        <cell id="555">
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="758">
+                                <property name="style">groupRowHeader</property>
+                                <property name="resultSetColumn">rpt_center_name</property>
+                            </data>
+                        </cell>
+                        <cell id="556">
+                            <property name="style">numberFormat</property>
+                            <data id="384">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_1_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="557">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="395">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_2_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="558">
+                            <property name="style">numberFormat</property>
+                            <data id="409">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_savings_1_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="559">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="410">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_savings_2_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="560">
+                            <property name="style">numberFormat</property>
+                            <data id="411">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_1_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="561">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="412">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_2_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="562">
+                            <property name="style">numberFormat</property>
+                            <data id="413">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_savings_1_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="563">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="415">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_savings_2_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="564">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="416">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="565">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="417">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_other_fee_total</property>
+                            </data>
+                        </cell>
+                        <cell id="566">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="418">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_other_fine_total</property>
+                            </data>
+                        </cell>
+                        <cell id="844">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="913">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_1_issues_total</property>
+                            </data>
+                        </cell>
+                        <cell id="970">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="984">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">center_loan_2_issues_total</property>
+                            </data>
+                        </cell>
+                        <cell id="859">
+                            <property name="style">numberFormat</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                    </row>
+                    <row id="611">
+                        <cell id="612">
+                            <label id="761"/>
+                        </cell>
+                        <cell id="613"/>
+                        <cell id="614"/>
+                        <cell id="615"/>
+                        <cell id="616"/>
+                        <cell id="617"/>
+                        <cell id="618"/>
+                        <cell id="619"/>
+                        <cell id="620"/>
+                        <cell id="621"/>
+                        <cell id="622"/>
+                        <cell id="623"/>
+                        <cell id="624"/>
+                        <cell id="845"/>
+                        <cell id="971"/>
+                        <cell id="860"/>
+                    </row>
+                    <row id="625">
+                        <cell id="626"/>
+                        <cell id="627">
+                            <property name="colSpan">15</property>
+                            <property name="rowSpan">1</property>
+                            <grid id="639">
+                                <property name="width">100%</property>
+                                <column id="640">
+                                    <property name="width">1.375in</property>
+                                </column>
+                                <column id="641">
+                                    <property name="width">1.3229166667in</property>
+                                </column>
+                                <column id="642">
+                                    <property name="width">1.7395833333in</property>
+                                </column>
+                                <column id="643">
+                                    <property name="width">0.8125in</property>
+                                </column>
+                                <column id="644">
+                                    <property name="width">1.65625in</property>
+                                </column>
+                                <column id="645">
+                                    <property name="width">0.96875in</property>
+                                </column>
+                                <column id="646">
+                                    <property name="width">1.0520833333in</property>
+                                </column>
+                                <column id="647">
+                                    <property name="width">1.59375in</property>
+                                </column>
+                                <row id="648">
+                                    <cell id="649">
+                                        <property name="colSpan">1</property>
+                                        <property name="rowSpan">1</property>
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <label id="760">
+                                            <text-property name="text" key="collection.sheet.summary.collection">Collection</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="915">
+                                        <property name="style">reportSummaryHeader</property>
+                                    </cell>
+                                    <cell id="651">
+                                        <property name="colSpan">1</property>
+                                        <property name="rowSpan">1</property>
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="762">
+                                            <text-property name="text" key="collection.sheet.summary.disbursement">Disbursement</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="916">
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="917">
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="918">
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="655">
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                        <label id="763">
+                                            <property name="textAlign">center</property>
+                                            <text-property name="text" key="collection.sheet.summary.amount.taken.back">Amount taken back to office</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="656">
+                                        <property name="style">reportSummaryHeader</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                        <label id="764">
+                                            <property name="textAlign">center</property>
+                                            <text-property name="text" key="collection.sheet.summary.announcements">Announcements</text-property>
+                                        </label>
+                                    </cell>
+                                </row>
+                                <row id="657">
+                                    <property name="style">summaryText</property>
+                                    <cell id="658">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <label id="765">
+                                            <text-property name="text" key="collection.sheet.summary.collection.due">Due Collection</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="659">
+                                        <property name="style">numberFormat</property>
+                                        <data id="771">
+                                            <structure name="numberFormat">
+                                                <property name="category">Currency</property>
+                                                <property name="pattern">###0.00</property>
+                                            </structure>
+                                            <property name="resultSetColumn">due_collection</property>
+                                        </data>
+                                    </cell>
+                                    <cell id="660">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="774">
+                                            <text-property name="text" key="collection.sheet.summary.disbursement.due">Due Disbursement</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="661">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="662">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="778">
+                                            <text-property name="text" key="collection.sheet.summary.application.taken">Application Taken</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="663">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="664">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                    <cell id="665">
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                </row>
+                                <row id="666">
+                                    <property name="style">summaryText</property>
+                                    <cell id="667">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <label id="766">
+                                            <text-property name="text" key="collection.sheet.summary.collection.other">Other Collection</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="668">
+                                        <property name="style">numberFormat</property>
+                                        <data id="772">
+                                            <structure name="numberFormat">
+                                                <property name="category">Currency</property>
+                                                <property name="pattern">###0.00</property>
+                                            </structure>
+                                            <property name="resultSetColumn">other_collection</property>
+                                        </data>
+                                    </cell>
+                                    <cell id="669">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="775">
+                                            <text-property name="text" key="collection.sheet.summary.disbursement.actual">Actual Disbursement</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="670">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="671">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="779">
+                                            <text-property name="text" key="collection.sheet.summary.loans.issued">No. of Loans Issued</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="672">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="673">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                    <cell id="674">
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                </row>
+                                <row id="675">
+                                    <property name="style">summaryText</property>
+                                    <cell id="676">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <label id="767">
+                                            <property name="fontWeight">bold</property>
+                                            <text-property name="text" key="collection.sheet.summary.collection.total">Total Collection</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="677">
+                                        <property name="style">numberFormat</property>
+                                        <data id="773">
+                                            <property name="fontWeight">bold</property>
+                                            <structure name="numberFormat">
+                                                <property name="category">Currency</property>
+                                                <property name="pattern">###0.00</property>
+                                            </structure>
+                                            <property name="resultSetColumn">total_collection</property>
+                                        </data>
+                                    </cell>
+                                    <cell id="678">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="776">
+                                            <text-property name="text" key="collection.sheet.summary.disbursement.other">Other Disbursement</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="679">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="680">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="780">
+                                            <text-property name="text" key="collection.sheet.summary.absent">Absent / Defaults</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="681">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="682">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                    <cell id="683">
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                </row>
+                                <row id="684">
+                                    <property name="style">summaryText</property>
+                                    <cell id="685">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                    </cell>
+                                    <cell id="686"/>
+                                    <cell id="687">
+                                        <property name="paddingLeft">10px</property>
+                                        <label id="777">
+                                            <text-property name="text" key="collection.sheet.summary.disbursement.total">Total Disbursement</text-property>
+                                        </label>
+                                    </cell>
+                                    <cell id="688">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="689">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="690">
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="691">
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                    <cell id="692">
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                </row>
+                                <row id="825">
+                                    <property name="style">summaryText</property>
+                                    <cell id="826">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <label id="834"/>
+                                    </cell>
+                                    <cell id="827">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                    </cell>
+                                    <cell id="828">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="829">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="830">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="831">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="paddingLeft">10px</property>
+                                    </cell>
+                                    <cell id="832">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="borderLeftColor">#000000</property>
+                                        <property name="borderLeftStyle">solid</property>
+                                        <property name="borderLeftWidth">1pt</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                    <cell id="833">
+                                        <property name="borderBottomColor">#000000</property>
+                                        <property name="borderBottomStyle">solid</property>
+                                        <property name="borderBottomWidth">thin</property>
+                                        <property name="borderRightColor">#000000</property>
+                                        <property name="borderRightStyle">solid</property>
+                                        <property name="borderRightWidth">1pt</property>
+                                    </cell>
+                                </row>
+                            </grid>
+                        </cell>
+                    </row>
+                    <row id="781">
+                        <cell id="782">
+                            <label id="795"/>
+                        </cell>
+                        <cell id="783"/>
+                        <cell id="784"/>
+                        <cell id="785"/>
+                        <cell id="786"/>
+                        <cell id="787"/>
+                        <cell id="788"/>
+                        <cell id="789"/>
+                        <cell id="790"/>
+                        <cell id="791"/>
+                        <cell id="792"/>
+                        <cell id="793"/>
+                        <cell id="794"/>
+                        <cell id="847"/>
+                        <cell id="973"/>
+                        <cell id="862"/>
+                    </row>
+                    <row id="872">
+                        <cell id="873">
+                            <label id="888"/>
+                        </cell>
+                        <cell id="874"/>
+                        <cell id="875"/>
+                        <cell id="876"/>
+                        <cell id="877"/>
+                        <cell id="878"/>
+                        <cell id="879"/>
+                        <cell id="880"/>
+                        <cell id="881"/>
+                        <cell id="882"/>
+                        <cell id="883"/>
+                        <cell id="884"/>
+                        <cell id="885"/>
+                        <cell id="886"/>
+                        <cell id="974"/>
+                        <cell id="887"/>
+                    </row>
+                    <row id="796">
+                        <cell id="797"/>
+                        <cell id="798">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">signatureLine</property>
+                        </cell>
+                        <cell id="800"/>
+                        <cell id="801">
+                            <property name="colSpan">1</property>
+                            <property name="rowSpan">1</property>
+                        </cell>
+                        <cell id="896">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">signatureLine</property>
+                        </cell>
+                        <cell id="804">
+                            <property name="colSpan">1</property>
+                            <property name="rowSpan">1</property>
+                        </cell>
+                        <cell id="895"/>
+                        <cell id="806">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">signatureLine</property>
+                        </cell>
+                        <cell id="892"/>
+                        <cell id="809"/>
+                        <cell id="848">
+                            <property name="colSpan">3</property>
+                            <property name="rowSpan">1</property>
+                            <property name="style">signatureLine</property>
+                        </cell>
+                    </row>
+                    <row id="810">
+                        <property name="style">summaryText</property>
+                        <cell id="811"/>
+                        <cell id="812">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <label id="867">
+                                <property name="textAlign">center</property>
+                                <text-property name="text" key="collection.sheet.signature.center.leader">Center Leader</text-property>
+                            </label>
+                        </cell>
+                        <cell id="814"/>
+                        <cell id="815">
+                            <property name="colSpan">1</property>
+                            <property name="rowSpan">1</property>
+                        </cell>
+                        <cell id="897">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <label id="868">
+                                <property name="textAlign">center</property>
+                                <text-property name="text" key="collection.sheet.signature.center.manager">Center Manager</text-property>
+                            </label>
+                        </cell>
+                        <cell id="818">
+                            <property name="colSpan">1</property>
+                            <property name="rowSpan">1</property>
+                        </cell>
+                        <cell id="894"/>
+                        <cell id="820">
+                            <property name="colSpan">2</property>
+                            <property name="rowSpan">1</property>
+                            <label id="869">
+                                <property name="textAlign">center</property>
+                                <text-property name="text" key="collection.sheet.signature.cashier">Cashier</text-property>
+                            </label>
+                        </cell>
+                        <cell id="893"/>
+                        <cell id="823"/>
+                        <cell id="849">
+                            <property name="colSpan">3</property>
+                            <property name="rowSpan">1</property>
+                            <label id="870">
+                                <property name="textAlign">center</property>
+                                <text-property name="text" key="collection.sheet.signature.branch.manager">Branch Manager</text-property>
+                            </label>
+                        </cell>
+                    </row>
+                </footer>
+            </group>
+            <group id="334">
+                <property name="groupName">group</property>
+                <property name="interval">none</property>
+                <property name="sortDirection">asc</property>
+                <expression name="keyExpr">row["group_id"]</expression>
+                <property name="repeatHeader">false</property>
+                <property name="hideDetail">false</property>
+                <property name="pageBreakAfter">auto</property>
+                <property name="pageBreakBefore">auto</property>
+                <footer>
+                    <row id="349">
+                        <cell id="350"/>
+                        <cell id="351">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <property name="textAlign">left</property>
+                            <data id="363">
+                                <property name="style">groupRowHeader</property>
+                                <property name="resultSetColumn">group_id</property>
+                            </data>
+                        </cell>
+                        <cell id="352">
+                            <property name="style">groupFooter</property>
+                            <data id="378">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_1_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="353">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="385">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_2_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="354">
+                            <property name="style">groupFooter</property>
+                            <data id="406">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_savings_1_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="355">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="387">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_savings_2_balance_total</property>
+                            </data>
+                        </cell>
+                        <cell id="356">
+                            <property name="style">groupFooter</property>
+                            <data id="388">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_1_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="357">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="389">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_2_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="358">
+                            <property name="style">groupFooter</property>
+                            <data id="390">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_savings_1_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="359">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="391">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_savings_2_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="360">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="392">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_due_total</property>
+                            </data>
+                        </cell>
+                        <cell id="361">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="393">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_other_fee_total</property>
+                            </data>
+                        </cell>
+                        <cell id="362">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="394">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_other_fine_total</property>
+                            </data>
+                        </cell>
+                        <cell id="843">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="912">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_1_issues_total</property>
+                            </data>
+                        </cell>
+                        <cell id="969">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                            <data id="983">
+                                <structure name="numberFormat">
+                                    <property name="category">Currency</property>
+                                    <property name="pattern">###0.00</property>
+                                </structure>
+                                <property name="resultSetColumn">group_loan_2_issues_total</property>
+                            </data>
+                        </cell>
+                        <cell id="858">
+                            <property name="style">groupFooter</property>
+                            <property name="borderRightColor">#808080</property>
+                            <property name="borderRightStyle">solid</property>
+                            <property name="borderRightWidth">1pt</property>
+                        </cell>
+                    </row>
+                </footer>
+            </group>
+            <detail>
+                <row id="149">
+                    <property name="style">rowText</property>
+                    <cell id="150">
+                        <property name="style">idText</property>
+                        <data id="261">
+                            <structure name="numberFormat">
+                                <property name="category">Custom</property>
+                                <property name="pattern">00</property>
+                            </structure>
+                            <property name="resultSetColumn">member_id</property>
+                        </data>
+                    </cell>
+                    <cell id="151">
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="262">
+                            <property name="resultSetColumn">member_name</property>
+                        </data>
+                    </cell>
+                    <cell id="152">
+                        <property name="style">numberFormat</property>
+                        <data id="263">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_1_balance</property>
+                        </data>
+                    </cell>
+                    <cell id="153">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="264">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_2_balance</property>
+                        </data>
+                    </cell>
+                    <cell id="154">
+                        <property name="style">numberFormat</property>
+                        <data id="265">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">savings_1_balance</property>
+                        </data>
+                    </cell>
+                    <cell id="155">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="266">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">savings_2_balance</property>
+                        </data>
+                    </cell>
+                    <cell id="156">
+                        <property name="style">numberFormat</property>
+                        <data id="267">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_1_due</property>
+                        </data>
+                    </cell>
+                    <cell id="157">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="268">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_2_due</property>
+                        </data>
+                    </cell>
+                    <cell id="158">
+                        <property name="style">numberFormat</property>
+                        <data id="269">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">savings_1_due</property>
+                        </data>
+                    </cell>
+                    <cell id="159">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="270">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">savings_2_due</property>
+                        </data>
+                    </cell>
+                    <cell id="160">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="273">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">due_total</property>
+                        </data>
+                    </cell>
+                    <cell id="161">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="274">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">other_fee</property>
+                        </data>
+                    </cell>
+                    <cell id="206">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="275">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">other_fine</property>
+                        </data>
+                    </cell>
+                    <cell id="842">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="911">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_1_issues</property>
+                        </data>
+                    </cell>
+                    <cell id="968">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                        <data id="982">
+                            <structure name="numberFormat">
+                                <property name="category">Currency</property>
+                                <property name="pattern">###0.00</property>
+                            </structure>
+                            <property name="resultSetColumn">loan_2_issues</property>
+                        </data>
+                    </cell>
+                    <cell id="857">
+                        <property name="style">numberFormat</property>
+                        <property name="borderRightColor">#808080</property>
+                        <property name="borderRightStyle">solid</property>
+                        <property name="borderRightWidth">1pt</property>
+                    </cell>
+                </row>
+            </detail>
+            <footer>
+                <row id="162">
+                    <cell id="163"/>
+                    <cell id="164"/>
+                    <cell id="165"/>
+                    <cell id="166"/>
+                    <cell id="167"/>
+                    <cell id="168"/>
+                    <cell id="169"/>
+                    <cell id="170"/>
+                    <cell id="171"/>
+                    <cell id="172"/>
+                    <cell id="173"/>
+                    <cell id="174"/>
+                    <cell id="207"/>
+                    <cell id="850"/>
+                    <cell id="977"/>
+                    <cell id="865"/>
+                </row>
+            </footer>
+        </table>
+    </body>
+</report>
Index: BirtReportDesign/ActiveLoansByLoanOfficer.rptdesign
===================================================================
--- BirtReportDesign/ActiveLoansByLoanOfficer.rptdesign	(revision 12247)
+++ BirtReportDesign/ActiveLoansByLoanOfficer.rptdesign	(working copy)
@@ -11,15 +11,6 @@
         </structure>
     </list-property>
     <parameters>
-        <scalar-parameter name="reportName" id="1126">
-            <property name="hidden">false</property>
-            <property name="valueType">static</property>
-            <property name="dataType">string</property>
-            <property name="controlType">text-box</property>
-            <structure name="format">
-                <property name="category">Unformatted</property>
-            </structure>
-        </scalar-parameter>
         <scalar-parameter name="userId" id="157">
             <property name="hidden">true</property>
             <property name="valueType">static</property>
@@ -79,13 +70,13 @@
     </parameters>
     <data-sources>
         <script-data-source name="Scripted Data Source for Report#2" id="153">
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DS-OPEN");
-
-var userId = reportContext.getParameterValue("userId");
-reportsDataService = new Packages.org.mifos.application.reports.business.service.ReportsDataService();
-reportsDataService.initialize(userId);
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DS-OPEN");
+
+var userId = reportContext.getParameterValue("userId");
+reportsDataService = new Packages.org.mifos.application.reports.business.service.ReportsDataService();
+reportsDataService.initialize(userId);
 Packages.org.mifos.application.productdefinition.persistence.LoanPrdPersistence.enableThreadCacheForReports();]]></method>
-            <method name="close"><![CDATA[reportsDataService = null;
+            <method name="close"><![CDATA[reportsDataService = null;
 Packages.org.mifos.application.productdefinition.persistence.LoanPrdPersistence.disableThreadCacheForReports();]]></method>
         </script-data-source>
     </data-sources>
@@ -126,51 +117,51 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source for Report#2</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LP");
-var request = reportContext.getHttpServletRequest();
-Packages.java.util.logging.Logger.getLogger("").info("request:" + request );
-
-loanProducts = reportsDataService.getAllLoanProducts();
-if (loanProducts.size()>1) {
-	reportContext.setParameterValue("loanProductId", loanProducts.get(1).getPrdOfferingId());
-	reportContext.setPersistentGlobalVariable("defaultLoanProductId", loanProducts.get(1).getPrdOfferingId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanProduct as default:" + reportContext.getParameterValue("loanProductId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanProductId:" + reportContext.getPersistentGlobalVariable("defaultLoanProductId"));
-}
-
-iterator = loanProducts.iterator();
-
-flag = 0;
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LP");
+var request = reportContext.getHttpServletRequest();
+Packages.java.util.logging.Logger.getLogger("").info("request:" + request );
+
+loanProducts = reportsDataService.getAllLoanProducts();
+if (loanProducts.size()>1) {
+	reportContext.setParameterValue("loanProductId", loanProducts.get(1).getPrdOfferingId());
+	reportContext.setPersistentGlobalVariable("defaultLoanProductId", loanProducts.get(1).getPrdOfferingId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanProduct as default:" + reportContext.getParameterValue("loanProductId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanProductId:" + reportContext.getPersistentGlobalVariable("defaultLoanProductId"));
+}
+
+iterator = loanProducts.iterator();
+
+flag = 0;
 branchId = reportContext.getParameterValue("branchId");]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	if(branchId == null || branchId == -2){
-	    row["ID"] = -2;
-	    row["Name"] = "---Select---";
-	    
-	}else if(loanProducts.size() == 1) {
-        row["ID"] = -2;
-	    row["Name"] = "---N/A---";
-    }
-	flag = -1;
-	return true;
-}
-
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-
-if (loanProducts.size()>1) {
-    var loanProduct = iterator.next( );
-
-    row["ID"] = loanProduct.getPrdOfferingId();
-    row["Name"] = loanProduct.getPrdOfferingName();
-    if(row["ID"] == null)
-       row["ID"] = -1;
-
-    return true;
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	if(branchId == null || branchId == -2){
+	    row["ID"] = -2;
+	    row["Name"] = "---Select---";
+	    
+	}else if(loanProducts.size() == 1) {
+        row["ID"] = -2;
+	    row["Name"] = "---N/A---";
+    }
+	flag = -1;
+	return true;
+}
+
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+
+if (loanProducts.size()>1) {
+    var loanProduct = iterator.next( );
+
+    row["ID"] = loanProduct.getPrdOfferingId();
+    row["Name"] = loanProduct.getPrdOfferingName();
+    if(row["ID"] == null)
+       row["ID"] = -1;
+
+    return true;
 }]]></method>
-            <method name="close"><![CDATA[loanProducts = null;
+            <method name="close"><![CDATA[loanProducts = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="Branches" id="155">
@@ -209,37 +200,37 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source for Report#2</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("BR");
-branches = reportsDataService.getActiveBranchesUnderUser();
-
-if (branches.size()>1) {
-	reportContext.setParameterValue("branchId", branches.get(1).getOfficeId());
-	reportContext.setPersistentGlobalVariable("defaultBranchId", branches.get(1).getOfficeId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd branch as default:" + reportContext.getParameterValue("branchId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
-}
-
-iterator = branches.iterator();
-
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("BR");
+branches = reportsDataService.getActiveBranchesUnderUser();
+
+if (branches.size()>1) {
+	reportContext.setParameterValue("branchId", branches.get(1).getOfficeId());
+	reportContext.setPersistentGlobalVariable("defaultBranchId", branches.get(1).getOfficeId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd branch as default:" + reportContext.getParameterValue("branchId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
+}
+
+iterator = branches.iterator();
+
 flag = 0;]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	row["ID"] = -2;
-	row["Name"] = "---Select---";
-	flag = -1;
-	return true;
-}
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-
-var branch = iterator.next();
-
-row["ID"] = branch.getOfficeId();
-row["Name"] = branch.getOfficeName();
-
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	row["ID"] = -2;
+	row["Name"] = "---Select---";
+	flag = -1;
+	return true;
+}
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+
+var branch = iterator.next();
+
+row["ID"] = branch.getOfficeId();
+row["Name"] = branch.getOfficeName();
+
 return true;]]></method>
-            <method name="close"><![CDATA[branches = null;
+            <method name="close"><![CDATA[branches = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="Loan Officers" id="156">
@@ -278,51 +269,51 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source for Report#2</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LO");
-branchId = reportContext.getParameterValue("branchId");
-Packages.java.util.logging.Logger.getLogger("").info("getParameterValue-branchId:" + branchId);
-Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
-
-loanOfficers = reportsDataService.getActiveLoanOfficers(branchId);
-
-if (loanOfficers.size()>1) {
-	reportContext.setParameterValue("loanOfficerId", loanOfficers.get(1).getPersonnelId());
-	reportContext.setPersistentGlobalVariable("defaultLoanOfficerId", loanOfficers.get(1).getPersonnelId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanOfficer as default:" + reportContext.getParameterValue("loanOfficerId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanOfficerId:" + reportContext.getPersistentGlobalVariable("defaultLoanOfficerId"));
-}
-
-iterator = loanOfficers.iterator();
-
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LO");
+branchId = reportContext.getParameterValue("branchId");
+Packages.java.util.logging.Logger.getLogger("").info("getParameterValue-branchId:" + branchId);
+Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
+
+loanOfficers = reportsDataService.getActiveLoanOfficers(branchId);
+
+if (loanOfficers.size()>1) {
+	reportContext.setParameterValue("loanOfficerId", loanOfficers.get(1).getPersonnelId());
+	reportContext.setPersistentGlobalVariable("defaultLoanOfficerId", loanOfficers.get(1).getPersonnelId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanOfficer as default:" + reportContext.getParameterValue("loanOfficerId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanOfficerId:" + reportContext.getPersistentGlobalVariable("defaultLoanOfficerId"));
+}
+
+iterator = loanOfficers.iterator();
+
 flag = 0;]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	if(branchId == null || branchId == -2){
-	    row["ID"] = -2;
-	    row["Name"] = "---Select---";
-	    
-	}else if(loanOfficers.size() == 1) {
-        row["ID"] = -2;
-	    row["Name"] = "---N/A---";
-    }
-	flag = -1;
-	return true;
-}
-
-if(iterator.hasNext() == false ) {
-	return false;
-}
-
-if (loanOfficers.size()>1) {
-    var loanOfficer = iterator.next( );
-
-    row["ID"] = loanOfficer.getPersonnelId();
-    row["Name"] = loanOfficer.getDisplayName();
-    if(row["ID"] == null)
-       row["ID"] = -1;
-
-    return true;
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	if(branchId == null || branchId == -2){
+	    row["ID"] = -2;
+	    row["Name"] = "---Select---";
+	    
+	}else if(loanOfficers.size() == 1) {
+        row["ID"] = -2;
+	    row["Name"] = "---N/A---";
+    }
+	flag = -1;
+	return true;
+}
+
+if(iterator.hasNext() == false ) {
+	return false;
+}
+
+if (loanOfficers.size()>1) {
+    var loanOfficer = iterator.next( );
+
+    row["ID"] = loanOfficer.getPersonnelId();
+    row["Name"] = loanOfficer.getDisplayName();
+    if(row["ID"] == null)
+       row["ID"] = -1;
+
+    return true;
 }]]></method>
-            <method name="close"><![CDATA[loanOfficers = null;
+            <method name="close"><![CDATA[loanOfficers = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="Data Set For Active Loans By Loan Officer" id="860">
@@ -502,42 +493,42 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source for Report#2</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DFLAIAB");
-
-var branchId = reportContext.getParameterValue("branchId");
-var loanOfficerId = reportContext.getParameterValue("loanOfficerId");
-var loanProductId = reportContext.getParameterValue("loanProductId");
-
-loans = reportsDataService.getActiveLoansBothInGoodAndBadStandingByLoanOfficer(branchId,loanOfficerId,loanProductId);
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DFLAIAB");
+
+var branchId = reportContext.getParameterValue("branchId");
+var loanOfficerId = reportContext.getParameterValue("loanOfficerId");
+var loanProductId = reportContext.getParameterValue("loanProductId");
+
+loans = reportsDataService.getActiveLoansBothInGoodAndBadStandingByLoanOfficer(branchId,loanOfficerId,loanProductId);
 iterator = loans.iterator();]]></method>
-            <method name="fetch"><![CDATA[if(iterator.hasNext() == false ){
-	return false;
-}
-
-var loan = iterator.next( );
-row["Number"]= loan.getGlobalAccountNum();
-row["Name"] = loan.getCustomer().getDisplayName();
-row["DisbursementAmount"] = loan.getLoanAmount().getAmount();
-row["DisbursementDate"] = loan.getDisbursementDate();
-row["DisbursementTerm"] = loan.getDisbursementTerm();
-
-if(loan.getDetailsOfNextInstallment() != null) {
-    row["NextPaymentAmount"] = loan.getDetailsOfNextInstallment().getPrincipal().getAmount();
-    row["NextPaymentDate"] = loan.getDetailsOfNextInstallment().getActionDate();
-}else{
-    row["NextPaymentAmount"] = 0;
-    
-}
-row["LoanBalance"] = loan.getRemainingPrincipalAmount().getAmount();
-
-row["PrincipalInArrears"] = loan.getTotalPrincipalAmountInArrearsAndOutsideLateness().getAmount();
-row["InterestInArrears"] = loan.getTotalInterestAmountInArrearsAndOutsideLateness().getAmount();
-
-row["DaysWithoutPayment"] = loan.getDaysWithoutPayment();
-row["PaymentInArrears"] = loan.getPaymentsInArrears();
-row["NetOfSavings"] = loan.getNetOfSaving().getAmount();
+            <method name="fetch"><![CDATA[if(iterator.hasNext() == false ){
+	return false;
+}
+
+var loan = iterator.next( );
+row["Number"]= loan.getGlobalAccountNum();
+row["Name"] = loan.getCustomer().getDisplayName();
+row["DisbursementAmount"] = loan.getLoanAmount().getAmount();
+row["DisbursementDate"] = loan.getDisbursementDate();
+row["DisbursementTerm"] = loan.getDisbursementTerm();
+
+if(loan.getDetailsOfNextInstallment() != null) {
+    row["NextPaymentAmount"] = loan.getDetailsOfNextInstallment().getPrincipal().getAmount();
+    row["NextPaymentDate"] = loan.getDetailsOfNextInstallment().getActionDate();
+}else{
+    row["NextPaymentAmount"] = 0;
+    
+}
+row["LoanBalance"] = loan.getRemainingPrincipalAmount().getAmount();
+
+row["PrincipalInArrears"] = loan.getTotalPrincipalAmountInArrearsAndOutsideLateness().getAmount();
+row["InterestInArrears"] = loan.getTotalInterestAmountInArrearsAndOutsideLateness().getAmount();
+
+row["DaysWithoutPayment"] = loan.getDaysWithoutPayment();
+row["PaymentInArrears"] = loan.getPaymentsInArrears();
+row["NetOfSavings"] = loan.getNetOfSaving().getAmount();
 return true;]]></method>
-            <method name="close"><![CDATA[loans = null;
+            <method name="close"><![CDATA[loans = null;
 iterator = null;]]></method>
         </script-data-set>
     </data-sets>
Index: BirtReportDesign/DetailedAgingPortfolioAtRisk.rptdesign
===================================================================
--- BirtReportDesign/DetailedAgingPortfolioAtRisk.rptdesign	(revision 12247)
+++ BirtReportDesign/DetailedAgingPortfolioAtRisk.rptdesign	(working copy)
@@ -5,8 +5,8 @@
     <property name="units">in</property>
     <property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name here>></property>
     <parameters>
-        <scalar-parameter name="reportName" id="1626">
-            <property name="hidden">false</property>
+        <scalar-parameter name="mifosHiddenParam" id="1626">
+            <property name="hidden">true</property>
             <property name="valueType">static</property>
             <property name="dataType">string</property>
             <property name="controlType">text-box</property>
@@ -73,13 +73,12 @@
     </parameters>
     <data-sources>
         <script-data-source name="Scripted Data Source" id="4">
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DS-OPEN");
-Packages.org.mifos.application.productdefinition.persistence.LoanPrdPersistence.enableThreadCacheForReports();
-var userId = reportContext.getParameterValue("userId");
-
-reportsDataService = new Packages.org.mifos.application.reports.business.service.ReportsDataService();
+            <method name="open"><![CDATA[var logger = Packages.java.util.logging.Logger.getLogger("");
+Packages.org.mifos.application.productdefinition.persistence.LoanPrdPersistence.enableThreadCacheForReports();
+var userId = reportContext.getParameterValue("userId");
+reportsDataService = new Packages.org.mifos.application.reports.business.service.ReportsDataService();
 reportsDataService.initialize(userId);]]></method>
-            <method name="close"><![CDATA[reportsDataService = null;
+            <method name="close"><![CDATA[reportsDataService = null;
 Packages.org.mifos.application.productdefinition.persistence.LoanPrdPersistence.disableThreadCacheForReports();]]></method>
         </script-data-source>
     </data-sources>
@@ -120,51 +119,51 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LP");
-
-var request = reportContext.getHttpServletRequest();
-Packages.java.util.logging.Logger.getLogger("").info("request:" + request );
-
-loanProducts = reportsDataService.getAllLoanProducts();
-if (loanProducts.size()>1) {
-	reportContext.setParameterValue("loanProductId", loanProducts.get(1).getPrdOfferingId());
-	reportContext.setPersistentGlobalVariable("defaultLoanProductId", loanProducts.get(1).getPrdOfferingId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanProduct as default:" + reportContext.getParameterValue("loanProductId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanProductId:" + reportContext.getPersistentGlobalVariable("defaultLoanProductId"));
-}
-
-iterator = loanProducts.iterator();
-
-flag = 0;
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LP");
+
+var request = reportContext.getHttpServletRequest();
+Packages.java.util.logging.Logger.getLogger("").info("request:" + request );
+
+loanProducts = reportsDataService.getAllLoanProducts();
+if (loanProducts.size()>1) {
+	reportContext.setParameterValue("loanProductId", loanProducts.get(1).getPrdOfferingId());
+	reportContext.setPersistentGlobalVariable("defaultLoanProductId", loanProducts.get(1).getPrdOfferingId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanProduct as default:" + reportContext.getParameterValue("loanProductId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanProductId:" + reportContext.getPersistentGlobalVariable("defaultLoanProductId"));
+}
+
+iterator = loanProducts.iterator();
+
+flag = 0;
 branchId = reportContext.getParameterValue("branchId");]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	if(branchId == null || branchId == -2){
-	    row["ID"] = -2;
-	    row["Name"] = "---Select---";
-	    
-	}else if(loanProducts.size() == 1) {
-        row["ID"] = -2;
-	    row["Name"] = "---N/A---";
-    }
-	flag = -1;
-	return true;
-}
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-
-if (loanProducts.size()>1) {
-    var loanProduct = iterator.next( );
-
-    row["ID"] = loanProduct.getPrdOfferingId();
-    row["Name"] = loanProduct.getPrdOfferingName();
-    if(row["ID"] == null)
-       row["ID"] = -1;
-
-    return true;
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	if(branchId == null || branchId == -2){
+	    row["ID"] = -2;
+	    row["Name"] = "---Select---";
+	    
+	}else if(loanProducts.size() == 1) {
+        row["ID"] = -2;
+	    row["Name"] = "---N/A---";
+    }
+	flag = -1;
+	return true;
+}
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+
+if (loanProducts.size()>1) {
+    var loanProduct = iterator.next( );
+
+    row["ID"] = loanProduct.getPrdOfferingId();
+    row["Name"] = loanProduct.getPrdOfferingName();
+    if(row["ID"] == null)
+       row["ID"] = -1;
+
+    return true;
 }]]></method>
-            <method name="close"><![CDATA[loanProducts = null;
+            <method name="close"><![CDATA[loanProducts = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="Branches" id="34">
@@ -203,37 +202,37 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("BR");
-branches = reportsDataService.getActiveBranchesUnderUser();
-
-if (branches.size()>1) {
-	reportContext.setParameterValue("branchId", branches.get(1).getOfficeId());
-	reportContext.setPersistentGlobalVariable("defaultBranchId", branches.get(1).getOfficeId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd branch as default:" + reportContext.getParameterValue("branchId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
-}
-
-iterator = branches.iterator();
-
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("BR");
+branches = reportsDataService.getActiveBranchesUnderUser();
+
+if (branches.size()>1) {
+	reportContext.setParameterValue("branchId", branches.get(1).getOfficeId());
+	reportContext.setPersistentGlobalVariable("defaultBranchId", branches.get(1).getOfficeId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd branch as default:" + reportContext.getParameterValue("branchId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
+}
+
+iterator = branches.iterator();
+
 flag = 0;]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	row["ID"] = -2;
-	row["Name"] = "---Select---";
-	flag = -1;
-	return true;
-}
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-
-var branch = iterator.next();
-
-row["ID"] = branch.getOfficeId();
-row["Name"] = branch.getOfficeName();
-
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	row["ID"] = -2;
+	row["Name"] = "---Select---";
+	flag = -1;
+	return true;
+}
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+
+var branch = iterator.next();
+
+row["ID"] = branch.getOfficeId();
+row["Name"] = branch.getOfficeName();
+
 return true;]]></method>
-            <method name="close"><![CDATA[branches = null;
+            <method name="close"><![CDATA[branches = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="LoanOfficers" id="35">
@@ -272,53 +271,53 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LO");
-branchId = reportContext.getParameterValue("branchId");
-Packages.java.util.logging.Logger.getLogger("").info("getParameterValue-branchId:" + branchId);
-Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
-
-loanOfficers = reportsDataService.getActiveLoanOfficers(branchId);
-
-if (loanOfficers.size()>1) {
-	reportContext.setParameterValue("loanOfficerId", loanOfficers.get(1).getPersonnelId());
-	reportContext.setPersistentGlobalVariable("defaultLoanOfficerId", loanOfficers.get(1).getPersonnelId());
-	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanOfficer as default:" + reportContext.getParameterValue("loanOfficerId"));
-	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanOfficerId:" + reportContext.getPersistentGlobalVariable("defaultLoanOfficerId"));
-}
-
-
-iterator = loanOfficers.iterator();
-
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("LO");
+branchId = reportContext.getParameterValue("branchId");
+Packages.java.util.logging.Logger.getLogger("").info("getParameterValue-branchId:" + branchId);
+Packages.java.util.logging.Logger.getLogger("").info("defaultBranchId:" + reportContext.getPersistentGlobalVariable("defaultBranchId"));
+
+loanOfficers = reportsDataService.getActiveLoanOfficers(branchId);
+
+if (loanOfficers.size()>1) {
+	reportContext.setParameterValue("loanOfficerId", loanOfficers.get(1).getPersonnelId());
+	reportContext.setPersistentGlobalVariable("defaultLoanOfficerId", loanOfficers.get(1).getPersonnelId());
+	Packages.java.util.logging.Logger.getLogger("").info("set 2nd loanOfficer as default:" + reportContext.getParameterValue("loanOfficerId"));
+	Packages.java.util.logging.Logger.getLogger("").info("defaultLoanOfficerId:" + reportContext.getPersistentGlobalVariable("defaultLoanOfficerId"));
+}
+
+
+iterator = loanOfficers.iterator();
+
 flag = 0;]]></method>
-            <method name="fetch"><![CDATA[if(flag == 0) {
-	if(branchId == null || branchId == -2){
-	    row["ID"] = -2;
-	    row["Name"] = "---Select---";
-	    
-	}else if(loanOfficers.size() == 1) {
-        row["ID"] = -2;
-	    row["Name"] = "---N/A---";
-    }
-	flag = -1;
-	return true;
-}
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-
-if (loanOfficers.size()>1) {
-    var loanOfficer = iterator.next( );
-
-    row["ID"] = loanOfficer.getPersonnelId();
-    row["Name"] = loanOfficer.getDisplayName();
-
-    if(row["ID"] == null)
-       row["ID"] = -1;
-   
-    return true;
+            <method name="fetch"><![CDATA[if(flag == 0) {
+	if(branchId == null || branchId == -2){
+	    row["ID"] = -2;
+	    row["Name"] = "---Select---";
+	    
+	}else if(loanOfficers.size() == 1) {
+        row["ID"] = -2;
+	    row["Name"] = "---N/A---";
+    }
+	flag = -1;
+	return true;
+}
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+
+if (loanOfficers.size()>1) {
+    var loanOfficer = iterator.next( );
+
+    row["ID"] = loanOfficer.getPersonnelId();
+    row["Name"] = loanOfficer.getDisplayName();
+
+    if(row["ID"] == null)
+       row["ID"] = -1;
+   
+    return true;
 }]]></method>
-            <method name="close"><![CDATA[loanOfficers = null;
+            <method name="close"><![CDATA[loanOfficers = null;
 iterator = null;]]></method>
         </script-data-set>
         <script-data-set name="DataForLoanAccountInActiveBad" id="849">
@@ -490,57 +489,57 @@
                 </list-property>
             </structure>
             <property name="dataSource">Scripted Data Source</property>
-            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DFLAIAB");
-
-var branchId = reportContext.getParameterValue("branchId");
-
-var loanOfficerId = reportContext.getParameterValue("loanOfficerId");
-
-var loanProductId = reportContext.getParameterValue("loanProductId");
-
-current = reportsDataService.getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(branchId,loanOfficerId,loanProductId);
-loans = reportsDataService.getLoanAccountsInActiveBadStanding(branchId,loanOfficerId,loanProductId);
+            <method name="open"><![CDATA[Packages.java.util.logging.Logger.getLogger("").info("DFLAIAB");
+
+var branchId = reportContext.getParameterValue("branchId");
+
+var loanOfficerId = reportContext.getParameterValue("loanOfficerId");
+
+var loanProductId = reportContext.getParameterValue("loanProductId");
+
+current = reportsDataService.getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(branchId,loanOfficerId,loanProductId);
+loans = reportsDataService.getLoanAccountsInActiveBadStanding(branchId,loanOfficerId,loanProductId);
 iterator = loans.iterator();]]></method>
-            <method name="fetch"><![CDATA[if(current == null)
-{
-    row["Current"] = 0;
-}else{
-    row["Current"] = current;
-}
-
-if(iterator.hasNext() == false ){
-	return false;
-}
-Packages.java.util.logging.Logger.getLogger("").info("FETCH");
-var loan = iterator.next( );
-row["LoanNumber"]= loan.getGlobalAccountNum();
-row["Client"] = loan.getCustomer().getDisplayName();
-row["LoanAmount"] = loan.getLoanAmount().getAmount();
-row["Balance"] = loan.getRemainingPrincipalAmount().getAmount();
-row["Principal"] = loan.getTotalPrincipalAmountInArrearsAndOutsideLateness().getAmount();
-row["Interest"] = loan.getTotalInterestAmountInArrearsAndOutsideLateness().getAmount();
-row["DaysInArrears"] = loan.getDaysInArrears();
-
-if (loan.getDaysInArrears()>=1 && loan.getDaysInArrears() <=30)
-row["1-30"] = row["Balance"];
-
-if (loan.getDaysInArrears()>=31 && loan.getDaysInArrears() <=60)
-row["31-60"] = row["Balance"];
-
-if (loan.getDaysInArrears()>=61 && loan.getDaysInArrears() <=90)
-row["61-90"] = row["Balance"];
-
-if (loan.getDaysInArrears()>=91 && loan.getDaysInArrears()<=180)
-row["91-180"] =row["Balance"];
-
-if (loan.getDaysInArrears()>=181)
-row[">180"] =row["Balance"];
-
-
+            <method name="fetch"><![CDATA[if(current == null)
+{
+    row["Current"] = 0;
+}else{
+    row["Current"] = current;
+}
+
+if(iterator.hasNext() == false ){
+	return false;
+}
+Packages.java.util.logging.Logger.getLogger("").info("FETCH");
+var loan = iterator.next( );
+row["LoanNumber"]= loan.getGlobalAccountNum();
+row["Client"] = loan.getCustomer().getDisplayName();
+row["LoanAmount"] = loan.getLoanAmount().getAmount();
+row["Balance"] = loan.getRemainingPrincipalAmount().getAmount();
+row["Principal"] = loan.getTotalPrincipalAmountInArrearsAndOutsideLateness().getAmount();
+row["Interest"] = loan.getTotalInterestAmountInArrearsAndOutsideLateness().getAmount();
+row["DaysInArrears"] = loan.getDaysInArrears();
+
+if (loan.getDaysInArrears()>=1 && loan.getDaysInArrears() <=30)
+row["1-30"] = row["Balance"];
+
+if (loan.getDaysInArrears()>=31 && loan.getDaysInArrears() <=60)
+row["31-60"] = row["Balance"];
+
+if (loan.getDaysInArrears()>=61 && loan.getDaysInArrears() <=90)
+row["61-90"] = row["Balance"];
+
+if (loan.getDaysInArrears()>=91 && loan.getDaysInArrears()<=180)
+row["91-180"] =row["Balance"];
+
+if (loan.getDaysInArrears()>=181)
+row[">180"] =row["Balance"];
+
+
 return true;]]></method>
-            <method name="close"><![CDATA[loans = null;
-iterator = null;
-current = null;
+            <method name="close"><![CDATA[loans = null;
+iterator = null;
+current = null;
 Packages.java.util.logging.Logger.getLogger("").info("DFLAIAB-CLOSE");]]></method>
         </script-data-set>
     </data-sets>
Index: src/org/mifos/META-INF/ehcache.xml
===================================================================
--- src/org/mifos/META-INF/ehcache.xml	(revision 0)
+++ src/org/mifos/META-INF/ehcache.xml	(revision 0)
@@ -0,0 +1,42 @@
+<ehcache>
+
+	<!-- Sets the path to the directory where cache .data files are created.
+		
+		If the path is a Java System Property it is replaced by
+		its value in the running VM.
+		
+		The following properties are translated:
+		user.home - User's home directory
+		user.dir - User's current working directory
+		java.io.tmpdir - Default temp file path -->
+	<diskStore path="java.io.tmpdir" />
+
+
+	<!--Default Cache configuration. These will applied to caches programmatically created through
+		the CacheManager.
+		
+		The following attributes are required for defaultCache:
+		
+		maxInMemory       - Sets the maximum number of objects that will be created in memory
+		eternal           - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element
+		is never expired.
+		timeToIdleSeconds - Sets the time to idle for an element before it expires.
+		i.e. The maximum amount of time between accesses before an element expires
+		Is only used if the element is not eternal.
+		Optional attribute. A value of 0 means that an Element can idle for infinity
+		timeToLiveSeconds - Sets the time to live for an element before it expires.
+		i.e. The maximum time between creation time and when an element expires.
+		Is only used if the element is not eternal.
+		overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
+		has reached the maxInMemory limit.
+		
+	-->
+	<defaultCache maxElementsInMemory="100000" eternal="false"
+		timeToIdleSeconds="86400" timeToLiveSeconds="86400"
+		overflowToDisk="true" diskPersistent="false"
+		diskExpiryThreadIntervalSeconds="120" />
+	<cache name="org.mifos.application.reports.business.service.cache" maxElementsInMemory="10000"
+		eternal="false" overflowToDisk="true" timeToIdleSeconds="86400"
+		timeToLiveSeconds="86400"/>
+</ehcache>
+
Index: src/org/mifos/META-INF/struts-config.xml
===================================================================
--- src/org/mifos/META-INF/struts-config.xml	(revision 12247)
+++ src/org/mifos/META-INF/struts-config.xml	(working copy)
@@ -37,7 +37,34 @@
         <form-bean name="savingsActionForm"
                    type="org.mifos.application.accounts.savings.struts.actionforms.SavingsActionForm"/>
     </form-beans>
-
+	<global-exceptions>
+        <exception type="org.mifos.framework.exceptions.SystemException"
+                   handler="org.mifos.framework.exceptions.MifosExceptionHandler"
+                   key="exception.framework.SystemException"
+                   scope="request"
+                   path="/pages/framework/jsp/error.jsp"/>
+        <exception type="org.mifos.framework.exceptions.ApplicationException"
+                   handler="org.mifos.framework.exceptions.MifosExceptionHandler"
+                   key="exception.framework.ApplicationException"
+                   scope="request"/>
+        <exception type="org.mifos.framework.exceptions.PageExpiredException"
+                   handler="org.mifos.framework.exceptions.MifosExceptionHandler"
+                   key="exception.framework.PageExpiredException"
+                   scope="request"
+                   path="/pages/framework/jsp/pageexpirederror.jsp"/>
+        <exception type="org.mifos.framework.exceptions.ConnectionNotFoundException"
+                   handler="org.mifos.framework.exceptions.MifosExceptionHandler"
+                   key="exception.framework.ConnectionNotFoundException"
+                   scope="request" path="/pages/framework/jsp/error.jsp"/>
+        <exception type="org.mifos.framework.exceptions.ServiceUnavailableException"
+                   handler="org.mifos.framework.exceptions.MifosExceptionHandler"
+                   key="exception.framework.ServiceUnavailableException"
+                   scope="request" path="/pages/framework/jsp/error.jsp"/>
+    </global-exceptions>
+    <global-forwards>
+        <forward name="welcome" path="/loginAction.do?method=load"/>
+        <forward name="load_main_page" path="/pages/application/login/jsp/login.jsp"/>
+    </global-forwards>
     <global-exceptions>
         <exception type="org.mifos.framework.exceptions.SystemException"
                    handler="org.mifos.framework.exceptions.MifosExceptionHandler"
Index: src/org/mifos/META-INF/web.xml
===================================================================
--- src/org/mifos/META-INF/web.xml	(revision 12247)
+++ src/org/mifos/META-INF/web.xml	(working copy)
@@ -75,6 +75,16 @@
 		<url-pattern>*.do</url-pattern>
 	</servlet-mapping>
 	
+	<!-- Birt Reports Validation Flow Servlet -->
+	<servlet>
+	    <servlet-name>BirtReportValidationController</servlet-name>
+	    <servlet-class>org.mifos.application.reports.action.BirtReportValidationAction</servlet-class>
+	</servlet>
+	<servlet-mapping>
+	    <servlet-name>BirtReportValidationController</servlet-name>
+	    <url-pattern>/birtReports</url-pattern>
+	</servlet-mapping>
+	
 	<!-- pages/actions which don't go through struts -->
 	<servlet>
 	    <servlet-name>Dispatcher</servlet-name>
Index: src/org/mifos/application/accounts/loan/business/LoanBO.java
===================================================================
--- src/org/mifos/application/accounts/loan/business/LoanBO.java	(revision 12247)
+++ src/org/mifos/application/accounts/loan/business/LoanBO.java	(working copy)
@@ -206,20 +206,29 @@
 	private Short recurMonth;
 	
 
-	protected LoanBO() {
-		super();
-		this.loanOffering = null;
-		this.loanSummary = null;
+	protected LoanBO() {		
+		this(null, null, null, null, null);
 		this.loanPrdPersistence = null;
-		this.performanceHistory = null;
 		this.loanActivityDetails = new HashSet<LoanActivityEntity>();
         this.redone = false;
- 		this.maxMinLoanAmount = null;
-		this.maxMinNoOfInstall = null;
     	parentAccount=null;
     	loanAccountDetails=new HashSet<LoanBO>();
 	}
+	
+	public LoanBO(LoanOfferingBO loanOffering){
+		this(loanOffering, null, null, null, null);
+	}
 
+	private LoanBO(LoanOfferingBO loanOffering, LoanSummaryEntity loanSummary, MaxMinLoanAmount maxMinLoanAmount, 
+			MaxMinNoOfInstall maxMinNoOfInstall, LoanPerformanceHistoryEntity performanceHistory) {
+		this.loanOffering = loanOffering;
+		this.loanSummary = loanSummary;
+		this.maxMinLoanAmount = maxMinLoanAmount;
+		this.maxMinNoOfInstall = maxMinNoOfInstall;
+		this.performanceHistory = performanceHistory;		
+	}
+	
+
 	public static LoanBO redoLoan(UserContext userContext,
 			LoanOfferingBO loanOffering, CustomerBO customer,
 			AccountState accountState, Money loanAmount,
@@ -3406,7 +3415,8 @@
 	public RankType getWeekRank() {
 		return monthRank!=null ? RankType.getRankType(monthRank.getId()) : null;
 	}
-	
 
-	
+	public boolean isOfProductOffering(LoanOfferingBO loanOfferingBO) {
+		return this.loanOffering.equals(loanOfferingBO);
+	}
 }
Index: src/org/mifos/application/accounts/savings/business/SavingsBO.java
===================================================================
--- src/org/mifos/application/accounts/savings/business/SavingsBO.java	(revision 12247)
+++ src/org/mifos/application/accounts/savings/business/SavingsBO.java	(working copy)
@@ -137,6 +137,11 @@
 		savingsActivityDetails = new HashSet<SavingsActivityEntity>();
 	}
 
+	public SavingsBO(SavingsOfferingBO savingsOffering) {
+		this.savingsOffering = savingsOffering;
+		
+	}
+
 	public Money getRecommendedAmount() {
 		return recommendedAmount;
 	}
@@ -2144,4 +2149,8 @@
 		}else
 			return trxnDate.equals(DateUtils.getCurrentDateWithoutTimeStamp());
 	}
+
+	public boolean isOfProductOffering(SavingsOfferingBO productOffering) {
+		return savingsOffering.equals(productOffering);
+	}
 }
Index: src/org/mifos/application/collectionsheet/business/CollSheetLnDetailsEntity.java
===================================================================
--- src/org/mifos/application/collectionsheet/business/CollSheetLnDetailsEntity.java	(revision 12247)
+++ src/org/mifos/application/collectionsheet/business/CollSheetLnDetailsEntity.java	(working copy)
@@ -37,6 +37,8 @@
  */
 package org.mifos.application.collectionsheet.business;
 
+import java.io.Serializable;
+
 import org.mifos.application.accounts.business.AccountActionDateEntity;
 import org.mifos.application.accounts.loan.business.LoanBO;
 import org.mifos.application.accounts.loan.business.LoanScheduleEntity;
@@ -49,6 +51,7 @@
 import org.mifos.framework.exceptions.ApplicationException;
 import org.mifos.framework.exceptions.SystemException;
 import org.mifos.framework.util.helpers.Money;
+import org.mifos.framework.util.helpers.MoneyUtils;
 
 public class CollSheetLnDetailsEntity extends PersistentObject {
 
@@ -290,7 +293,8 @@
 	public void addAccountDetails(AccountActionDateEntity accountActionDate)
 			throws SystemException, ApplicationException {
 		LoanScheduleEntity loanSchedule = (LoanScheduleEntity) accountActionDate;
-		LoanBO loan = new LoanPersistence().getAccount(loanSchedule.getAccount().getAccountId());
+		LoanBO loan = new LoanPersistence().getAccount(loanSchedule
+				.getAccount().getAccountId());
 		this.accountId = loanSchedule.getAccount().getAccountId();
 		this.currentInstallmentNo = loanSchedule.getInstallmentId();
 		MifosLogManager.getLogger(LoggerConstants.COLLECTIONSHEETLOGGER).debug(
@@ -333,7 +337,8 @@
 				&& null != collectionSheetLoanDetailsObj.getLoanDetailsId()) {
 			return loanDetailsId.equals(collectionSheetLoanDetailsObj
 					.getLoanDetailsId());
-		} else if (null != this.collectionSheetCustomer
+		}
+		else if (null != this.collectionSheetCustomer
 				&& null != collectionSheetLoanDetailsObj
 						.getCollectionSheetCustomer()) {
 			return this.accountId.equals(collectionSheetLoanDetailsObj
@@ -341,7 +346,8 @@
 					&& this.collectionSheetCustomer
 							.equals(collectionSheetLoanDetailsObj
 									.getCollectionSheetCustomer());
-		} else {
+		}
+		else {
 			return super.equals(collectionSheetLoanDetailsObj);
 		}
 
@@ -356,15 +362,17 @@
 	 * This sets accountId,amntToBeDisbursed and sets installment id to null
 	 * because installments haven't begun yet.
 	 */
-    public void addDisbursalDetails(LoanBO loan) {
-		MifosLogManager.getLogger(LoggerConstants.COLLECTIONSHEETLOGGER).debug("inside add disbursaldetails");
-		
+	public void addDisbursalDetails(LoanBO loan) {
+		MifosLogManager.getLogger(LoggerConstants.COLLECTIONSHEETLOGGER).debug(
+				"inside add disbursaldetails");
+
 		this.accountId = loan.getAccountId();
 		// TODO check in case of interest deducted at disbursement this should
 		// show the loan amount to be disbursed.
 		this.amntToBeDisbursed = loan.getLoanAmount();
-		if(loan.isInterestDeductedAtDisbursement()){
-			LoanScheduleEntity loanSchedule = (LoanScheduleEntity)loan.getAccountActionDate(CollectionSheetConstants.FIRST_INSTALLMENT);
+		if (loan.isInterestDeductedAtDisbursement()) {
+			LoanScheduleEntity loanSchedule = (LoanScheduleEntity) loan
+					.getAccountActionDate(CollectionSheetConstants.FIRST_INSTALLMENT);
 			this.interestDue = loanSchedule.getInterestDue();
 			this.feesDue = loanSchedule.getTotalFeeDue();
 		}
@@ -373,4 +381,12 @@
 		this.originalLoanAmnt = loan.getLoanAmount();
 		this.totalPrincipalDue = this.originalLoanAmnt;
 	}
+
+	public Money getTotalFees() {
+		return MoneyUtils.add(getFeesDue(), getFeesOverDue());
+	}
+
+	public Money getTotalPenalty() {
+		return MoneyUtils.add(getPenaltyDue(), getPenaltyOverDue());
+	}
 }
Index: src/org/mifos/application/collectionsheet/business/CollSheetCustBO.java
===================================================================
--- src/org/mifos/application/collectionsheet/business/CollSheetCustBO.java	(revision 12247)
+++ src/org/mifos/application/collectionsheet/business/CollSheetCustBO.java	(working copy)
@@ -96,6 +96,24 @@
 	
 	private Short loanOfficerId ;
 	
+	public CollSheetCustBO(Integer custId, String custDisplayName,
+			Short custLevel, Short custOfficeId, String searchId, Short loanOfficerId) {
+		super();
+		this.custId = custId;
+		this.custDisplayName = custDisplayName;
+		this.custLevel = custLevel;
+		this.custOfficeId = custOfficeId;
+		this.searchId = searchId;
+		this.loanOfficerId = loanOfficerId;
+		collectionSheetLoanDetails = new HashSet<CollSheetLnDetailsEntity>();
+		collSheetSavingsDetails = new HashSet<CollSheetSavingsDetailsEntity>();
+	}
+
+	public CollSheetCustBO() {
+		this(null, null, null, null, null, null);
+	}
+
+
 	public Long getCollSheetCustId() {
 		return collSheetCustId;
 	}
Index: src/org/mifos/application/collectionsheet/business/CollectionSheetBO.java
===================================================================
--- src/org/mifos/application/collectionsheet/business/CollectionSheetBO.java	(revision 12247)
+++ src/org/mifos/application/collectionsheet/business/CollectionSheetBO.java	(working copy)
@@ -71,6 +71,17 @@
 
 	private Set<CollSheetCustBO> collectionSheetCustomers;
 
+	public CollectionSheetBO(Date collSheetDate, Date runDate, Set<CollSheetCustBO> collectionSheetCustomers, Short statusFlag) {
+		super();
+		this.collSheetDate = collSheetDate;
+		this.runDate = runDate;
+		this.collectionSheetCustomers = collectionSheetCustomers;
+		this.statusFlag = statusFlag;
+		for(CollSheetCustBO customer: collectionSheetCustomers) {
+			customer.setCollectionSheet(this);
+		}
+	}
+
 	public Date getCollSheetDate() {
 		return collSheetDate;
 	}
Index: src/org/mifos/application/collectionsheet/business/CollSheetCustBO.hbm.xml
===================================================================
--- src/org/mifos/application/collectionsheet/business/CollSheetCustBO.hbm.xml	(revision 12247)
+++ src/org/mifos/application/collectionsheet/business/CollSheetCustBO.hbm.xml	(working copy)
@@ -103,7 +103,32 @@
 						
 						
 		]]>
+	</query>	
+	<!--This query returns list of collection sheets for specified customer at given meeting date-->
+	<query name="CollectionSheetCustomer.collectionSheetForSpecifiedMeetingDateAndLoanOfficer">
+		<![CDATA[ from org.mifos.application.collectionsheet.business.CollSheetCustBO collectionSheet
+					where collectionSheet.custLevel = :CUSTOMER_LEVEL
+					and collectionSheet.collectionSheet.collSheetDate= :MEETING_DATE
+					and collectionSheet.custId = :CUSTOMER_ID
+					and collectionSheet.loanOfficerId = :LOAN_OFFICER_ID
+		]]>
 	</query>
-	
-	
-</hibernate-mapping>
\ No newline at end of file
+	<!--This query returns list of collection sheets for specified customer at given meeting date-->
+	<query name="CollectionSheetCustomer.collectionSheetForSpecifiedMeetingDate">
+		<![CDATA[ from org.mifos.application.collectionsheet.business.CollSheetCustBO collectionSheet
+					where collectionSheet.custLevel = :CUSTOMER_LEVEL
+					and collectionSheet.collectionSheet.collSheetDate= :MEETING_DATE
+					and collectionSheet.custId = :CUSTOMER_ID
+					and collectionSheet.loanOfficerId = :LOAN_OFFICER_ID
+		]]>
+	</query>
+	<!--This query returns list of collection sheets for childrens of specified customer at given meeting date-->
+	<query name="CollectionSheetCustomer.collectionSheetOfCustomersUnderAParentForSpecifiedMeetingDate">
+		<![CDATA[ from org.mifos.application.collectionsheet.business.CollSheetCustBO collectionSheet
+					where collectionSheet.custLevel = :CUSTOMER_LEVEL
+					and collectionSheet.collectionSheet.collSheetDate= :MEETING_DATE
+					and collectionSheet.parentCustomerId = :PARENT_CUSTOMER_ID
+					and collectionSheet.loanOfficerId = :LOAN_OFFICER_ID
+		]]>
+	</query>
+</hibernate-mapping>
Index: src/org/mifos/application/collectionsheet/business/CollectionSheetBO.hbm.xml
===================================================================
--- src/org/mifos/application/collectionsheet/business/CollectionSheetBO.hbm.xml	(revision 12247)
+++ src/org/mifos/application/collectionsheet/business/CollectionSheetBO.hbm.xml	(working copy)
@@ -12,13 +12,29 @@
 		<property name="statusFlag" column="STATUS_FLAG" type="short"/>
 		<property name="runDate" column="RUN_DATE" type="date"/>
 		
-		<set name="collectionSheetCustomers"   cascade="all"  table="COLL_SHEET_CUSTOMER" inverse="true">
-			<key column="COLL_SHEET_ID"  />
-			
+		<set name="collectionSheetCustomers" cascade="all"  table="COLL_SHEET_CUSTOMER" inverse="true">
+			<key column="COLL_SHEET_ID"/>
 			<one-to-many class="org.mifos.application.collectionsheet.business.CollSheetCustBO" />
 		</set>
-		
 	</class>
-	
-	
-</hibernate-mapping>
\ No newline at end of file
+
+    <query name="collectionSheet.getCollectionSheetForMeetingDate">
+            <![CDATA[from org.mifos.application.collectionsheet.business.CollectionSheetBO 
+            collectionSheet where collectionSheet.collSheetDate = :MEETING_DATE]]>
+    </query>	   
+
+	<!-- Query to retrieve meeting date for specified center -->
+	<sql-query name="collectionSheet.getCollectionSheetForCenterWithSpecifiedMeetingDate">
+		<return alias="collectionSheet" class="org.mifos.application.collectionsheet.business.CollectionSheetBO"/>
+		<![CDATA[
+			SELECT {collectionSheet.*} from coll_sheet collectionSheet, coll_sheet_customer 
+				where coll_sheet_customer.cust_id=:CUSTOMER_ID 
+				and coll_sheet_customer.cust_level=:CUSTOMER_LEVEL 
+				and coll_sheet_customer.cust_office_id=:OFFICE_ID
+				and coll_sheet_customer.loan_officer_id=:LOAN_OFFICER_ID 
+				and collectionSheet.coll_sheet_date > :FROM_DATE
+				and collectionSheet.coll_sheet_id=coll_sheet_customer.coll_sheet_id
+				order by collectionSheet.coll_sheet_date desc
+		]]>
+	</sql-query>	
+</hibernate-mapping>
Index: src/org/mifos/application/NamedQueryConstants.java
===================================================================
--- src/org/mifos/application/NamedQueryConstants.java	(revision 12247)
+++ src/org/mifos/application/NamedQueryConstants.java	(working copy)
@@ -340,6 +340,17 @@
 
 	public String MASTERDATA_ACTIVE_BRANCHES = "masterdata.activeBranches";
 	public String GET_FIELD_TYPE = "getFieldType";
+	
+	public static final String COLLECTION_SHEET_FOR_SPECIFIED_CUSTOMER = "collectionSheet.getCollectionSheetForCenterWithSpecifiedMeetingDate";
+	public static final String COLLECTION_SHEETS_FOR_MEETING_DATE = "collectionSheet.getCollectionSheetForMeetingDate";
+	public static final String COLLECTION_SHEET_CUSTOMERS_ON_MEETING_DATE_FOR_LOAN_OFFICER = "CollectionSheetCustomer.collectionSheetForSpecifiedMeetingDateAndLoanOfficer";
+	public static final String COLLECTION_SHEET_CUSTOMERS_ON_MEETING_DATE = "CollectionSheetCustomer.collectionSheetForSpecifiedMeetingDate";
+	public static final String COLLECTION_SHEETS_OF_CHILDREN_ON_MEETING_DATE = "CollectionSheetCustomer.collectionSheetOfCustomersUnderAParentForSpecifiedMeetingDate";
+	public static final String GET_ACTIVE_BRANCHES_AS_SELECTION_ITEM = "SelectionItem.get_active_offices";
+	public static final String GET_ACTIVE_LOAN_OFFICERS_UNDER_OFFICE_AS_SELECTION_ITEM = "SelectionItem.get_active_loanofficers_under_office";
+	public static final String GET_ACTIVE_CUSTOMERS_UNDER_LOAN_OFFICER_AS_SELECTION_ITEM = "SelectionItem.get_active_customers_under_loanofficers";
+	public static final String GET_MEETING_DATES_AS_SELECTION_ITEM = "DateSelectionItem.get_meeting_dates";
+	
 	/**M2 queries*/
 	/**Personnel Queries*/
 	public String MASTERDATA_ACTIVE_LOANOFFICERS_INBRANCH = "masterdata.activeloanofficers";
@@ -686,4 +697,4 @@
 	public String GET_TOP_LEVEL_ACCOUNTS = "COABO.getTopLevelAccounts";
 	public String GET_ACCOUNT_ID_FOR_GL_CODE = "COABO.getAccountIdForGLCode";
 	public String GET_ALL_COA = "COABO.getAllCoa";
-}
\ No newline at end of file
+}
Index: src/org/mifos/application/productdefinition/persistence/LoanPrdPersistence.java
===================================================================
--- src/org/mifos/application/productdefinition/persistence/LoanPrdPersistence.java	(revision 12247)
+++ src/org/mifos/application/productdefinition/persistence/LoanPrdPersistence.java	(working copy)
@@ -52,6 +52,7 @@
 import org.mifos.framework.exceptions.PersistenceException;
 import org.mifos.framework.persistence.Persistence;
 
+
 public class LoanPrdPersistence extends Persistence {
 	
 	private static ThreadLocal<Map> reportsCacheTL = new ThreadLocal<Map>();
Index: src/org/mifos/application/productdefinition/business/SavingsOfferingBO.java
===================================================================
--- src/org/mifos/application/productdefinition/business/SavingsOfferingBO.java	(revision 12247)
+++ src/org/mifos/application/productdefinition/business/SavingsOfferingBO.java	(working copy)
@@ -83,6 +83,10 @@
 	private MifosLogger prdLogger = MifosLogManager
 			.getLogger(LoggerConstants.PRDDEFINITIONLOGGER);
 
+	public SavingsOfferingBO(){
+		this(null, null, null, new HashSet<PrdOfferingMeetingEntity>());
+	}
+	
 	public SavingsOfferingBO(UserContext userContext, String prdOfferingName,
 			String prdOfferingShortName, ProductCategoryBO prdCategory,
 			PrdApplicableMasterEntity prdApplicableMaster, Date startDate,
@@ -137,11 +141,17 @@
 				+ getGlobalPrdOfferingNum());
 	}
 
-	protected SavingsOfferingBO() {
-		depositGLCode = null;
-		interestGLCode = null;
-		savingsOfferingMeetings = new HashSet<PrdOfferingMeetingEntity>();
+	protected SavingsOfferingBO(Short prdOfferingId, GLCodeEntity depositGLCode, 
+			GLCodeEntity interestGLCode, HashSet<PrdOfferingMeetingEntity> savingsOfferingMeetings) {
+		super(prdOfferingId);
+		this.depositGLCode = depositGLCode;
+		this.interestGLCode = interestGLCode;
+		this.savingsOfferingMeetings = savingsOfferingMeetings;
 	}
+	
+	public SavingsOfferingBO(Short prdOfferingId){
+		this(prdOfferingId, null, null, new HashSet<PrdOfferingMeetingEntity>());
+	}
 
 	private Set<PrdOfferingMeetingEntity> getSavingsOfferingMeetings() {
 		return savingsOfferingMeetings;
Index: src/org/mifos/application/productdefinition/business/PrdOfferingBO.java
===================================================================
--- src/org/mifos/application/productdefinition/business/PrdOfferingBO.java	(revision 12247)
+++ src/org/mifos/application/productdefinition/business/PrdOfferingBO.java	(working copy)
@@ -103,14 +103,19 @@
 			.getLogger(LoggerConstants.PRDDEFINITIONLOGGER);
 
 	protected PrdOfferingBO() {
-		prdOfferingId = null;
-		globalPrdOfferingNum = null;
-		prdType = null;
-		office = null;
+		this(null, null, null, null);
 		prdApplicableMaster = null;
 		collectionProductMix=null;
 		prdOfferingNotAllowedId=null;
 	}
+	
+	protected PrdOfferingBO(Short prdOfferingId, String globalPrdOfferingNum, ProductTypeEntity prdType,
+			OfficeBO office){
+		this.prdOfferingId = prdOfferingId;
+		this.globalPrdOfferingNum = globalPrdOfferingNum;
+		this.prdType = prdType;
+		this.office = office;		
+	}
 
 	protected PrdOfferingBO(UserContext userContext, String prdOfferingName,
 			String prdOfferingShortName, ProductCategoryBO prdCategory,
@@ -154,6 +159,10 @@
 		prdLogger.debug("creating product offering done");
 	}
 
+	public PrdOfferingBO(Short prdOfferingId) {
+		this(prdOfferingId, null, null, null);		
+	}
+
 	public Short getPrdOfferingId() {
 		return prdOfferingId;
 	}
@@ -458,4 +467,30 @@
 		this.setPrdMixFlag(YesNoFlag.YES.getValue());
 		new PrdOfferingPersistence().createOrUpdate(this);
 	}
+
+	@Override
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + ((prdOfferingId == null) ? 0 : prdOfferingId.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final PrdOfferingBO other = (PrdOfferingBO) obj;
+		if (prdOfferingId == null) {
+			if (other.prdOfferingId != null)
+				return false;
+		}
+		else if (!prdOfferingId.equals(other.prdOfferingId))
+			return false;
+		return true;
+	}
 }
Index: src/org/mifos/application/productdefinition/business/LoanOfferingBO.java
===================================================================
--- src/org/mifos/application/productdefinition/business/LoanOfferingBO.java	(revision 12247)
+++ src/org/mifos/application/productdefinition/business/LoanOfferingBO.java	(working copy)
@@ -55,6 +55,7 @@
 import org.mifos.application.meeting.exceptions.MeetingException;
 import org.mifos.application.meeting.util.helpers.MeetingType;
 import org.mifos.application.meeting.util.helpers.RecurrenceType;
+import org.mifos.application.office.business.OfficeBO;
 import org.mifos.application.productdefinition.exceptions.ProductDefinitionException;
 import org.mifos.application.productdefinition.persistence.LoanPrdPersistence;
 import org.mifos.application.productdefinition.struts.actionforms.LoanPrdActionForm;
@@ -358,18 +359,40 @@
 	}
 
 	protected LoanOfferingBO() {
-		principalGLcode = null;
-		interestGLcode = null;
-		loanOfferingFunds = new HashSet<LoanOfferingFundEntity>();
-		loanOfferingFees = new HashSet<LoanOfferingFeesEntity>();
-		loanAmountFromLastLoan = new HashSet<LoanAmountFromLastLoanAmountBO>();
-		loanAmountFromLoanCycle = new HashSet<LoanAmountFromLoanCycleBO>();
-		noOfInstallFromLastLoan = new HashSet<NoOfInstallFromLastLoanAmountBO>();
-		noOfInstallFromLoanCycle = new HashSet<NoOfInstallFromLoanCycleBO>();
-		loanAmountSameForAllLoan = new HashSet<LoanAmountSameForAllLoanBO>();
-		noOfInstallSameForAllLoan = new HashSet<NoOfInstallSameForAllLoanBO>();
+		this(null, null, null, null, null, null, new HashSet<LoanOfferingFundEntity>(), 
+				new HashSet<LoanOfferingFeesEntity>(), new HashSet<LoanAmountFromLastLoanAmountBO>(), 
+				new HashSet<LoanAmountFromLoanCycleBO>(), new HashSet<NoOfInstallFromLastLoanAmountBO>(), 
+				new HashSet<NoOfInstallFromLoanCycleBO>(), new HashSet<LoanAmountSameForAllLoanBO>(), 
+				new HashSet<NoOfInstallSameForAllLoanBO>());
+	}
 
+	private LoanOfferingBO(Short prdOfferingId, String globalPrdOfferingNum, 
+			ProductTypeEntity prdType, OfficeBO office,
+			GLCodeEntity principalGLcode, 
+			GLCodeEntity interestGLcode, 
+			Set<LoanOfferingFundEntity> loanOfferingFunds, 
+			Set<LoanOfferingFeesEntity> loanOfferingFees, 
+			Set<LoanAmountFromLastLoanAmountBO> loanAmountFromLastLoan, 
+			Set<LoanAmountFromLoanCycleBO> loanAmountFromLoanCycle, Set<NoOfInstallFromLastLoanAmountBO> noOfInstallFromLastLoan, Set<NoOfInstallFromLoanCycleBO> noOfInstallFromLoanCycle, Set<LoanAmountSameForAllLoanBO> loanAmountSameForAllLoan, Set<NoOfInstallSameForAllLoanBO> noOfInstallSameForAllLoan) {
+		super(prdOfferingId, globalPrdOfferingNum, prdType, office);
+		this.principalGLcode = principalGLcode;
+		this.interestGLcode = interestGLcode;
+		this.loanOfferingFunds = loanOfferingFunds;
+		this.loanOfferingFees = loanOfferingFees;
+		this.loanAmountFromLastLoan = loanAmountFromLastLoan;
+		this.loanAmountFromLoanCycle = loanAmountFromLoanCycle;
+		this.noOfInstallFromLastLoan = noOfInstallFromLastLoan;
+		this.noOfInstallFromLoanCycle = noOfInstallFromLoanCycle;
+		this.loanAmountSameForAllLoan = loanAmountSameForAllLoan;
+		this.noOfInstallSameForAllLoan = noOfInstallSameForAllLoan;
+	}
 
+	public LoanOfferingBO(Short prdOfferingId) {
+		this(prdOfferingId, null, null, null, null, null, new HashSet<LoanOfferingFundEntity>(), 
+				new HashSet<LoanOfferingFeesEntity>(), new HashSet<LoanAmountFromLastLoanAmountBO>(), 
+				new HashSet<LoanAmountFromLoanCycleBO>(), new HashSet<NoOfInstallFromLastLoanAmountBO>(), 
+				new HashSet<NoOfInstallFromLoanCycleBO>(), new HashSet<LoanAmountSameForAllLoanBO>(), 
+				new HashSet<NoOfInstallSameForAllLoanBO>());
 	}
 
 	public GracePeriodTypeEntity getGracePeriodType() {
Index: src/org/mifos/application/office/business/OfficeBO.java
===================================================================
--- src/org/mifos/application/office/business/OfficeBO.java	(revision 12247)
+++ src/org/mifos/application/office/business/OfficeBO.java	(working copy)
@@ -60,10 +60,7 @@
 	private Set<OfficeBO> children;
 
 	public OfficeBO() {
-		super();
-		maxChildCount = null;
-		officeId = null;
-		operationMode = null;
+		this(null, null, null, null);
 		status = new OfficeStatusEntity(OfficeStatus.ACTIVE);
 		address = new OfficeAddressEntity();
 	}
@@ -145,6 +142,14 @@
 		verifyFields(officeName, shortName, level, operationMode, parentOffice);
 	}
 
+	public OfficeBO(Short officeId, String officeName, Integer maxChildCount, Short operationMode) {
+		super();
+		this.officeId = officeId;
+		this.officeName = officeName;
+		this.maxChildCount = maxChildCount;
+		this.operationMode = operationMode;
+	}
+
 	@Override
 	public void setCreatedDate(Date createdDate) {
 		this.createdDate = createdDate;
Index: src/org/mifos/application/reports/exceptions/ReportServiceInitializationException.java
===================================================================
--- src/org/mifos/application/reports/exceptions/ReportServiceInitializationException.java	(revision 0)
+++ src/org/mifos/application/reports/exceptions/ReportServiceInitializationException.java	(revision 0)
@@ -0,0 +1,9 @@
+package org.mifos.application.reports.exceptions;
+
+public class ReportServiceInitializationException extends RuntimeException {
+
+	public ReportServiceInitializationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+}
Index: src/org/mifos/application/reports/struts/action/BirtReportValidationFilter.java
===================================================================
--- src/org/mifos/application/reports/struts/action/BirtReportValidationFilter.java	(revision 12247)
+++ src/org/mifos/application/reports/struts/action/BirtReportValidationFilter.java	(working copy)
@@ -12,34 +12,42 @@
 import javax.servlet.http.HttpServletResponse;
 
 public class BirtReportValidationFilter implements Filter {
-	
+
 	private String errorMessage;
+	private FilterConfig filterConfig;
 
 	public void doFilter(ServletRequest request, ServletResponse response,
 			FilterChain chain) throws IOException, ServletException {
 		errorMessage = "";
 		String currentReport = request.getParameter("__report");
-		
+
 		HashMap<String, String> errorMessages = new HashMap<String, String>();
 		errorMessages.put("branchId", "Please select a Branch Office.");
-		errorMessages.put("loanOfficerId",  "Please select a Loan Officer.");
+		errorMessages.put("loanOfficerId", "Please select a Loan Officer.");
 		errorMessages.put("loanProductId", "Please select a Loan Procuct.");
-		
-		reportFilter(currentReport, "report/ActiveLoansByLoanOfficer.rptdesign", errorMessages, request);
-		reportFilter(currentReport, "report/DetailedAgingPortfolioAtRisk.rptdesign", errorMessages, request);
-		
-		if(errorMessage.length() == 0) {
+
+		reportFilter(currentReport,
+				"report/ActiveLoansByLoanOfficer.rptdesign", errorMessages,
+				request);
+		reportFilter(currentReport,
+				"report/DetailedAgingPortfolioAtRisk.rptdesign", errorMessages,
+				request);
+
+		if (errorMessage.length() == 0) {
 			chain.doFilter(request, response);
 		}
 		else {
 			showError(request, response);
+
 		}
 	}
 
-	private void reportFilter(String currentReport, String expectedReport, HashMap<String, String> parameters, ServletRequest request) {
-		if(currentReport.equals(expectedReport)) {
-			for(String parameter : parameters.keySet()){
-				if(request.getParameter(parameter) != null &&request.getParameter(parameter).equals("-2")) {
+	private void reportFilter(String currentReport, String expectedReport,
+			HashMap<String, String> parameters, ServletRequest request) {
+		if (currentReport.equals(expectedReport)) {
+			for (String parameter : parameters.keySet()) {
+				if (request.getParameter(parameter) != null
+						&& request.getParameter(parameter).equals("-2")) {
 					addErrorMessage(parameters.get(parameter));
 				}
 			}
@@ -52,17 +60,18 @@
 
 	private void showError(ServletRequest request, ServletResponse response)
 			throws IOException, ServletException {
-		HttpServletResponse httpServletResponse = (HttpServletResponse) response;
-		httpServletResponse
-				.sendRedirect("/mifos/run?__report="
-						+ request.getParameter("__report") + "&reportName="
-						+ request.getParameter("reportName") + "&userId="
-						+ request.getParameter("userId") + "&__format="
-						+ request.getParameter("__format") + "&message="
-						+ errorMessage);
+		
+		HttpServletResponse httpServletResponse = (HttpServletResponse) response;		
+		httpServletResponse.sendRedirect("run?__report="
+				+ request.getParameter("__report") + "&reportName="
+				+ request.getParameter("reportName") + "&userId="
+				+ request.getParameter("userId") + "&__format="
+				+ request.getParameter("__format") + "&mifosErrorMessage="
+				+ errorMessage);
 	}
 
-	public void init(FilterConfig arg0) throws ServletException {
+	public void init(FilterConfig filterConfig) throws ServletException {
+		this.filterConfig = filterConfig;
 	}
 
 	public void destroy() {
Index: src/org/mifos/application/reports/persistence/DateSelectionItemPersistence.java
===================================================================
--- src/org/mifos/application/reports/persistence/DateSelectionItemPersistence.java	(revision 0)
+++ src/org/mifos/application/reports/persistence/DateSelectionItemPersistence.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.mifos.application.reports.persistence;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.collectionsheet.util.helpers.CollectionSheetConstants;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.persistence.Persistence;
+
+public class DateSelectionItemPersistence extends Persistence {
+	public List<DateSelectionItem> getMeetingDates(Short branchId,
+			Short loanOfficerId, Integer customerId, Short customerLevel, Date from)
+			throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("COLL_SHEET_RUN_STATUS", CollectionSheetConstants.COLLECTION_SHEET_GENERATION_SUCCESSFUL);
+		queryParameters.put("customerId", customerId);
+		queryParameters.put("CUSTOMER_LEVEL", customerLevel);
+		queryParameters.put("branchId", branchId);
+		queryParameters.put("loanOfficerId", loanOfficerId);
+		queryParameters.put("fromDate", from);
+		return executeNamedQuery(
+				NamedQueryConstants.GET_MEETING_DATES_AS_SELECTION_ITEM,
+				queryParameters);
+	}
+}
Index: src/org/mifos/application/reports/persistence/SelectionItemPersistence.java
===================================================================
--- src/org/mifos/application/reports/persistence/SelectionItemPersistence.java	(revision 0)
+++ src/org/mifos/application/reports/persistence/SelectionItemPersistence.java	(revision 0)
@@ -0,0 +1,75 @@
+package org.mifos.application.reports.persistence;
+
+import static org.mifos.application.NamedQueryConstants.GET_ACTIVE_BRANCHES_AS_SELECTION_ITEM;
+import static org.mifos.application.NamedQueryConstants.GET_ACTIVE_CUSTOMERS_UNDER_LOAN_OFFICER_AS_SELECTION_ITEM;
+import static org.mifos.application.NamedQueryConstants.GET_ACTIVE_LOAN_OFFICERS_UNDER_OFFICE_AS_SELECTION_ITEM;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.customer.util.helpers.CustomerStatus;
+import org.mifos.application.office.util.helpers.OfficeLevel;
+import org.mifos.application.office.util.helpers.OfficeStatus;
+import org.mifos.application.personnel.util.helpers.PersonnelLevel;
+import org.mifos.application.personnel.util.helpers.PersonnelStatus;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.persistence.Persistence;
+
+public class SelectionItemPersistence extends Persistence {
+	public List<SelectionItem> getActiveBranchesUnderUser(String officeSearchId)
+			throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("officeLevelId", OfficeLevel.BRANCHOFFICE
+				.getValue());
+		queryParameters.put("officeSearchId", officeSearchId + "%");
+		queryParameters.put("ACTIVE", OfficeStatus.ACTIVE.getValue());
+		return executeNamedQuery(GET_ACTIVE_BRANCHES_AS_SELECTION_ITEM,
+				queryParameters);
+	}
+
+	public List<SelectionItem> getActiveLoanOfficersUnderOffice(Short officeId)
+			throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("officeId", officeId);
+		queryParameters.put("personnelLevelId", PersonnelLevel.LOAN_OFFICER
+				.getValue());
+		queryParameters.put("ACTIVE", PersonnelStatus.ACTIVE.getValue());
+		return executeNamedQuery(
+				GET_ACTIVE_LOAN_OFFICERS_UNDER_OFFICE_AS_SELECTION_ITEM,
+				queryParameters);
+	}
+
+	public List<SelectionItem> getActiveCentersUnderUser(Short branchId,
+			Short loanOfficerId) throws PersistenceException {
+		HashMap<String, Object> queryParameters = populateCustomerQueryParams(
+				branchId, loanOfficerId, CustomerLevel.CENTER.getValue(),
+				CustomerStatus.CENTER_ACTIVE.getValue());
+		return executeNamedQuery(
+				GET_ACTIVE_CUSTOMERS_UNDER_LOAN_OFFICER_AS_SELECTION_ITEM,
+				queryParameters);
+	}
+
+	private HashMap<String, Object> populateCustomerQueryParams(Short branchId,
+			Short loanOfficerId, Short customerLevel, Short customerStatus) {
+		HashMap<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("personnelId", loanOfficerId);
+		queryParameters.put("officeId", branchId);
+		queryParameters.put("customerLevelId", customerLevel);
+		queryParameters.put("ACTIVE", customerStatus);
+		return queryParameters;
+	}
+
+	public List<SelectionItem> getActiveGroupsUnderUser(Short officeId,
+			Short personnelId) throws PersistenceException {
+		HashMap<String, Object> queryParameters = populateCustomerQueryParams(
+				officeId, personnelId, CustomerLevel.GROUP.getValue(),
+				CustomerStatus.GROUP_ACTIVE.getValue());
+		return executeNamedQuery(
+				NamedQueryConstants.GET_ACTIVE_CUSTOMERS_UNDER_LOAN_OFFICER_AS_SELECTION_ITEM,
+				queryParameters);
+	}
+}
Index: src/org/mifos/application/reports/resources/reportproducts.properties
===================================================================
--- src/org/mifos/application/reports/resources/reportproducts.properties	(revision 0)
+++ src/org/mifos/application/reports/resources/reportproducts.properties	(revision 0)
@@ -0,0 +1,2 @@
+loan.product.ids=1, 2
+savings.product.ids=5, 7
Index: src/org/mifos/application/reports/business/DetailedAgingPortfolioReportParameters.java
===================================================================
--- src/org/mifos/application/reports/business/DetailedAgingPortfolioReportParameters.java	(revision 0)
+++ src/org/mifos/application/reports/business/DetailedAgingPortfolioReportParameters.java	(revision 0)
@@ -0,0 +1,64 @@
+package org.mifos.application.reports.business;
+
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.REPORT_PARAMS_ARRAY;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.mifos.application.reports.business.validator.Errors;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+import org.mifos.framework.util.helpers.NumberUtils;
+import org.mifos.framework.util.helpers.ServletUtils;
+
+public class DetailedAgingPortfolioReportParameters implements ReportParameterForm{
+
+	public static final String BRANCH_ID_PARAM = "branchId";
+	public static final String LOAN_OFFICER_ID_PARAM = "loanOfficerId";
+	public static final String LOAN_PRODUCT_ID = "loanProductId";
+	
+	public static final String BRANCH_ID_INVALID_MSG = "branchId.invalid";
+	public static final String LOAN_OFFICER_ID_INVALID_MSG = "loanOfficerId.invalid";
+	public static final String LOAN_PRODUCT_ID_INVALID_MSG = "loanProductId.invalid";
+
+	private final String branchId;
+	private final String loanOfficerId;
+	private final String productId;
+
+	public static final String VALID_ID = "1";
+
+	public static final String INVALID_ID = "-2";
+
+	DetailedAgingPortfolioReportParameters(String branchId, String loanOfficerId,String productId) {
+		this.branchId = branchId;
+		this.loanOfficerId = loanOfficerId;
+		this.productId = productId;
+	}
+
+	public void validate(Errors errors) {
+	    addErrorIfInvalid(errors, branchId, BRANCH_ID_PARAM, BRANCH_ID_INVALID_MSG);	
+	    addErrorIfInvalid(errors, loanOfficerId, LOAN_OFFICER_ID_PARAM, LOAN_OFFICER_ID_INVALID_MSG);
+	    addErrorIfInvalid(errors, productId, LOAN_PRODUCT_ID, LOAN_PRODUCT_ID_INVALID_MSG);
+	}
+
+	private void addErrorIfInvalid(Errors errors, String parameter,
+			String fieldName, String errorCode) {
+		if (!NumberUtils.isDigits(parameter)
+				|| Integer.valueOf(INVALID_ID).equals(Integer.valueOf(parameter))) {
+			errors.rejectValue(fieldName, errorCode);
+		}
+	}
+
+	public static DetailedAgingPortfolioReportParameters build(HttpServletRequest request) {
+		return new DetailedAgingPortfolioReportParameters(
+				ServletUtils.getParameter(request, BRANCH_ID_PARAM),
+				ServletUtils.getParameter(request, LOAN_OFFICER_ID_PARAM),
+				ServletUtils.getParameter(request, LOAN_PRODUCT_ID)
+				);
+	}
+
+	public void removeRequestParameters(ModifiableParameterServletRequest modifiedRequest, Errors errors) {
+		for (String reportParam : REPORT_PARAMS_ARRAY) {
+			if (errors.getFieldError(reportParam) != null)
+				modifiedRequest.removeParameter(reportParam);
+		}
+	}
+}
Index: src/org/mifos/application/reports/business/ReportParameterForm.java
===================================================================
--- src/org/mifos/application/reports/business/ReportParameterForm.java	(revision 0)
+++ src/org/mifos/application/reports/business/ReportParameterForm.java	(revision 0)
@@ -0,0 +1,10 @@
+package org.mifos.application.reports.business;
+
+import org.mifos.application.reports.business.validator.Errors;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+
+public interface ReportParameterForm {
+	public void validate(Errors errors);
+
+	public void removeRequestParameters(ModifiableParameterServletRequest modifiedRequest, Errors errors);
+}
Index: src/org/mifos/application/reports/business/CollectionSheetReportParameters.java
===================================================================
--- src/org/mifos/application/reports/business/CollectionSheetReportParameters.java	(revision 0)
+++ src/org/mifos/application/reports/business/CollectionSheetReportParameters.java	(revision 0)
@@ -0,0 +1,134 @@
+package org.mifos.application.reports.business;
+
+import static org.mifos.application.reports.ui.SelectionItem.NA_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.BRANCH_ID_PARAM;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.CENTER_ID_INVALID_MSG;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.CENTER_ID_PARAM;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.LOAN_OFFICER_ID_INVALID_MSG;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.LOAN_OFFICER_ID_PARAM;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.MEETING_DATE_INVALID_MSG;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.MEETING_DATE_PARAM;
+import static org.mifos.application.reports.util.helpers.CollectionSheetReportConstants.REPORT_PARAMS_ARRAY;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.mifos.application.reports.business.validator.Errors;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+import org.mifos.framework.util.helpers.NumberUtils;
+
+public class CollectionSheetReportParameters implements ReportParameterForm {
+
+	public static final SimpleDateFormat REPORT_DATE_PARAM_FORMAT = new SimpleDateFormat(
+			"MM/dd/yyyy hh:mm:ss a");
+	private final String branchId;
+	private final String loanOfficerId;
+	private final String centerId;
+	private final String meetingDate;
+
+	public CollectionSheetReportParameters(String branchId,
+			String loanOfficerId, String centerId, String meetingDate) {
+		this.branchId = branchId;
+		this.loanOfficerId = loanOfficerId;
+		this.centerId = centerId;
+		this.meetingDate = meetingDate;
+	}
+
+	public void validate(Errors errors) {
+		addErrorIfInvalid(errors, branchId,
+				SELECT_BRANCH_OFFICE_SELECTION_ITEM
+						.getId(), BRANCH_ID_PARAM, "branchId.invalid");
+		addErrorIfInvalid(errors, loanOfficerId,
+				SELECT_LOAN_OFFICER_SELECTION_ITEM
+						.getId(), LOAN_OFFICER_ID_PARAM,
+				LOAN_OFFICER_ID_INVALID_MSG);
+		addErrorIfInvalid(errors, loanOfficerId,
+				NA_LOAN_OFFICER_SELECTION_ITEM
+						.getId(), LOAN_OFFICER_ID_PARAM,
+				LOAN_OFFICER_ID_INVALID_MSG);
+		addErrorIfInvalid(errors, centerId,
+				SELECT_CENTER_SELECTION_ITEM.getId(),
+				CENTER_ID_PARAM, CENTER_ID_INVALID_MSG);
+		addErrorIfInvalid(errors, centerId,
+				NA_CENTER_SELECTION_ITEM.getId(),
+				CENTER_ID_PARAM, CENTER_ID_INVALID_MSG);
+		addErrorIfInvalid(errors, meetingDate,
+				DateSelectionItem.NA_MEETING_DATE.getDate(),
+				MEETING_DATE_PARAM, MEETING_DATE_INVALID_MSG);
+	}
+
+	private void addErrorIfInvalid(Errors errors, String parameter,
+			Date notAvailableDate, String fieldName, String errorCode) {
+		Date date = null;
+		try {
+			date = REPORT_DATE_PARAM_FORMAT.parse(parameter);
+		}
+		catch (ParseException e) {
+		}
+		if (notAvailableDate.equals(date)) {
+			errors.rejectValue(fieldName, errorCode);
+		}
+	}
+
+	private void addErrorIfInvalid(Errors errors, String parameter,
+			Integer selectValue, String fieldName, String errorCode) {
+		if (!NumberUtils.isDigits(parameter)
+				|| selectValue.equals(Integer.valueOf(parameter))) {
+			errors.rejectValue(fieldName, errorCode);
+		}
+	}
+
+	private void addErrorIfInvalid(Errors errors, String parameter,
+			Short selectValue, String fieldName, String errorCode) {
+		if (!NumberUtils.isDigits(parameter)
+				|| selectValue.equals(Short.valueOf(parameter))) {
+			errors.rejectValue(fieldName, errorCode);
+		}
+	}
+
+	public static CollectionSheetReportParameters build(
+			HttpServletRequest request) {
+		return new CollectionSheetReportParameters(extractBranchId(request),
+				extractLoanOfficerId(request), extractCenterId(request),
+				extractMeetingDate(request));
+	}
+
+	private static String getParameter(HttpServletRequest request,
+			String paramName) {
+		String parameter = request.getParameter(paramName);
+		return parameter != null ? parameter : request.getAttribute(parameter)
+				.toString();
+	}
+
+	public void removeRequestParameters(
+			ModifiableParameterServletRequest modifiedRequest, Errors errors) {
+		for (String reportParam : REPORT_PARAMS_ARRAY) {
+			if (errors.getFieldError(reportParam) != null)
+				modifiedRequest.removeParameter(reportParam);
+		}
+	}
+
+	private static String extractMeetingDate(HttpServletRequest request) {
+		return getParameter(request, MEETING_DATE_PARAM);
+	}
+
+	private static String extractCenterId(HttpServletRequest request) {
+		return getParameter(request, CENTER_ID_PARAM);
+	}
+
+	private static String extractLoanOfficerId(HttpServletRequest request) {
+		return getParameter(request, LOAN_OFFICER_ID_PARAM);
+	}
+
+	private static String extractBranchId(HttpServletRequest request) {
+		return getParameter(request, BRANCH_ID_PARAM);
+	}
+}
Index: src/org/mifos/application/reports/business/validator/DetailedAgingPortfolioReportParamValidator.java
===================================================================
--- src/org/mifos/application/reports/business/validator/DetailedAgingPortfolioReportParamValidator.java	(revision 0)
+++ src/org/mifos/application/reports/business/validator/DetailedAgingPortfolioReportParamValidator.java	(revision 0)
@@ -0,0 +1,25 @@
+package org.mifos.application.reports.business.validator;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.mifos.application.reports.business.DetailedAgingPortfolioReportParameters;
+import org.mifos.application.reports.business.ReportParameterForm;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+
+public class DetailedAgingPortfolioReportParamValidator  implements
+		ReportParameterValidator<DetailedAgingPortfolioReportParameters> {
+
+	public static final ReportParameterValidator INSTANCE = new DetailedAgingPortfolioReportParamValidator();
+	
+	public DetailedAgingPortfolioReportParameters buildReportParameterForm(HttpServletRequest request) {
+		return DetailedAgingPortfolioReportParameters.build(request);
+	}
+
+	public void removeRequestParameters(ModifiableParameterServletRequest modifiedRequest, ReportParameterForm form, Errors errors) {
+		form.removeRequestParameters(modifiedRequest, errors);
+	}
+
+	public void validate(DetailedAgingPortfolioReportParameters target, Errors errors) {
+		target.validate(errors);
+	}
+}
Index: src/org/mifos/application/reports/business/validator/ReportParameterValidator.java
===================================================================
--- src/org/mifos/application/reports/business/validator/ReportParameterValidator.java	(revision 0)
+++ src/org/mifos/application/reports/business/validator/ReportParameterValidator.java	(revision 0)
@@ -0,0 +1,12 @@
+package org.mifos.application.reports.business.validator;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.mifos.application.reports.business.ReportParameterForm;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+
+public interface ReportParameterValidator<T extends ReportParameterForm> {
+	public void validate(T target, Errors errors);
+	public T buildReportParameterForm(HttpServletRequest request);
+	public void removeRequestParameters(ModifiableParameterServletRequest modifiedRequest, ReportParameterForm form, Errors errors);
+}
Index: src/org/mifos/application/reports/business/validator/CollectionSheetReportParamValidator.java
===================================================================
--- src/org/mifos/application/reports/business/validator/CollectionSheetReportParamValidator.java	(revision 0)
+++ src/org/mifos/application/reports/business/validator/CollectionSheetReportParamValidator.java	(revision 0)
@@ -0,0 +1,26 @@
+package org.mifos.application.reports.business.validator;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.mifos.application.reports.business.CollectionSheetReportParameters;
+import org.mifos.application.reports.business.ReportParameterForm;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+
+
+public class CollectionSheetReportParamValidator implements
+		ReportParameterValidator<CollectionSheetReportParameters> {
+	public static final ReportParameterValidator INSTANCE = new CollectionSheetReportParamValidator();
+
+	public void validate(CollectionSheetReportParameters target, Errors errors) {
+		target.validate(errors);
+	}
+
+	public CollectionSheetReportParameters buildReportParameterForm(
+			HttpServletRequest request) {
+		return CollectionSheetReportParameters.build(request);
+	}
+
+	public void removeRequestParameters(ModifiableParameterServletRequest modifiedRequest, ReportParameterForm form, Errors errors) {
+		form.removeRequestParameters(modifiedRequest, errors);
+	}
+}
Index: src/org/mifos/application/reports/business/validator/Errors.java
===================================================================
--- src/org/mifos/application/reports/business/validator/Errors.java	(revision 0)
+++ src/org/mifos/application/reports/business/validator/Errors.java	(revision 0)
@@ -0,0 +1,58 @@
+package org.mifos.application.reports.business.validator;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.mifos.application.master.MessageLookup;
+
+public class Errors {
+	List<ErrorEntry> errors;
+	private final Locale locale;
+
+	public Errors(Locale locale) {
+		this.locale = locale;
+		errors = new ArrayList<ErrorEntry>();
+	}
+
+	public void rejectValue(String fieldName, String errorCode) {
+		errors.add(new ErrorEntry(fieldName, errorCode));
+	}
+
+	public List<String> getAllErrorMessages() {
+		List<String> errorMessages = new ArrayList<String>();
+		for (ErrorEntry entry : errors) {
+			errorMessages.add(MessageLookup.getInstance().lookup(
+					entry.errorCode, locale));
+
+		}
+		return errorMessages;
+	}
+
+	public boolean hasErrors() {
+		return !errors.isEmpty();
+	}
+
+	public List<ErrorEntry> getErrors() {
+		return errors;
+	}
+
+	public static class ErrorEntry {
+		final String fieldName;
+		final String errorCode;
+
+		public ErrorEntry(String fieldName, String errorCode) {
+			super();
+			this.fieldName = fieldName;
+			this.errorCode = errorCode;
+		}
+	}
+
+	public ErrorEntry getFieldError(String fieldName) {
+		for (ErrorEntry errorEntry : errors) {
+			if(errorEntry.fieldName.equals(fieldName))
+				return errorEntry;
+		}
+		return null;
+	}
+}
Index: src/org/mifos/application/reports/business/dto/LoanProductDetails.java
===================================================================
--- src/org/mifos/application/reports/business/dto/LoanProductDetails.java	(revision 0)
+++ src/org/mifos/application/reports/business/dto/LoanProductDetails.java	(revision 0)
@@ -0,0 +1,56 @@
+package org.mifos.application.reports.business.dto;
+
+import org.mifos.application.collectionsheet.business.CollSheetLnDetailsEntity;
+import org.mifos.framework.util.helpers.MoneyUtils;
+
+public class LoanProductDetails {
+	private final Double balance;
+	private final Double due;
+	private final Double otherFee;
+	private final Double otherFine;
+	private final Double issues;
+	private final String offeringShortName;
+
+	public LoanProductDetails(CollSheetLnDetailsEntity loanDetails,
+			String offeringShortName) {
+		this.offeringShortName = offeringShortName;
+		if (loanDetails == null) {
+			balance = due = issues = otherFee = otherFine = 0d;
+		}
+		else {
+			balance = MoneyUtils.getMoneyDoubleValue(loanDetails
+					.getTotalPrincipalDue());
+			due = MoneyUtils.getMoneyDoubleValue(loanDetails.getTotalAmntDue());
+			issues = MoneyUtils.getMoneyDoubleValue(loanDetails
+					.getAmntToBeDisbursed());
+			otherFee = MoneyUtils.getMoneyDoubleValue(loanDetails
+					.getTotalFees());
+			otherFine = MoneyUtils.getMoneyDoubleValue(loanDetails
+					.getTotalPenalty());
+		}
+	}
+
+	public Double getBalance() {
+		return balance;
+	}
+
+	public Double getDue() {
+		return due;
+	}
+
+	public Double getIssues() {
+		return issues;
+	}
+
+	Double getOtherFee() {
+		return otherFee;
+	}
+
+	Double getOtherFine() {
+		return otherFine;
+	}
+
+	public String getOfferingShortName() {
+		return offeringShortName;
+	}
+}
Index: src/org/mifos/application/reports/business/dto/SavingsProductDetails.java
===================================================================
--- src/org/mifos/application/reports/business/dto/SavingsProductDetails.java	(revision 0)
+++ src/org/mifos/application/reports/business/dto/SavingsProductDetails.java	(revision 0)
@@ -0,0 +1,37 @@
+package org.mifos.application.reports.business.dto;
+
+import org.mifos.application.collectionsheet.business.CollSheetSavingsDetailsEntity;
+import org.mifos.framework.util.helpers.MoneyUtils;
+
+public class SavingsProductDetails {
+
+	private final Double balance;
+	private final Double due;
+	private final String offeringShortName;
+
+	public SavingsProductDetails(CollSheetSavingsDetailsEntity savingsDetails,
+			String offeringShortName) {
+		this.offeringShortName = offeringShortName;
+		if (savingsDetails != null) {
+			balance = MoneyUtils.getMoneyDoubleValue(savingsDetails
+					.getAccountBalance());
+			due = MoneyUtils.getMoneyDoubleValue(savingsDetails
+					.getRecommendedAmntDue());
+		}
+		else {
+			balance = due = 0d;
+		}
+	}
+
+	public Double getBalance() {
+		return balance;
+	}
+
+	public Double getDue() {
+		return due;
+	}
+
+	public String getOfferingShortName() {
+		return offeringShortName;
+	}
+}
Index: src/org/mifos/application/reports/business/dto/CollectionSheetReportDTO.java
===================================================================
--- src/org/mifos/application/reports/business/dto/CollectionSheetReportDTO.java	(revision 0)
+++ src/org/mifos/application/reports/business/dto/CollectionSheetReportDTO.java	(revision 0)
@@ -0,0 +1,105 @@
+package org.mifos.application.reports.business.dto;
+
+import org.mifos.application.collectionsheet.business.CollSheetLnDetailsEntity;
+import org.mifos.application.collectionsheet.business.CollSheetSavingsDetailsEntity;
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.framework.util.helpers.NumberUtils;
+
+// Understands collection sheet report properties
+public class CollectionSheetReportDTO {
+	private final Integer customerId;
+	private final Integer groupId;
+	private final Integer centerId;
+	private final Integer loanOfficerId;
+	private final String customerName;
+	private final String branchName;
+	private final String centerName;
+	private final String groupName;
+	private final String loanOfficerName;
+	private final LoanProductDetails[] loanProducts;
+	private SavingsProductDetails[] savingsProducts;
+
+	public CollectionSheetReportDTO(
+			CollSheetLnDetailsEntity loanDetailsEntity1,
+			CollSheetLnDetailsEntity loanDetailsEntity2,
+			CollSheetSavingsDetailsEntity mm1SavingsDetailEntity,
+			CollSheetSavingsDetailsEntity mm2SavingsDetailEntity,
+			Integer customerId, Integer groupId, String customerName,
+			String branchName, String groupName, CustomerBO center,
+			String loanOfferingShortName1, String loanOfferingShortName2,
+			String savingsOfferingShortName1, String savingsOfferingShortName2) {
+
+		loanProducts = new LoanProductDetails[2];
+		loanProducts[0] = new LoanProductDetails(loanDetailsEntity1, loanOfferingShortName1);
+		loanProducts[1] = new LoanProductDetails(loanDetailsEntity2, loanOfferingShortName2);
+
+		this.customerId = customerId;
+		this.groupId = groupId;
+		this.loanOfficerId = NumberUtils.convertShortToInteger(center
+				.getPersonnel().getPersonnelId());
+		this.loanOfficerName = center.getPersonnel().getDisplayName();
+		this.customerName = customerName;
+		centerId = center.getCustomerId();
+		centerName = center.getDisplayName();
+		this.branchName = branchName;
+		this.groupName = groupName;
+
+		savingsProducts = new SavingsProductDetails[2];
+		savingsProducts[0] = new SavingsProductDetails(mm1SavingsDetailEntity, savingsOfferingShortName1);
+		savingsProducts[1] = new SavingsProductDetails(mm2SavingsDetailEntity, savingsOfferingShortName2);
+	}
+
+	public SavingsProductDetails getSavingsProduct(int index) {
+		return savingsProducts[index];
+	}
+
+	public LoanProductDetails getLoanProduct(int index) {
+		return loanProducts[index];
+	}
+
+
+	public String getBranchName() {
+		return branchName;
+	}
+
+	public Integer getCenterId() {
+		return centerId;
+	}
+
+	public String getCenterName() {
+		return centerName;
+	}
+
+	public Integer getCustomerId() {
+		return customerId;
+	}
+
+	public String getCustomerName() {
+		return customerName;
+	}
+
+	public Integer getGroupId() {
+		return groupId;
+	}
+
+	public String getGroupName() {
+		return groupName;
+	}
+
+	public Integer getLoanOfficerId() {
+		return loanOfficerId;
+	}
+
+	public String getLoanOfficerName() {
+		return loanOfficerName;
+	}
+
+	public Double getOtherFee() {
+		return loanProducts[0].getOtherFee() + loanProducts[1].getOtherFee();
+	}
+
+	public Double getOtherFine() {
+		return loanProducts[0].getOtherFine() + loanProducts[1].getOtherFine();
+	}
+
+}
Index: src/org/mifos/application/reports/business/service/ReportsParameterService.java
===================================================================
--- src/org/mifos/application/reports/business/service/ReportsParameterService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/ReportsParameterService.java	(revision 0)
@@ -0,0 +1,61 @@
+package org.mifos.application.reports.business.service;
+
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.reports.persistence.DateSelectionItemPersistence;
+import org.mifos.application.reports.persistence.SelectionItemPersistence;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class ReportsParameterService implements IReportsParameterService {
+
+	private SelectionItemPersistence selectionItemPersistence;
+	private DateSelectionItemPersistence dateSelectionItemPersistence;
+
+	public ReportsParameterService(
+			SelectionItemPersistence selectionItemPersistence,
+			DateSelectionItemPersistence dateSelectionItemPersistence) {
+		super();
+		this.selectionItemPersistence = selectionItemPersistence;
+		this.dateSelectionItemPersistence = dateSelectionItemPersistence;
+	}
+
+	public ReportsParameterService() {
+		selectionItemPersistence = new SelectionItemPersistence();
+		dateSelectionItemPersistence = new DateSelectionItemPersistence();
+	}
+
+	public List<SelectionItem> getActiveBranchesUnderUser(String officeSearchId)
+			throws PersistenceException {
+		return selectionItemPersistence
+				.getActiveBranchesUnderUser(officeSearchId);
+	}
+
+	public List<SelectionItem> getActiveLoanOfficersUnderOffice(Short branchId)
+			throws PersistenceException {
+		return selectionItemPersistence
+				.getActiveLoanOfficersUnderOffice(branchId);
+	}
+
+	public List<SelectionItem> getActiveCentersUnderUser(Short branchId,
+			Short loanOfficerId) throws PersistenceException {
+		return selectionItemPersistence.getActiveCentersUnderUser(branchId,
+				loanOfficerId);
+	}
+
+	public List<DateSelectionItem> getMeetingDates(Short branchId,
+			Short loanOfficerId, Integer centerId, CustomerLevel customerLevel,
+			Date from) throws PersistenceException {
+		return dateSelectionItemPersistence.getMeetingDates(branchId,
+				loanOfficerId, centerId, customerLevel.getValue(), from);
+	}
+
+	public List<SelectionItem> getActiveGroupsUnderUser(Short branchId,
+			Short loanOfficerId) throws PersistenceException {
+		return selectionItemPersistence.getActiveGroupsUnderUser(branchId,
+				loanOfficerId);
+	}
+}
Index: src/org/mifos/application/reports/business/service/CollectionSheetReportService.java
===================================================================
--- src/org/mifos/application/reports/business/service/CollectionSheetReportService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/CollectionSheetReportService.java	(revision 0)
@@ -0,0 +1,510 @@
+package org.mifos.application.reports.business.service;
+
+import static org.mifos.application.reports.ui.DateSelectionItem.NA_MEETING_DATE;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_GROUP_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.ALL_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_GROUP_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.NA_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_BRANCH_OFFICE_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_CENTER_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_GROUP_SELECTION_ITEM;
+import static org.mifos.application.reports.ui.SelectionItem.SELECT_LOAN_OFFICER_SELECTION_ITEM;
+import static org.mifos.framework.util.helpers.NumberUtils.convertIntegerToShort;
+import static org.mifos.framework.util.helpers.NumberUtils.convertShortToInteger;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.accounts.business.service.AccountBusinessService;
+import org.mifos.application.accounts.loan.business.LoanBO;
+import org.mifos.application.accounts.savings.business.SavingsBO;
+import org.mifos.application.collectionsheet.business.CollSheetCustBO;
+import org.mifos.application.collectionsheet.business.CollSheetLnDetailsEntity;
+import org.mifos.application.collectionsheet.business.CollSheetSavingsDetailsEntity;
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.business.service.CustomerBusinessService;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.office.business.OfficeBO;
+import org.mifos.application.office.business.service.OfficeBusinessService;
+import org.mifos.application.personnel.business.PersonnelBO;
+import org.mifos.application.personnel.business.service.PersonnelBusinessService;
+import org.mifos.application.productdefinition.business.LoanOfferingBO;
+import org.mifos.application.productdefinition.business.SavingsOfferingBO;
+import org.mifos.application.productdefinition.business.service.LoanPrdBusinessService;
+import org.mifos.application.productdefinition.business.service.SavingsPrdBusinessService;
+import org.mifos.application.reports.business.dto.CollectionSheetReportDTO;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.util.CollectionUtils;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.NumberUtils;
+import org.mifos.framework.util.helpers.Predicate;
+
+// public interface for services used by collection sheet report
+public class CollectionSheetReportService implements
+		ICollectionSheetReportService {
+	private final OfficeBusinessService officeBusinessService;
+	private final PersonnelBusinessService personnelBusinessService;
+	private final CustomerBusinessService customerBusinessService;
+	private final CollectionSheetService collectionSheetService;
+	private final LoanPrdBusinessService loanProductBusinessService;
+	private final AccountBusinessService accountBusinessService;
+	private final SavingsPrdBusinessService savingsProductBusinessService;
+	private final ReportProductOfferingService reportProductOfferingService;
+	private final IReportsParameterService reportsParameterService;
+
+	CollectionSheetReportService(CollectionSheetService collectionSheetService,
+			OfficeBusinessService officeBusinessService,
+			PersonnelBusinessService personnelBusinessService,
+			CustomerBusinessService customerBusinessService,
+			AccountBusinessService accountBusinessService,
+			LoanPrdBusinessService loanProductBusinessService,
+			SavingsPrdBusinessService savingsProductBusinessService,
+			ReportProductOfferingService reportProductOfferingService,
+			IReportsParameterService reportsParameterService) {
+		super();
+		this.collectionSheetService = collectionSheetService;
+		this.officeBusinessService = officeBusinessService;
+		this.personnelBusinessService = personnelBusinessService;
+		this.customerBusinessService = customerBusinessService;
+		this.accountBusinessService = accountBusinessService;
+		this.loanProductBusinessService = loanProductBusinessService;
+		this.savingsProductBusinessService = savingsProductBusinessService;
+		this.reportProductOfferingService = reportProductOfferingService;
+		this.reportsParameterService = reportsParameterService;
+	}
+
+	CollectionSheetReportService() {
+		this(new CollectionSheetService(), new OfficeBusinessService(),
+				new PersonnelBusinessService(), new CustomerBusinessService(),
+				new AccountBusinessService(), new LoanPrdBusinessService(),
+				new SavingsPrdBusinessService(),
+				new ReportProductOfferingService(),
+				new ReportsParameterService());
+	}
+
+	public List<SelectionItem> getBranchOffices(Integer userId)
+			throws ServiceException, PersistenceException {
+		ArrayList<SelectionItem> branchOffices = new ArrayList<SelectionItem>();
+		PersonnelBO personnel = personnelBusinessService
+				.getPersonnel(convertIntegerToShort(userId));
+		List<SelectionItem> offices = new ArrayList<SelectionItem>();
+		if (personnel != null)
+			offices = reportsParameterService
+					.getActiveBranchesUnderUser(personnel.getOfficeSearchId());
+
+		if (offices.isEmpty()) {
+			branchOffices.add(NA_BRANCH_OFFICE_SELECTION_ITEM);
+		}
+		else {
+			branchOffices.add(SELECT_BRANCH_OFFICE_SELECTION_ITEM);
+			branchOffices.addAll(offices);
+		}
+		return branchOffices;
+	}
+
+	public List<SelectionItem> getActiveLoanOfficers(Integer userId,
+			Integer branchIdIntValue) throws ServiceException,
+			PersistenceException {
+		List<SelectionItem> officers = new ArrayList<SelectionItem>();
+		Short branchId = convertIntegerToShort(branchIdIntValue);
+
+		if (isBranchNA(branchId)) {
+			officers.add(NA_LOAN_OFFICER_SELECTION_ITEM);
+			return officers;
+		}
+		if (isSelectBranch(branchId)) {
+			officers.add(SELECT_LOAN_OFFICER_SELECTION_ITEM);
+			return officers;
+		}
+
+		PersonnelBO personnel = personnelBusinessService
+				.getPersonnel(convertIntegerToShort(userId));
+		if (personnel == null) {
+			officers.add(NA_LOAN_OFFICER_SELECTION_ITEM);
+			return officers;
+		}
+
+		if (personnel.isLoanOfficer()) {
+			officers.add(SELECT_LOAN_OFFICER_SELECTION_ITEM);
+			officers.add(new SelectionItem(personnel.getPersonnelId(),
+					personnel.getDisplayName()));
+			return officers;
+		}
+
+		List<SelectionItem> loanOfficers = reportsParameterService
+				.getActiveLoanOfficersUnderOffice(branchId);
+		officers.add(loanOfficers.isEmpty() ? NA_LOAN_OFFICER_SELECTION_ITEM
+				: ALL_LOAN_OFFICER_SELECTION_ITEM);
+		officers.addAll(loanOfficers);
+		return officers;
+	}
+
+	public List<SelectionItem> getActiveCentersForLoanOfficer(
+			Integer loanOfficerIdIntValue, Integer branchIdIntValue)
+			throws ServiceException, PersistenceException {
+		List<SelectionItem> activeCenters = new ArrayList<SelectionItem>();
+		Short loanOfficerId = convertIntegerToShort(loanOfficerIdIntValue);
+		if (loanOfficerId == null
+				|| SELECT_LOAN_OFFICER_SELECTION_ITEM.sameAs(loanOfficerId)) {
+			activeCenters.add(SELECT_CENTER_SELECTION_ITEM);
+			return activeCenters;
+		}
+		if (NA_LOAN_OFFICER_SELECTION_ITEM.sameAs(loanOfficerId)) {
+			activeCenters.add(NA_CENTER_SELECTION_ITEM);
+			return activeCenters;
+		}
+		List<SelectionItem> loanOfficers = null;
+		if (isLoanOfficerAll(loanOfficerId)) {
+			loanOfficers = reportsParameterService
+					.getActiveLoanOfficersUnderOffice(convertIntegerToShort(branchIdIntValue));
+		}
+		else {
+			PersonnelBO loanOfficer = personnelBusinessService
+					.getPersonnel(loanOfficerId);
+			loanOfficers = CollectionUtils.asList(new SelectionItem(loanOfficer
+					.getPersonnelId(), loanOfficer.getDisplayName()));
+		}
+		List<SelectionItem> allCentersUnderBranch = new ArrayList<SelectionItem>();
+		for (SelectionItem loanOfficer : loanOfficers) {
+			List<SelectionItem> activeCentersUnderUser = reportsParameterService
+								.getActiveCentersUnderUser(
+										convertIntegerToShort(branchIdIntValue),
+										loanOfficer.getId());
+			allCentersUnderBranch.addAll(activeCentersUnderUser);
+		}
+		activeCenters
+				.add(allCentersUnderBranch.isEmpty() ? NA_CENTER_SELECTION_ITEM
+						: ALL_CENTER_SELECTION_ITEM);
+		activeCenters.addAll(allCentersUnderBranch);
+		return activeCenters;
+	}
+
+	public List<SelectionItem> getActiveGroupsForLoanOfficer(
+			Integer loanOfficerId, Integer branchId) throws ServiceException,
+			PersistenceException {
+		List<SelectionItem> activeGroups = new ArrayList<SelectionItem>();
+		Short loanOfficerIdShort = NumberUtils
+				.convertIntegerToShort(loanOfficerId);
+
+		if (addCustomerIfSelectOrNALoanOfficer(activeGroups,
+				loanOfficerIdShort, CustomerLevel.GROUP))
+			return activeGroups;
+		List<SelectionItem> allGroupsUnderBranch = new ArrayList<SelectionItem>();
+		List<SelectionItem> activeLoanOfficers = new ArrayList<SelectionItem>();
+		Short branchIdShort = NumberUtils.convertIntegerToShort(branchId);
+		if (isLoanOfficerAll(loanOfficerIdShort)) {
+			activeLoanOfficers = reportsParameterService
+					.getActiveLoanOfficersUnderOffice(branchIdShort);
+		}
+		else {
+			PersonnelBO loanOfficer = personnelBusinessService
+					.getPersonnel(loanOfficerIdShort);
+			activeLoanOfficers = CollectionUtils
+					.asList(new SelectionItem(loanOfficer.getPersonnelId(),
+							loanOfficer.getDisplayName()));
+		}
+		for (SelectionItem loanOfficer : activeLoanOfficers) {
+			allGroupsUnderBranch.addAll(reportsParameterService
+					.getActiveGroupsUnderUser(branchIdShort, loanOfficer
+							.getId()));
+		}
+		activeGroups
+				.add(allGroupsUnderBranch.isEmpty() ? NA_GROUP_SELECTION_ITEM
+						: ALL_GROUP_SELECTION_ITEM);
+		activeGroups.addAll(allGroupsUnderBranch);
+		return activeGroups;
+	}
+
+	private List<DateSelectionItem> getMeetingDates(Integer branchIdIntValue,
+			Integer officerIdIntValue, Integer customerId,
+			CustomerLevel customerLevel) throws PersistenceException,
+			ServiceException {
+		List<DateSelectionItem> meetingDates = new ArrayList<DateSelectionItem>();
+		if (branchIdIntValue == null
+				|| SELECT_BRANCH_OFFICE_SELECTION_ITEM.sameAs(branchIdIntValue)
+				|| NA_BRANCH_OFFICE_SELECTION_ITEM.sameAs(branchIdIntValue)
+				|| SELECT_LOAN_OFFICER_SELECTION_ITEM.sameAs(officerIdIntValue)
+				|| NA_LOAN_OFFICER_SELECTION_ITEM.sameAs(officerIdIntValue)
+				|| SELECT_CENTER_SELECTION_ITEM.sameAs(customerId)
+				|| NA_CENTER_SELECTION_ITEM.sameAs(customerId)
+				|| SELECT_GROUP_SELECTION_ITEM.sameAs(customerId)
+				|| NA_GROUP_SELECTION_ITEM.sameAs(customerId)) {
+			meetingDates.add(NA_MEETING_DATE);
+			return meetingDates;
+		}
+
+		Short branchId = convertIntegerToShort(branchIdIntValue);
+		Short officerId = convertIntegerToShort(officerIdIntValue);
+		if (ALL_CENTER_SELECTION_ITEM.sameAs(customerId)
+				|| ALL_GROUP_SELECTION_ITEM.sameAs(customerId)) {
+			List<SelectionItem> officers = new ArrayList<SelectionItem>();
+			if (ALL_LOAN_OFFICER_SELECTION_ITEM.sameAs(officerIdIntValue)) {
+				officers = reportsParameterService
+						.getActiveLoanOfficersUnderOffice(branchId);
+			}
+			else {
+				officers = CollectionUtils.asList(new SelectionItem(
+						convertIntegerToShort(officerIdIntValue), null));
+			}
+			for (SelectionItem officer : officers) {
+				List<SelectionItem> customers = new ArrayList<SelectionItem>();
+				if (CustomerLevel.GROUP.equals(customerLevel))
+					customers = reportsParameterService
+							.getActiveGroupsUnderUser(branchId, officer.getId());
+				else customers = reportsParameterService
+						.getActiveCentersUnderUser(branchId, officer.getId());
+				for (SelectionItem customer : customers) {
+					List<DateSelectionItem> meetingDatesForCustomer = reportsParameterService
+							.getMeetingDates(branchId, officer.getId(),
+									convertShortToInteger(customer.getId()),
+									customerLevel, today());
+					if (meetingDatesForCustomer != null)
+						meetingDates.addAll(meetingDatesForCustomer);
+				}
+			}
+		}
+		else {
+			if (isLoanOfficerAll(officerId)) {
+				CustomerBO customer = customerBusinessService
+						.getCustomer(customerId);
+				officerId = customer.getPersonnel().getPersonnelId();
+			}
+			List<DateSelectionItem> meetingDatesForOfficerBranchCustomer = reportsParameterService
+					.getMeetingDates(branchId, officerId, customerId,
+							customerLevel, today());
+			if (meetingDatesForOfficerBranchCustomer != null)
+				meetingDates.addAll(meetingDatesForOfficerBranchCustomer);
+		}
+		if (meetingDates.isEmpty())
+			meetingDates.add(NA_MEETING_DATE);
+		return meetingDates;
+	}
+
+	public List<DateSelectionItem> getMeetingDatesForGroup(Integer branchId,
+			Integer groupId, Integer officerId) throws PersistenceException,
+			ServiceException {
+		return getMeetingDates(branchId, officerId, groupId,
+				CustomerLevel.GROUP);
+	}
+
+	public List<DateSelectionItem> getMeetingDatesForCenter(Integer branchId,
+			Integer groupId, Integer officerId) throws PersistenceException,
+			ServiceException {
+		return getMeetingDates(branchId, officerId, groupId,
+				CustomerLevel.CENTER);
+	}
+
+	private List<CollectionSheetReportDTO> getCollectionSheets(
+			Integer branchId, Integer officerId, Integer customerId,
+			Date meetingDate, CustomerLevel customerLevel) throws Exception {
+		OfficeBO office = officeBusinessService.getOffice(NumberUtils
+				.convertIntegerToShort(branchId));
+		List<CustomerBO> applicableCustomers = getApplicableCustomers(branchId,
+				officerId, customerId, customerLevel);
+		java.sql.Date sqlMeetingDate = DateUtils.convertToSqlDate(meetingDate);
+		List<CollectionSheetReportDTO> collectionSheetReport = new ArrayList<CollectionSheetReportDTO>();
+		for (CustomerBO customer : applicableCustomers) {
+			if (CustomerLevel.CENTER.equals(customerLevel))
+				collectionSheetReport.addAll(collectCenterLevelData(office,
+						customer, sqlMeetingDate));
+			else if (CustomerLevel.GROUP.equals(customerLevel)) {
+				List<CollSheetCustBO> groupCollectionSheets = collectionSheetService
+						.getCollectionSheetForCustomerOnMeetingDate(
+								sqlMeetingDate, customer.getCustomerId(),
+								NumberUtils.convertIntegerToShort(officerId),
+								customerLevel);
+				collectionSheetReport.addAll(collectGroupLevelData(office,
+						customer, sqlMeetingDate, groupCollectionSheets));
+			}
+		}
+		return collectionSheetReport;
+	}
+
+	public List<CollectionSheetReportDTO> getCollectionSheets(Integer branchId,
+			Integer officerId, Integer customerId, Date meetingDate,
+			Integer customerLevel) throws Exception {
+		return getCollectionSheets(branchId, officerId, customerId,
+				meetingDate, CustomerLevel.getLevel(NumberUtils
+						.convertIntegerToShort(customerLevel)));
+	}
+
+	private List<CustomerBO> getApplicableCustomers(Integer branchId,
+			Integer officerId, Integer customerId, CustomerLevel level)
+			throws ServiceException {
+		List<CustomerBO> activeCenters = new ArrayList<CustomerBO>();
+		if (ALL_CENTER_SELECTION_ITEM.sameAs(customerId)
+				|| ALL_GROUP_SELECTION_ITEM.sameAs(customerId)) {
+			List<PersonnelBO> activeLoanOfficers = new ArrayList<PersonnelBO>();
+			if (ALL_LOAN_OFFICER_SELECTION_ITEM.sameAs(officerId)) {
+				activeLoanOfficers
+						.addAll(personnelBusinessService
+								.getActiveLoanOfficersUnderOffice(convertIntegerToShort(branchId)));
+			}
+			else {
+				activeLoanOfficers.add(personnelBusinessService
+						.getPersonnel(convertIntegerToShort(officerId)));
+			}
+			for (PersonnelBO loanOfficer : activeLoanOfficers) {
+				if (CustomerLevel.CENTER.equals(level))
+					activeCenters.addAll(customerBusinessService
+							.getActiveCentersUnderUser(loanOfficer));
+				else if (CustomerLevel.GROUP.equals(level))
+					activeCenters.addAll(customerBusinessService
+							.getGroupsUnderUser(loanOfficer));
+			}
+			return activeCenters;
+		}
+		activeCenters.add(customerBusinessService.getCustomer(customerId));
+		return activeCenters;
+	}
+
+	CollSheetLnDetailsEntity getLoanProduct(CollSheetCustBO collectionSheet,
+			final LoanOfferingBO productOffering) throws Exception {
+		return CollectionUtils.find(collectionSheet
+				.getCollectionSheetLoanDetails(),
+				new Predicate<CollSheetLnDetailsEntity>() {
+					public boolean evaluate(CollSheetLnDetailsEntity loanDetail)
+							throws Exception {
+						return ((LoanBO) accountBusinessService
+								.getAccount(loanDetail.getAccountId()))
+								.isOfProductOffering(productOffering);
+					}
+				});
+	}
+
+	CollSheetSavingsDetailsEntity getSavingProduct(
+			CollSheetCustBO collectionSheet,
+			final SavingsOfferingBO productOffering) throws Exception {
+		return CollectionUtils.find(collectionSheet
+				.getCollSheetSavingsDetails(),
+				new Predicate<CollSheetSavingsDetailsEntity>() {
+					public boolean evaluate(
+							CollSheetSavingsDetailsEntity savingDetail)
+							throws Exception {
+						return ((SavingsBO) accountBusinessService
+								.getAccount(savingDetail.getAccountId()))
+								.isOfProductOffering(productOffering);
+					}
+				});
+	}
+
+	LoanOfferingBO getLoanOffering(Short productOfferingId)
+			throws ServiceException {
+		return loanProductBusinessService.getLoanOffering(productOfferingId);
+	}
+
+	SavingsOfferingBO getSavingsOffering(Short savingsOfferingId)
+			throws ServiceException {
+		return savingsProductBusinessService
+				.getSavingsProduct(savingsOfferingId);
+	}
+
+
+	private List<CollectionSheetReportDTO> collectCenterLevelData(
+			OfficeBO office, CustomerBO center, java.sql.Date meetingDate)
+			throws Exception {
+		List<CollectionSheetReportDTO> collectionSheets = new ArrayList<CollectionSheetReportDTO>();
+		List<CollSheetCustBO> centerCollectionSheets = collectionSheetService
+				.getCollectionSheetForCustomerOnMeetingDate(meetingDate, center
+						.getCustomerId(), center.getPersonnel()
+						.getPersonnelId(), CustomerLevel.CENTER);
+		for (CollSheetCustBO centerCollectionSheet : centerCollectionSheets) {
+			List<CollSheetCustBO> collectionSheetForGroups = collectionSheetService
+					.getCollectionSheetForGroups(meetingDate,
+							centerCollectionSheet, center.getPersonnel()
+									.getPersonnelId());
+			collectionSheets.addAll(collectGroupLevelData(office, center,
+					meetingDate, collectionSheetForGroups));
+		}
+		return collectionSheets;
+	}
+
+	private List<CollectionSheetReportDTO> collectGroupLevelData(
+			OfficeBO office, CustomerBO customer, java.sql.Date meetingDate,
+			List<CollSheetCustBO> groupCollectionSheets) throws Exception {
+		LoanOfferingBO loanOffering1 = getLoanOffering(reportProductOfferingService
+				.getLoanProduct1());
+		LoanOfferingBO loanOffering2 = getLoanOffering(reportProductOfferingService
+				.getLoanProduct2());
+		SavingsOfferingBO savingsOffering1 = getSavingsOffering(reportProductOfferingService
+				.getSavingsProduct1());
+		SavingsOfferingBO savingsOffering2 = getSavingsOffering(reportProductOfferingService
+				.getSavingsProduct2());
+		List<CollectionSheetReportDTO> collectionSheetReport = new ArrayList<CollectionSheetReportDTO>();
+		try {
+			for (CollSheetCustBO groupCollectionSheet : groupCollectionSheets) {
+				List<CollSheetCustBO> clientCollectionSheets = collectionSheetService
+						.getCollectionSheetForCustomers(meetingDate,
+								groupCollectionSheet, customer.getPersonnel()
+										.getPersonnelId());
+				for (CollSheetCustBO clientCollectionSheet : clientCollectionSheets) {
+					collectionSheetReport
+							.add(new CollectionSheetReportDTO(
+									getLoanProduct(clientCollectionSheet,
+											loanOffering1),
+									getLoanProduct(clientCollectionSheet,
+											loanOffering2),
+									getSavingProduct(clientCollectionSheet,
+											savingsOffering1),
+									getSavingProduct(clientCollectionSheet,
+											savingsOffering2),
+									clientCollectionSheet.getCustId(),
+									clientCollectionSheet.getParentCustomerId(),
+									clientCollectionSheet.getCustDisplayName(),
+									office.getOfficeName(),
+									groupCollectionSheet.getCustDisplayName(),
+									customer, loanOffering1
+											.getPrdOfferingShortName(),
+									loanOffering2.getPrdOfferingShortName(),
+									savingsOffering1.getPrdOfferingShortName(),
+									savingsOffering2.getPrdOfferingShortName()));
+				}
+			}
+		}
+		catch (Exception e) {
+			System.err.println(e);
+			e.printStackTrace();
+		}
+		return collectionSheetReport;
+	}
+
+	private boolean addCustomerIfSelectOrNALoanOfficer(List customers,
+			Short loanOfficerId, CustomerLevel customerLevel) {
+		if (loanOfficerId == null
+				|| SELECT_LOAN_OFFICER_SELECTION_ITEM.sameAs(loanOfficerId)) {
+			customers.add(SelectionItem.SELECT_GROUP_SELECTION_ITEM);
+			return true;
+		}
+		else if (NA_LOAN_OFFICER_SELECTION_ITEM.sameAs(loanOfficerId)) {
+			customers.add(NA_GROUP_SELECTION_ITEM);
+			return true;
+		}
+		return false;
+	}
+
+	private boolean isSelectBranch(Short branchId) {
+		return branchId == null
+				|| SELECT_BRANCH_OFFICE_SELECTION_ITEM.getId().equals(branchId);
+	}
+
+	private boolean isBranchNA(Short branchId) {
+		return NA_BRANCH_OFFICE_SELECTION_ITEM.getId().equals(branchId);
+	}
+
+	private boolean isLoanOfficerAll(Short loanOfficerIdShort) {
+		return ALL_LOAN_OFFICER_SELECTION_ITEM.sameAs(loanOfficerIdShort);
+	}
+
+	private java.sql.Date today() {
+		//		return DateUtils.sqlToday();
+		return DateUtils.getSqlDate(2007, Calendar.JUNE, 30);
+	}
+}
Index: src/org/mifos/application/reports/business/service/CollectionSheetService.java
===================================================================
--- src/org/mifos/application/reports/business/service/CollectionSheetService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/CollectionSheetService.java	(revision 0)
@@ -0,0 +1,87 @@
+package org.mifos.application.reports.business.service;
+
+import java.sql.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.collectionsheet.business.CollSheetCustBO;
+import org.mifos.application.collectionsheet.business.CollectionSheetBO;
+import org.mifos.application.collectionsheet.persistence.CollectionSheetPersistence;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class CollectionSheetService {
+	public List<CollSheetCustBO> getCollectionSheetForCustomerOnMeetingDate(
+			Date meetingDate, Integer centerId, Short loanOfficerId,
+			CustomerLevel customerLevel) throws PersistenceException {
+		Map parameters = populateQueryParams(meetingDate, centerId,
+				customerLevel);
+		parameters.put("LOAN_OFFICER_ID", loanOfficerId);
+		return retrieveCollectionSheetCustomers(
+				NamedQueryConstants.COLLECTION_SHEET_CUSTOMERS_ON_MEETING_DATE_FOR_LOAN_OFFICER,
+				parameters);
+	}
+
+	public List<CollSheetCustBO> getCollectionSheetForCustomers(
+			Date meetingDate, CollSheetCustBO parent, Short loanOfficerId)
+			throws PersistenceException {
+		return retrieveCollectionSheetOfChildrensOnMeetingDate(meetingDate,
+				parent, CustomerLevel.CLIENT, loanOfficerId);
+	}
+
+	public List<CollSheetCustBO> getCollectionSheetForGroups(Date meetingDate,
+			CollSheetCustBO parent, Short loanOfficerId)
+			throws PersistenceException {
+		return retrieveCollectionSheetOfChildrensOnMeetingDate(meetingDate,
+				parent, CustomerLevel.GROUP, loanOfficerId);
+	}
+
+	private List<CollSheetCustBO> retrieveCollectionSheetOfChildrensOnMeetingDate(
+			Date meetingDate, CollSheetCustBO parent,
+			CustomerLevel childrenLevel, Short loanOfficerId)
+			throws PersistenceException {
+		Map parameters = new HashMap();
+		parameters.put("CUSTOMER_LEVEL", childrenLevel.getValue());
+		parameters.put("MEETING_DATE", meetingDate);
+		parameters.put("PARENT_CUSTOMER_ID", parent.getCustId());
+		parameters.put("LOAN_OFFICER_ID", loanOfficerId);
+		List<CollSheetCustBO> collectionSheetOfChildrens = retrieveCollectionSheetCustomers(
+				NamedQueryConstants.COLLECTION_SHEETS_OF_CHILDREN_ON_MEETING_DATE,
+				parameters);
+		return collectionSheetOfChildrens;
+	}
+
+	private Map populateQueryParams(Date meetingDate, Integer centerId,
+			CustomerLevel customerLevel) {
+		Map parameters = new HashMap();
+		parameters.put("CUSTOMER_LEVEL", customerLevel.getValue());
+		parameters.put("MEETING_DATE", meetingDate);
+		parameters.put("CUSTOMER_ID", centerId);
+		return parameters;
+	}
+
+	private List<CollSheetCustBO> retrieveCollectionSheetCustomers(
+			String queryName, Map parameters) throws PersistenceException {
+		List<CollSheetCustBO> centersCollectionSheet = new CollectionSheetPersistence()
+				.executeNamedQuery(queryName, parameters);
+		return centersCollectionSheet;
+	}
+
+//	public List<CollectionSheetBO> getCollectionSheet(Short branchId,
+//			Integer centerId, Short loanOfficerId, Date fromDate,
+//			CustomerLevel customerLevel) throws PersistenceException {
+//		Map parameters = new HashMap();
+//		parameters.put("OFFICE_ID", branchId);
+//		parameters.put("CUSTOMER_ID", centerId);
+//		parameters.put("CUSTOMER_LEVEL", customerLevel.getValue());
+//		parameters.put("LOAN_OFFICER_ID", loanOfficerId);
+//		parameters.put("FROM_DATE", fromDate);
+//		List<CollectionSheetBO> centersCollectionSheet = new CollectionSheetPersistence()
+//				.executeNamedQuery(
+//						NamedQueryConstants.COLLECTION_SHEET_FOR_SPECIFIED_CUSTOMER,
+//						parameters);
+//		return centersCollectionSheet;
+//	}
+}
Index: src/org/mifos/application/reports/business/service/ReportsDataService.java
===================================================================
--- src/org/mifos/application/reports/business/service/ReportsDataService.java	(revision 12247)
+++ src/org/mifos/application/reports/business/service/ReportsDataService.java	(working copy)
@@ -14,6 +14,7 @@
 import org.mifos.application.productdefinition.business.service.LoanPrdBusinessService;
 import org.mifos.framework.exceptions.PersistenceException;
 import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.util.helpers.NumberUtils;
 
 public class ReportsDataService {
 
@@ -36,7 +37,7 @@
 
 	public void initialize(Integer userId) throws ServiceException {
 		this.personnel = personnelBusinessService
-				.getPersonnel(convertIntegerToShort(userId));
+				.getPersonnel(NumberUtils.convertIntegerToShort(userId));
 	}
 
 	public List<OfficeBO> getActiveBranchesUnderUser() throws ServiceException {
@@ -51,7 +52,7 @@
 		}
 		else {
 			loanOfficers = personnelBusinessService
-					.getActiveLoanOfficersUnderOffice(convertIntegerToShort(branchId));
+					.getActiveLoanOfficersUnderOffice(NumberUtils.convertIntegerToShort(branchId));
 			loanOfficers.add(PersonnelBO.ALL_PERSONNEL);
 		}
 		return loanOfficers;
@@ -69,18 +70,18 @@
 			Integer loanOfficerId, Integer loanProductId)
 			throws PersistenceException {
 		return loanPersistence.getLoanAccountsInActiveBadStanding(
-				convertIntegerToShort(branchId),
-				convertIntegerToShort(loanOfficerId),
-				convertIntegerToShort(loanProductId));
+				NumberUtils.convertIntegerToShort(branchId),
+				NumberUtils.convertIntegerToShort(loanOfficerId),
+				NumberUtils.convertIntegerToShort(loanProductId));
 	}
 
 	public List<LoanBO> getActiveLoansBothInGoodAndBadStandingByLoanOfficer(
 			Integer branchId, Integer loanOfficerId, Integer loanProductId)
 			throws PersistenceException {
 		return loanPersistence.getActiveLoansBothInGoodAndBadStandingByLoanOfficer(
-						convertIntegerToShort(branchId),
-						convertIntegerToShort(loanOfficerId),
-						convertIntegerToShort(loanProductId));
+						NumberUtils.convertIntegerToShort(branchId),
+						NumberUtils.convertIntegerToShort(loanOfficerId),
+						NumberUtils.convertIntegerToShort(loanProductId));
 	}
 
 	public BigDecimal getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(
@@ -88,9 +89,9 @@
 			throws PersistenceException {
 		return loanPersistence
 				.getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(
-						convertIntegerToShort(branchId),
-						convertIntegerToShort(loanOfficerId),
-						convertIntegerToShort(loanProductId));
+						NumberUtils.convertIntegerToShort(branchId),
+						NumberUtils.convertIntegerToShort(loanOfficerId),
+						NumberUtils.convertIntegerToShort(loanProductId));
 	}
 
 
@@ -119,12 +120,5 @@
 		return personnel;
 	}
 
-	private Short convertIntegerToShort(Integer intValue) {
-		if (intValue == null) {
-			return null;
-		}
-		return intValue.shortValue();
-	}
 
-
 }
Index: src/org/mifos/application/reports/business/service/CollectionSheetReportServiceFactory.java
===================================================================
--- src/org/mifos/application/reports/business/service/CollectionSheetReportServiceFactory.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/CollectionSheetReportServiceFactory.java	(revision 0)
@@ -0,0 +1,25 @@
+package org.mifos.application.reports.business.service;
+
+import org.mifos.framework.util.helpers.FilePaths;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class CollectionSheetReportServiceFactory {
+	private static final String COLLECTION_SHEET_REPORT_SERVICE_BEAN = "collectionSheetReportService";
+	private static ICollectionSheetReportService CACHE_ENABLED_INSTANCE = null;
+
+	public static ICollectionSheetReportService getCacheEnabledCollectionSheetReportService() {
+		if (CACHE_ENABLED_INSTANCE == null)
+			initCacheEnabledReportService();
+		return CACHE_ENABLED_INSTANCE;
+	}
+
+	private static void initCacheEnabledReportService() {
+		CACHE_ENABLED_INSTANCE = (ICollectionSheetReportService) new ClassPathXmlApplicationContext(
+				FilePaths.REPORT_SERVICE_BEAN_FILE)
+				.getBean(COLLECTION_SHEET_REPORT_SERVICE_BEAN);
+	}
+
+	public static ICollectionSheetReportService getCollectionSheetReportService() {
+		return new CollectionSheetReportService();
+	}
+}
Index: src/org/mifos/application/reports/business/service/IReportsParameterService.java
===================================================================
--- src/org/mifos/application/reports/business/service/IReportsParameterService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/IReportsParameterService.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.mifos.application.reports.business.service;
+
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+
+
+public interface IReportsParameterService {
+
+	public abstract List<SelectionItem> getActiveBranchesUnderUser(
+			String officeSearchId) throws PersistenceException;
+
+	public abstract List<SelectionItem> getActiveLoanOfficersUnderOffice(
+			Short branchId) throws PersistenceException;
+
+	public abstract List<SelectionItem> getActiveCentersUnderUser(
+			Short branchId, Short loanOfficerId) throws PersistenceException;
+
+	public abstract List<DateSelectionItem> getMeetingDates(Short branchId,
+			Short loanOfficerId, Integer centerId, CustomerLevel customerLevel, Date from)
+			throws PersistenceException;
+
+	public abstract List<SelectionItem> getActiveGroupsUnderUser(Short branchId,
+			Short loanOfficerId) throws PersistenceException;
+}
Index: src/org/mifos/application/reports/business/service/ICollectionSheetReportService.java
===================================================================
--- src/org/mifos/application/reports/business/service/ICollectionSheetReportService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/ICollectionSheetReportService.java	(revision 0)
@@ -0,0 +1,43 @@
+package org.mifos.application.reports.business.service;
+
+import java.util.Date;
+import java.util.List;
+
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.reports.business.dto.CollectionSheetReportDTO;
+import org.mifos.application.reports.ui.DateSelectionItem;
+import org.mifos.application.reports.ui.SelectionItem;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.exceptions.ServiceException;
+
+
+public interface ICollectionSheetReportService {
+
+	public abstract List<SelectionItem> getBranchOffices(Integer userId)
+			throws ServiceException, PersistenceException;
+
+	public abstract List<SelectionItem> getActiveLoanOfficers(Integer userId,
+			Integer branchIdIntValue) throws ServiceException,
+			PersistenceException;
+
+	public abstract List<SelectionItem> getActiveCentersForLoanOfficer(
+			Integer loanOfficerIdIntValue, Integer branchIdIntValue)
+			throws ServiceException, PersistenceException;
+
+	public abstract List<SelectionItem> getActiveGroupsForLoanOfficer(
+			Integer loanOfficerId, Integer branchId) throws ServiceException,
+			PersistenceException;
+
+	public abstract List<CollectionSheetReportDTO> getCollectionSheets(
+			Integer branchId, Integer officerId, Integer centerId,
+			Date meetingDate, Integer customerLevel) throws Exception;
+
+	public List<DateSelectionItem> getMeetingDatesForGroup(Integer branchId,
+			Integer groupId, Integer officerId) throws PersistenceException,
+			ServiceException;
+
+	public List<DateSelectionItem> getMeetingDatesForCenter(Integer branchId,
+			Integer groupId, Integer officerId) throws PersistenceException,
+			ServiceException;
+
+}
Index: src/org/mifos/application/reports/business/service/ReportProductOfferingService.java
===================================================================
--- src/org/mifos/application/reports/business/service/ReportProductOfferingService.java	(revision 0)
+++ src/org/mifos/application/reports/business/service/ReportProductOfferingService.java	(revision 0)
@@ -0,0 +1,54 @@
+package org.mifos.application.reports.business.service;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.mifos.application.reports.exceptions.ReportServiceInitializationException;
+import org.mifos.framework.util.helpers.FilePaths;
+
+public class ReportProductOfferingService {
+
+	private static final String LOAN_PRODUCT_IDS = "loan.product.ids";
+	private static final String SAVINGS_PRODUCT_IDS = "savings.product.ids";
+	private static final String IDS_DELIMITER = "\\s*,\\s*";
+	
+	private String[] configuredSavingProducts;
+	private String[] configuredLoanProducts;
+
+	public ReportProductOfferingService() {
+		try {
+			init();
+		}
+		catch (IOException e) {
+			throw new ReportServiceInitializationException("Failed to initialize Report Product Offering Service", e);
+		}
+	}
+
+	public void init() throws IOException {
+		Properties properties = new Properties();
+		properties
+				.load(getClass()
+						.getResourceAsStream(
+								FilePaths.REPORT_PRODUCT_OFFERING_CONFIG));
+		configuredSavingProducts = properties
+				.getProperty(SAVINGS_PRODUCT_IDS).split(IDS_DELIMITER);
+		configuredLoanProducts = properties.getProperty(LOAN_PRODUCT_IDS)
+				.split(IDS_DELIMITER);
+	}
+
+	public Short getLoanProduct1() {
+		return Short.valueOf(configuredLoanProducts[0]);
+	}
+	
+	public Short getLoanProduct2() {
+		return Short.valueOf(configuredLoanProducts[1]);
+	}
+
+	public Short getSavingsProduct1() {
+		return Short.valueOf(configuredSavingProducts[0]);
+	}
+
+	public Short getSavingsProduct2() {
+		return Short.valueOf(configuredSavingProducts[1]);
+	}
+}
Index: src/org/mifos/application/reports/business/NameValuePair.java
===================================================================
--- src/org/mifos/application/reports/business/NameValuePair.java	(revision 0)
+++ src/org/mifos/application/reports/business/NameValuePair.java	(revision 0)
@@ -0,0 +1,20 @@
+package org.mifos.application.reports.business;
+
+public class NameValuePair {
+	private final String name;
+	private final String value;
+
+	public NameValuePair(String name, String value) {
+		super();
+		this.name = name;
+		this.value = value;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public String getValue() {
+		return value;
+	}
+}
Index: src/org/mifos/application/reports/util/helpers/ReportsConstants.java
===================================================================
--- src/org/mifos/application/reports/util/helpers/ReportsConstants.java	(revision 12247)
+++ src/org/mifos/application/reports/util/helpers/ReportsConstants.java	(working copy)
@@ -38,6 +38,8 @@
 
 package org.mifos.application.reports.util.helpers;
 
+import java.util.Date;
+
 public interface ReportsConstants {
 	public String GETPATH_REPORTS="reportsAction";
 	public String GETREPORTPAGE="getReportPage";
@@ -81,6 +83,13 @@
 	public static final String ERROR_REPORTALREADYEXIST="error.reportAlreadyExist";
 	public static final String ERROR_REPORTACTIVITYIDISNULL="error.reportActivityIdIsNull";
 	public static final String ERROR_NOMOREDYNAMICACTIVITYID="error.noMoreDynamicActivityId";
-	
-	
+//added by collection sheet report module
+	public static final String SELECT_DISPLAY_NAME = "---Select---";
+	public static final String NOT_APPLICABLE_DISPLAY_NAME = "---N/A---";
+	public static final String ALL_DISPLAY_NAME = "ALL";
+	public static final Short NOT_APPLICABLE_ID = new Short("-3");
+	public static final Short SELECT_ID = new Short("-2");
+	public static final Short ALL_ID = new Short("-1");
+	public static final Date NA_DATE = new Date(0l);
+//ended by collection sheet report module
 }
Index: src/org/mifos/application/reports/util/helpers/CollectionSheetReportConstants.java
===================================================================
--- src/org/mifos/application/reports/util/helpers/CollectionSheetReportConstants.java	(revision 0)
+++ src/org/mifos/application/reports/util/helpers/CollectionSheetReportConstants.java	(revision 0)
@@ -0,0 +1,18 @@
+package org.mifos.application.reports.util.helpers;
+
+
+
+public class CollectionSheetReportConstants {
+
+	public static final String LOAN_OFFICER_ID_INVALID_MSG = "loanOfficerId.invalid";
+	public static final String CENTER_ID_INVALID_MSG = "centerId.invalid";
+	public static final String MEETING_DATE_INVALID_MSG = "meetingDate.invalid";
+	
+	public static final String BRANCH_ID_PARAM = "branchId";
+	public static final String LOAN_OFFICER_ID_PARAM = "loanOfficerId";
+	public static final String CENTER_ID_PARAM = "centerId";
+	public static final String MEETING_DATE_PARAM = "meetingDate";
+	public static final String[] REPORT_PARAMS_ARRAY = {BRANCH_ID_PARAM, LOAN_OFFICER_ID_PARAM, CENTER_ID_PARAM, 
+		MEETING_DATE_PARAM};
+
+}
Index: src/org/mifos/application/reports/action/BirtReportValidationAction.java
===================================================================
--- src/org/mifos/application/reports/action/BirtReportValidationAction.java	(revision 0)
+++ src/org/mifos/application/reports/action/BirtReportValidationAction.java	(revision 0)
@@ -0,0 +1,68 @@
+package org.mifos.application.reports.action;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.mifos.application.reports.business.ReportParameterForm;
+import org.mifos.application.reports.business.validator.CollectionSheetReportParamValidator;
+import org.mifos.application.reports.business.validator.DetailedAgingPortfolioReportParamValidator;
+import org.mifos.application.reports.business.validator.Errors;
+import org.mifos.application.reports.business.validator.ReportParameterValidator;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.servlet.ModifiableParameterServletRequest;
+
+public class BirtReportValidationAction extends HttpServlet {
+
+	private static final String ERRORS = "reportErrors";
+	private static Map<String, ReportParameterValidator<ReportParameterForm>> reportValidators = new HashMap<String, ReportParameterValidator<ReportParameterForm>>();
+
+	static {
+		reportValidators.put("report/LayoutReport.rptdesign",
+				CollectionSheetReportParamValidator.INSTANCE);
+		reportValidators.put("report/DetailedAgingPortfolioAtRisk.rptdesign", 
+				DetailedAgingPortfolioReportParamValidator.INSTANCE);
+		reportValidators.put("report/ActiveLoansByLoanOfficer.rptdesign", 
+				DetailedAgingPortfolioReportParamValidator.INSTANCE);		
+	}
+
+	@Override
+	protected void doGet(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		validateReportParameters(request, response);
+	}
+
+	@Override
+	protected void doPost(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		doGet(request, response);
+	}
+
+	private void validateReportParameters(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		ReportParameterValidator validator = reportValidators.get(request
+				.getParameter("__report"));
+		if (validator == null || request.getParameter("branchId") == null) {
+			request.getRequestDispatcher("/run").forward(request, response);
+			return;
+		}
+
+		ReportParameterForm form = validator.buildReportParameterForm(request);
+		Errors errors = new Errors(((UserContext) request.getSession()
+				.getAttribute("UserContext")).getPreferredLocale());
+		validator.validate(form, errors);
+		ModifiableParameterServletRequest modifiedRequest = new ModifiableParameterServletRequest(
+				request);
+
+		if (errors.hasErrors()) {
+			request.setAttribute(ERRORS, errors);
+			validator.removeRequestParameters(modifiedRequest, form, errors);
+		}
+		request.getRequestDispatcher("/run").forward(modifiedRequest, response);
+	}
+}
Index: src/org/mifos/application/reports/ui/DateSelectionItem.java
===================================================================
--- src/org/mifos/application/reports/ui/DateSelectionItem.java	(revision 0)
+++ src/org/mifos/application/reports/ui/DateSelectionItem.java	(revision 0)
@@ -0,0 +1,80 @@
+package org.mifos.application.reports.ui;
+
+import static org.mifos.application.reports.util.helpers.ReportsConstants.NA_DATE;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.NOT_APPLICABLE_DISPLAY_NAME;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.mifos.framework.util.LocalizationConverter;
+
+public class DateSelectionItem implements Serializable {
+
+	private static final SimpleDateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat(
+			"dd/MM/yyyy");
+	public static final DateSelectionItem NA_MEETING_DATE = new DateSelectionItem(
+			NA_DATE, NOT_APPLICABLE_DISPLAY_NAME);
+
+	private Date date;
+	private String displayDate;
+	// For Hibernate
+	public DateSelectionItem() {
+		super();
+	}
+
+	public DateSelectionItem(Date date) {
+		this.date = date;
+	}
+
+	public DateSelectionItem(Date date, String display) {
+		this.date = date;
+		this.displayDate = display;
+	}
+
+	private DateFormat getDateFormat() {
+		DateFormat dateFormat;
+		try {
+			dateFormat = LocalizationConverter.getInstance().getDateFormat();
+		}
+		catch (RuntimeException e) {
+			dateFormat = DEFAULT_DATE_FORMAT;
+		}
+		return dateFormat;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public String getDisplayDate() {
+		return displayDate != null ? displayDate : getDateFormat().format(date);
+	}
+
+	@Override
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + ((date == null) ? 0 : date.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final DateSelectionItem other = (DateSelectionItem) obj;
+		if (date == null) {
+			if (other.date != null)
+				return false;
+		}
+		else if (!date.equals(other.date))
+			return false;
+		return true;
+	}
+}
Index: src/org/mifos/application/reports/ui/SelectionItem.java
===================================================================
--- src/org/mifos/application/reports/ui/SelectionItem.java	(revision 0)
+++ src/org/mifos/application/reports/ui/SelectionItem.java	(revision 0)
@@ -0,0 +1,101 @@
+package org.mifos.application.reports.ui;
+
+import static org.mifos.application.reports.util.helpers.ReportsConstants.ALL_DISPLAY_NAME;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.ALL_ID;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.NOT_APPLICABLE_DISPLAY_NAME;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.NOT_APPLICABLE_ID;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.SELECT_DISPLAY_NAME;
+import static org.mifos.application.reports.util.helpers.ReportsConstants.SELECT_ID;
+import static org.mifos.framework.util.helpers.NumberUtils.convertIntegerToShort;
+
+import java.io.Serializable;
+
+public class SelectionItem implements Serializable {
+	public static final SelectionItem ALL_LOAN_OFFICER_SELECTION_ITEM = new SelectionItem(
+			ALL_ID, ALL_DISPLAY_NAME);
+	public static final SelectionItem SELECT_LOAN_OFFICER_SELECTION_ITEM = new SelectionItem(
+			SELECT_ID, SELECT_DISPLAY_NAME);
+	public static final SelectionItem NA_LOAN_OFFICER_SELECTION_ITEM = new SelectionItem(
+			NOT_APPLICABLE_ID, NOT_APPLICABLE_DISPLAY_NAME);
+
+	public static final SelectionItem SELECT_BRANCH_OFFICE_SELECTION_ITEM = new SelectionItem(
+			SELECT_ID, SELECT_DISPLAY_NAME);
+	public static final SelectionItem NA_BRANCH_OFFICE_SELECTION_ITEM = new SelectionItem(
+			NOT_APPLICABLE_ID, NOT_APPLICABLE_DISPLAY_NAME);
+	public static final SelectionItem ALL_CENTER_SELECTION_ITEM = new SelectionItem(ALL_ID,
+			ALL_DISPLAY_NAME);
+	public static final SelectionItem NA_CENTER_SELECTION_ITEM = new SelectionItem(
+			NOT_APPLICABLE_ID, NOT_APPLICABLE_DISPLAY_NAME);
+	public static final SelectionItem SELECT_CENTER_SELECTION_ITEM = new SelectionItem(
+			SELECT_ID, SELECT_DISPLAY_NAME);
+	
+	public static final SelectionItem SELECT_GROUP_SELECTION_ITEM = new SelectionItem(
+			SELECT_ID, SELECT_DISPLAY_NAME);	
+	public static final SelectionItem NA_GROUP_SELECTION_ITEM = new SelectionItem(
+			NOT_APPLICABLE_ID,NOT_APPLICABLE_DISPLAY_NAME);	
+	public static final SelectionItem ALL_GROUP_SELECTION_ITEM = new SelectionItem(
+			ALL_ID, ALL_DISPLAY_NAME);	
+
+	private String displayName;
+	private Short id;
+
+	public SelectionItem(Short id, String displayName) {
+		super();
+		this.displayName = displayName;
+		this.id = id;
+	}
+
+	public SelectionItem() {
+		super();
+	}
+
+	public Short getId() {
+		return id;
+	}
+
+	public String getDisplayName() {
+		return displayName;
+	}
+
+	@Override
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + ((displayName == null) ? 0 : displayName.hashCode());
+		result = PRIME * result + ((id == null) ? 0 : id.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final SelectionItem other = (SelectionItem) obj;
+		if (displayName == null) {
+			if (other.displayName != null)
+				return false;
+		}
+		else if (!displayName.equals(other.displayName))
+			return false;
+		if (id == null) {
+			if (other.id != null)
+				return false;
+		}
+		else if (!id.equals(other.id))
+			return false;
+		return true;
+	}
+
+	public boolean sameAs(Integer id) {
+		return this.id.equals(convertIntegerToShort(id));
+	}
+
+	public boolean sameAs(Short id) {
+		return this.id.equals(id);
+	}
+
+}
Index: src/org/mifos/application/reports/ui/DateSelectionItem.hbm.xml
===================================================================
--- src/org/mifos/application/reports/ui/DateSelectionItem.hbm.xml	(revision 0)
+++ src/org/mifos/application/reports/ui/DateSelectionItem.hbm.xml	(revision 0)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping>
+	<class name="org.mifos.application.reports.ui.DateSelectionItem"
+		mutable="false">
+		<id name="date" type="date" access="field" />
+	</class>
+	<sql-query name="DateSelectionItem.get_meeting_dates">
+		<return alias="dateItem"
+			class="org.mifos.application.reports.ui.DateSelectionItem"
+			 />
+		<![CDATA[
+			SELECT DISTINCT(COLL_SHEET.COLL_SHEET_DATE) as {dateItem.date}
+			  	from COLL_SHEET, COLL_SHEET_CUSTOMER
+				where COLL_SHEET_CUSTOMER.COLL_SHEET_ID=COLL_SHEET.COLL_SHEET_ID
+				and COLL_SHEET.STATUS_FLAG=:COLL_SHEET_RUN_STATUS
+				and COLL_SHEET_CUSTOMER.CUST_ID=:customerId
+				and COLL_SHEET_CUSTOMER.CUST_LEVEL=:CUSTOMER_LEVEL
+				and COLL_SHEET_CUSTOMER.CUST_OFFICE_ID=:branchId
+				and COLL_SHEET_CUSTOMER.LOAN_OFFICER_ID=:loanOfficerId
+				and COLL_SHEET.COLL_SHEET_DATE>:fromDate
+				order by COLL_SHEET.COLL_SHEET_DATE desc
+		]]>
+	</sql-query>
+	<!--DATE_FORMAT(COLL_SHEET.COLL_SHEET_DATE, '%d/%m/%Y') as {dateItem.displayDate-->
+</hibernate-mapping>
Index: src/org/mifos/application/reports/ui/SelectionItem.hbm.xml
===================================================================
--- src/org/mifos/application/reports/ui/SelectionItem.hbm.xml	(revision 0)
+++ src/org/mifos/application/reports/ui/SelectionItem.hbm.xml	(revision 0)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping>
+	<class name="org.mifos.application.reports.ui.SelectionItem">
+		<composite-id>
+		<key-property name="id" type="short" access="field" />
+		<key-property name="displayName" type="string" access="field" />
+		</composite-id>
+	</class>
+	<sql-query name="SelectionItem.get_active_offices">
+		<return alias="branchOffice"
+			class="org.mifos.application.reports.ui.SelectionItem" />
+		<![CDATA[
+			SELECT OFFICE_ID as {branchOffice.id}, DISPLAY_NAME as {branchOffice.displayName} from office 
+				where SEARCH_ID like :officeSearchId and
+				OFFICE_LEVEL_ID=:officeLevelId and STATUS_ID=:ACTIVE order by office.DISPLAY_NAME
+		]]>
+	</sql-query>
+	<sql-query
+		name="SelectionItem.get_active_loanofficers_under_office">
+		<return alias="loanOfficer"
+			class="org.mifos.application.reports.ui.SelectionItem" />
+		<![CDATA[SELECT PERSONNEL_ID as {loanOfficer.id}, DISPLAY_NAME as {loanOfficer.displayName} from PERSONNEL 
+	        	   	where PERSONNEL.LEVEL_ID=:personnelLevelId and 
+	    			PERSONNEL.OFFICE_ID=:officeId and PERSONNEL.PERSONNEL_STATUS=:ACTIVE
+	         		order by PERSONNEL.DISPLAY_NAME]]>
+	</sql-query>
+	<sql-query
+		name="SelectionItem.get_active_customers_under_loanofficers">
+		<return alias="center"
+			class="org.mifos.application.reports.ui.SelectionItem" />
+		<![CDATA[SELECT CUSTOMER_ID as {center.id}, DISPLAY_NAME as {center.displayName} from CUSTOMER 
+  	   				where CUSTOMER.LOAN_OFFICER_ID=:personnelId and 
+  	   				CUSTOMER.BRANCH_ID=:officeId and 
+  	   				CUSTOMER.CUSTOMER_LEVEL_ID=:customerLevelId 
+  	   				and CUSTOMER.STATUS_ID=:ACTIVE
+		]]>
+	</sql-query>
+</hibernate-mapping>
Index: src/org/mifos/application/customer/center/business/CenterBO.java
===================================================================
--- src/org/mifos/application/customer/center/business/CenterBO.java	(revision 12247)
+++ src/org/mifos/application/customer/center/business/CenterBO.java	(working copy)
@@ -10,6 +10,7 @@
 import org.mifos.application.configuration.exceptions.ConfigurationException;
 import org.mifos.application.configuration.util.helpers.ConfigurationConstants;
 import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.business.CustomerLevelEntity;
 import org.mifos.application.customer.business.CustomerPerformanceHistory;
 import org.mifos.application.customer.business.CustomerPositionView;
 import org.mifos.application.customer.center.persistence.CenterPersistence;
@@ -23,6 +24,7 @@
 import org.mifos.application.fees.business.FeeView;
 import org.mifos.application.master.business.CustomFieldView;
 import org.mifos.application.meeting.business.MeetingBO;
+import org.mifos.application.personnel.business.PersonnelBO;
 import org.mifos.framework.business.util.Address;
 import org.mifos.framework.components.logger.LoggerConstants;
 import org.mifos.framework.components.logger.MifosLogManager;
@@ -33,7 +35,6 @@
 public class CenterBO extends CustomerBO {
 
 	private MifosLogger logger = MifosLogManager.getLogger(LoggerConstants.CENTERLOGGER);
-	
 	public CenterBO(UserContext userContext, String displayName,
 			Address address, List<CustomFieldView> customFields,
 			List<FeeView> fees, String externalId, Date mfiJoiningDate,
@@ -59,6 +60,10 @@
 		super();
 	}
 	
+	public CenterBO(Integer customerId, CustomerLevelEntity customerLevel, PersonnelBO formedByPersonnel, PersonnelBO personnel, String displayName) {
+		super(customerId, customerLevel, formedByPersonnel, personnel, displayName);
+	}
+	
 	@Override
 	public boolean isActive() {
 		return getStatus() == CustomerStatus.CENTER_ACTIVE;
Index: src/org/mifos/application/customer/business/CustomerBO.java
===================================================================
--- src/org/mifos/application/customer/business/CustomerBO.java	(revision 12247)
+++ src/org/mifos/application/customer/business/CustomerBO.java	(working copy)
@@ -152,13 +152,21 @@
 	private Set<CustomerBO> children;
 
 	protected CustomerBO() {
-		super();
-		this.customerId = null;
+		this(null, null, null, null, null);
 		this.globalCustNum = null;
-		this.customerLevel = null;
-		this.formedByPersonnel = null;
 	}
 
+	
+	public CustomerBO(Integer customerId, CustomerLevelEntity customerLevel, PersonnelBO formedByPersonnel, PersonnelBO personnel, String displayName) {
+		super();
+		this.customerId = customerId;
+		this.customerLevel = customerLevel;
+		this.formedByPersonnel = formedByPersonnel;
+		this.personnel = personnel;
+		this.displayName = displayName;
+	}
+
+
 	protected CustomerBO(UserContext userContext, String displayName,
 			CustomerLevel customerLevel, CustomerStatus customerStatus,
 			String externalId, Date mfiJoiningDate, Address address,
Index: src/org/mifos/application/customer/group/business/GroupBO.java
===================================================================
--- src/org/mifos/application/customer/group/business/GroupBO.java	(revision 12247)
+++ src/org/mifos/application/customer/group/business/GroupBO.java	(working copy)
@@ -47,6 +47,7 @@
 import org.mifos.application.configuration.util.helpers.ConfigurationConstants;
 import org.mifos.application.customer.business.CustomerBO;
 import org.mifos.application.customer.business.CustomerHierarchyEntity;
+import org.mifos.application.customer.business.CustomerLevelEntity;
 import org.mifos.application.customer.business.CustomerPositionView;
 import org.mifos.application.customer.business.CustomerStatusEntity;
 import org.mifos.application.customer.center.business.CenterBO;
@@ -64,10 +65,10 @@
 import org.mifos.application.meeting.business.MeetingBO;
 import org.mifos.application.office.business.OfficeBO;
 import org.mifos.application.office.persistence.OfficePersistence;
+import org.mifos.application.personnel.business.PersonnelBO;
 import org.mifos.application.util.helpers.YesNoFlag;
 import org.mifos.config.ClientRules;
 import org.mifos.framework.business.util.Address;
-import org.mifos.framework.components.configuration.business.Configuration;
 import org.mifos.framework.components.logger.LoggerConstants;
 import org.mifos.framework.components.logger.MifosLogManager;
 import org.mifos.framework.components.logger.MifosLogger;
@@ -131,6 +132,10 @@
 				officeId, parentCustomer, meeting, loanOfficerId);
 		validateFields(displayName, formedById, trained, trainedDate);
 	}
+	
+	public GroupBO(int customerId, CustomerLevelEntity customerLevel, PersonnelBO formedByPersonnel, PersonnelBO personnel, String displayName) {
+		super(customerId, customerLevel, formedByPersonnel, personnel, displayName);
+	}	
 
 	@Override
 	public boolean isActive() {
Index: src/org/mifos/application/personnel/business/PersonnelBO.java
===================================================================
--- src/org/mifos/application/personnel/business/PersonnelBO.java	(revision 12247)
+++ src/org/mifos/application/personnel/business/PersonnelBO.java	(working copy)
@@ -1,5 +1,7 @@
 package org.mifos.application.personnel.business;
 
+import static org.mifos.application.reports.util.helpers.ReportsConstants.*;
+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
@@ -20,6 +22,7 @@
 import org.mifos.application.personnel.util.helpers.PersonnelConstants;
 import org.mifos.application.personnel.util.helpers.PersonnelLevel;
 import org.mifos.application.personnel.util.helpers.PersonnelStatus;
+import org.mifos.application.reports.util.helpers.ReportsConstants;
 import org.mifos.application.rolesandpermission.business.RoleBO;
 import org.mifos.config.Localization;
 import org.mifos.framework.business.BusinessObject;
@@ -85,7 +88,7 @@
 	private Set<PersonnelNotesEntity> personnelNotes;
 
 	private MifosLogger logger = MifosLogManager.getLogger(LoggerConstants.PERSONNEL_LOGGER);
-	
+
 	public static PersonnelBO ALL_PERSONNEL = new PersonnelBO();
 	static {
 		ALL_PERSONNEL.setDisplayName("ALL");
@@ -139,15 +142,20 @@
 	}
 
 	PersonnelBO() {
-		this.level = null;
+		this(null, null, null, null);
 		this.personnelDetails = new PersonnelDetailsEntity();
 		this.preferredLocale = new SupportedLocalesEntity();
 		this.customFields = new HashSet<PersonnelCustomFieldEntity>();
 		this.personnelNotes = new HashSet<PersonnelNotesEntity>();
-		this.personnelId = null;
-		this.userName = null;
 	}
 
+	public PersonnelBO(Short personnelId, String userName, String displayName, PersonnelLevelEntity level) {
+		this.personnelId = personnelId;
+		this.userName = userName;
+		this.displayName = displayName;
+		this.level = level;
+	}
+
 	public String getAge() {
 		if (this.personnelDetails != null
 				&& this.personnelDetails.getDob() != null
Index: src/org/mifos/application/personnel/business/PersonnelLevelEntity.java
===================================================================
--- src/org/mifos/application/personnel/business/PersonnelLevelEntity.java	(revision 12247)
+++ src/org/mifos/application/personnel/business/PersonnelLevelEntity.java	(working copy)
@@ -12,6 +12,9 @@
 
 	private final PersonnelLevelEntity parent;
 
+	public static final PersonnelLevelEntity NON_LOAN_OFFICER_LEVEL_ENTITY = new PersonnelLevelEntity(
+			PersonnelLevel.NON_LOAN_OFFICER);
+
 	public PersonnelLevelEntity(PersonnelLevel level) {
 		super(level.getValue());
 		this.parent = null;
@@ -31,8 +34,8 @@
 		return parent;
 	}
 
-    @Override
+	@Override
 	public String toString() {
-        return PersonnelLevel.fromInt(getId()).toString();
-    }
+		return PersonnelLevel.fromInt(getId()).toString();
+	}
 }
Index: src/org/mifos/config/applicationContext.xml
===================================================================
--- src/org/mifos/config/applicationContext.xml	(revision 12247)
+++ src/org/mifos/config/applicationContext.xml	(working copy)
@@ -3,7 +3,6 @@
 	xmlns="http://www.springframework.org/schema/beans"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
-
     <!-- This MessageSource will load localized text from external
          resource bundle files  -->
     <bean id="messageSource"
@@ -13,6 +12,7 @@
         <property name="basenames">
             <list>
                 <value>org/mifos/config/resources/enumerations</value>
+                <value>org/mifos/config/resources/reporterrors</value>
             </list>
         </property>
     </bean>
@@ -76,5 +76,4 @@
             </map>
         </property>
     </bean>
-    
-</beans>
\ No newline at end of file
+</beans>
Index: src/org/mifos/config/resources/reporterrors.properties
===================================================================
--- src/org/mifos/config/resources/reporterrors.properties	(revision 0)
+++ src/org/mifos/config/resources/reporterrors.properties	(revision 0)
@@ -0,0 +1,5 @@
+branchId.invalid = Select a valid Branch
+centerId.invalid = Select a valid Center
+loanOfficerId.invalid = Select a valid Loan Officer
+meetingDate.invalid = Select a valid Meeting Date
+loanProductId.invalid = Select a valid Loan Product
Index: src/org/mifos/config/reportServices.xml
===================================================================
--- src/org/mifos/config/reportServices.xml	(revision 0)
+++ src/org/mifos/config/reportServices.xml	(revision 0)
@@ -0,0 +1,91 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
+	http://www.springmodules.org/schema/ehcache http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">
+	<bean id="cacheManager"
+		class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
+
+	<bean id="cacheFactory"
+		class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+		<property name="cacheManager">
+			<ref bean="cacheManager" />
+		</property>
+		<property name="cacheName"
+			value="org.mifos.application.reports.business.service.cache" />
+	</bean>
+
+	<bean id="collectionSheetService"
+		class="org.mifos.application.reports.business.service.CollectionSheetService" />
+	<bean id="officeBusinessService"
+		class="org.mifos.application.office.business.service.OfficeBusinessService" />
+	<bean id="personnelBusinessService"
+		class="org.mifos.application.personnel.business.service.PersonnelBusinessService" />
+	<bean id="customerBusinessService"
+		class="org.mifos.application.customer.business.service.CustomerBusinessService" />
+	<bean id="accountBusinessService"
+		class="org.mifos.application.accounts.business.service.AccountBusinessService" />
+	<bean id="loanPrdBusinessService"
+		class="org.mifos.application.productdefinition.business.service.LoanPrdBusinessService" />
+	<bean id="savingsPrdBusinessService"
+		class="org.mifos.application.productdefinition.business.service.SavingsPrdBusinessService" />
+	<bean id="reportProductOfferingService"
+		class="org.mifos.application.reports.business.service.ReportProductOfferingService" />
+
+	<bean id="selectionItemPersistence"
+		class="org.mifos.application.reports.persistence.SelectionItemPersistence" />
+	<bean id="dateSelectionItemPersistence"
+		class="org.mifos.application.reports.persistence.DateSelectionItemPersistence" />
+
+	<ehcache:config failQuietly="false" />
+	<bean id="reportParameterService"
+		class="org.mifos.application.reports.business.service.ReportsParameterService">
+		<constructor-arg ref="selectionItemPersistence" />
+		<constructor-arg ref="dateSelectionItemPersistence" />
+	</bean>
+	<ehcache:proxy id="reportParameterServiceProxy"
+		refId="reportParameterService">
+		<ehcache:caching methodName="getActiveBranchesUnderUser"
+			cacheName="org.mifos.application.reports.business.service.cache" />
+		<ehcache:caching methodName="getActiveLoanOfficersUnderOffice"
+			cacheName="org.mifos.application.reports.business.service.cache" />
+		<ehcache:caching methodName="getActiveCentersUnderUser"
+			cacheName="org.mifos.application.reports.business.service.cache" />
+		<ehcache:caching methodName="getActiveGroupsUnderUser"
+			cacheName="org.mifos.application.reports.business.service.cache" />
+		<ehcache:caching methodName="getMeetingDates"
+			cacheName="org.mifos.application.reports.business.service.cache" />
+	</ehcache:proxy>
+	<bean id="defaultCollectionSheetReportService"
+		class="org.mifos.application.reports.business.service.CollectionSheetReportService">
+		<constructor-arg ref="collectionSheetService" />
+		<constructor-arg ref="officeBusinessService" />
+		<constructor-arg ref="personnelBusinessService" />
+		<constructor-arg ref="customerBusinessService" />
+		<constructor-arg ref="accountBusinessService" />
+		<constructor-arg ref="loanPrdBusinessService" />
+		<constructor-arg ref="savingsPrdBusinessService" />
+		<constructor-arg ref="reportProductOfferingService" />
+		<!--<constructor-arg ref="reportParameterServiceProxy" />-->
+		<constructor-arg>
+			<bean factory-method="decorate"
+				class="org.mifos.framework.business.service.ServiceDecoratorFactory">
+				<constructor-arg
+					type="org.mifos.application.reports.business.service.IReportsParameterService"
+					ref="reportParameterServiceProxy" />
+			</bean>
+		</constructor-arg>
+	</bean>
+	<bean id="collectionSheetReportService" factory-method="decorate"
+		class="org.mifos.framework.business.service.ServiceDecoratorFactory">
+		<constructor-arg
+			type="org.mifos.application.reports.business.service.ICollectionSheetReportService"
+			ref="defaultCollectionSheetReportService" />
+		<constructor-arg>
+			<bean
+				class="org.mifos.framework.components.logger.ServiceLogger">
+				<constructor-arg value="CollectionSheetReportService" />
+			</bean>
+		</constructor-arg>
+	</bean>
+</beans>
Index: src/org/mifos/doc-root/application/reports/jsp/birtReport.jsp
===================================================================
--- src/org/mifos/doc-root/application/reports/jsp/birtReport.jsp	(revision 12247)
+++ src/org/mifos/doc-root/application/reports/jsp/birtReport.jsp	(working copy)
@@ -5,6 +5,6 @@
 
 <tiles:insert definition=".reportRender">
 <tiles:put name="body" type="string">
-    <iframe style="border:none; padding:0px;" width="1024px" height="100%" frameborder=0 src="<c:url value='/run' />?__report=report/<c:out value='${reportFile}' />&reportName=<c:out value='${reportName}' />&userId=<c:out value='${sessionScope.UserContext.id}'/>&__format=pdf"></iframe>
+	<iframe style="border:none; padding:0px;" width="1024px" height="100%" frameborder=0 src="<c:url value='/birtReports' />?__report=report/<c:out value='${reportFile}' />&reportName=<c:out value='${reportName}' />&userId=<c:out value='${sessionScope.UserContext.id}'/>&__format=pdf"></iframe>
 </tiles:put>
 </tiles:insert>
Index: src/org/mifos/framework/persistence/DatabaseVersionPersistence.java
===================================================================
--- src/org/mifos/framework/persistence/DatabaseVersionPersistence.java	(revision 12247)
+++ src/org/mifos/framework/persistence/DatabaseVersionPersistence.java	(working copy)
@@ -16,7 +16,7 @@
 import org.mifos.application.accounts.util.helpers.AccountActionTypes;
 import org.mifos.application.accounts.util.helpers.AccountStateFlag;
 import org.mifos.application.holiday.persistence.Upgrade104;
-import org.mifos.application.master.persistence.Upgrade167;
+//import org.mifos.application.master.persistence.Upgrade167;
 import org.mifos.application.master.persistence.Upgrade169;
 import org.mifos.application.productsmix.persistence.Upgrade127;
 import org.mifos.application.reports.business.ReportsCategoryBO;
@@ -67,7 +67,7 @@
 		register144(register);
 		register145(register);
 		register146(register);
-		register(register, new Upgrade167());
+//		register(register, new Upgrade167());
 		register(register, new Upgrade169());
 		return Collections.unmodifiableMap(register);
 	}
Index: src/org/mifos/framework/servlet/ModifiableParameterServletRequest.java
===================================================================
--- src/org/mifos/framework/servlet/ModifiableParameterServletRequest.java	(revision 0)
+++ src/org/mifos/framework/servlet/ModifiableParameterServletRequest.java	(revision 0)
@@ -0,0 +1,68 @@
+package org.mifos.framework.servlet;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+
+import org.apache.commons.collections.iterators.IteratorEnumeration;
+@SuppressWarnings("deprecation")
+public class ModifiableParameterServletRequest extends
+		HttpServletRequestWrapper {
+	List<String> removedParameterList;
+
+	public ModifiableParameterServletRequest(HttpServletRequest originalRequest) {
+		super(originalRequest);
+		removedParameterList = new ArrayList<String>();
+	}
+
+	public void removeParameter(String string) {
+		removedParameterList.add(string);
+	}
+
+	@Override
+	public String getParameter(String arg0) {
+		if (removedParameterList.contains(arg0))
+			return null;
+		return getRequest().getParameter(arg0);
+	}
+
+	@Override
+	public Map getParameterMap() {
+		Map parameterMap = updatedParameterList();
+		return parameterMap;
+	}
+
+	private Map<String, String> updatedParameterList() {
+		Map<String, String> parameterMap = new HashMap<String, String>(
+				getRequest().getParameterMap());
+		for (String removeParameterName : removedParameterList) {
+			parameterMap.remove(removeParameterName);
+		}
+		return parameterMap;
+	}
+
+	@Override
+	public Enumeration getParameterNames() {
+		Enumeration parameterNames = getRequest().getParameterNames();
+		List paramNames = new ArrayList();
+		while (parameterNames.hasMoreElements()) {
+			Object nextElement = parameterNames.nextElement();
+			if (!removedParameterList.contains(nextElement)) {
+				paramNames.add(nextElement);
+			}
+		}
+		return new IteratorEnumeration(paramNames.iterator());
+	}
+
+	@Override
+	public String[] getParameterValues(String arg0) {
+		if (removedParameterList.contains(arg0))
+			return null;
+		return getRequest().getParameterValues(arg0);
+	}
+}
Index: src/org/mifos/framework/components/logger/ServiceLogger.java
===================================================================
--- src/org/mifos/framework/components/logger/ServiceLogger.java	(revision 0)
+++ src/org/mifos/framework/components/logger/ServiceLogger.java	(revision 0)
@@ -0,0 +1,56 @@
+package org.mifos.framework.components.logger;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Date;
+
+public class ServiceLogger {
+
+	public static final ServiceLogger MUTED_LOGGER = new ServiceLogger() {
+		@Override
+		public void endOfServiceCall(Method method, Object[] args) {}
+
+		@Override
+		public void startOfServiceCall(Method method, Object[] args) {}
+	};
+	
+	public static final ServiceLogger ARGS_LOGGER = new ServiceLogger() {
+		@Override
+		public void endOfServiceCall(Method method, Object[] args) {}
+
+		@Override
+		public void startOfServiceCall(Method method, Object[] args) {
+			logger.error(method.getName()+":"+Arrays.toString(args));
+			for (Object arg : args) {
+				if (arg instanceof Date) {
+					logger.error("Date"+((Date)arg).getTime());
+				}
+			}
+		}
+	};
+	
+	protected final String serviceName;
+	protected MifosLogger logger;
+	private long startTime;
+
+	public ServiceLogger() {
+		this(null);
+	}
+
+	public ServiceLogger(String serviceName) {
+		this.serviceName = serviceName;
+		logger = MifosLogManager.getLogger(LoggerConstants.FRAMEWORKLOGGER);
+	}
+
+	public void startOfServiceCall(Method method, Object[] args) {
+		logger.info("Calling Service  : " + serviceName + " "
+				+ method.getName());
+		startTime = System.currentTimeMillis();
+	}
+
+	public void endOfServiceCall(Method method, Object[] args) {
+		logger.info("Finished Service : "
+				+ (System.currentTimeMillis() - startTime) + " " + serviceName
+				+ " " + method.getName());
+	}
+}
Index: src/org/mifos/framework/business/service/ServiceProxy.java
===================================================================
--- src/org/mifos/framework/business/service/ServiceProxy.java	(revision 0)
+++ src/org/mifos/framework/business/service/ServiceProxy.java	(revision 0)
@@ -0,0 +1,36 @@
+package org.mifos.framework.business.service;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.mifos.framework.components.logger.ServiceLogger;
+
+public class ServiceProxy implements InvocationHandler {
+	private Object service;
+	private final ServiceLogger logger;
+
+	ServiceProxy(Object service, ServiceLogger logger) {
+		this.service = service;
+		this.logger = logger;
+	}
+
+	public Object invoke(Object proxy, Method method, Object[] args) {
+		Object result = null;
+		try {
+			logger.startOfServiceCall(method, args);
+			result = method.invoke(service, args);
+			logger.endOfServiceCall(method, args);
+		}
+		catch (InvocationTargetException e) {
+			throw new RuntimeException(e);
+		}
+		catch (IllegalArgumentException e) {
+			throw new RuntimeException(e);
+		}
+		catch (IllegalAccessException e) {
+			throw new RuntimeException(e);
+		}
+		return result;
+	}
+}
Index: src/org/mifos/framework/business/service/ServiceDecoratorFactory.java
===================================================================
--- src/org/mifos/framework/business/service/ServiceDecoratorFactory.java	(revision 0)
+++ src/org/mifos/framework/business/service/ServiceDecoratorFactory.java	(revision 0)
@@ -0,0 +1,32 @@
+package org.mifos.framework.business.service;
+
+import java.lang.reflect.Proxy;
+
+import org.mifos.application.reports.business.service.ICollectionSheetReportService;
+import org.mifos.application.reports.business.service.IReportsParameterService;
+import org.mifos.framework.components.logger.ServiceLogger;
+
+public class ServiceDecoratorFactory {
+	private static Object newInstance(Object obj, ServiceLogger logger) {
+		return Proxy.newProxyInstance(obj.getClass().getClassLoader(), obj
+				.getClass().getInterfaces(), new ServiceProxy(obj
+				, logger));
+	}
+
+	public static ICollectionSheetReportService decorate(
+			ICollectionSheetReportService service, ServiceLogger logger) {
+		return (ICollectionSheetReportService) newInstance(service, logger);
+	}
+
+	public static IReportsParameterService decorate(
+			IReportsParameterService service) {
+		return (IReportsParameterService) newInstance(service, ServiceLogger.MUTED_LOGGER);
+	}
+	
+	//  this generic implementation is not working with spring container, not sure why, but would love to have 
+	//	this in place instead of the above specific method	
+	//	public static<T> T getLoggerWrappedService(
+	//			T service) {
+	//		return (T) newInstance(service);
+	//	}
+}
Index: src/org/mifos/framework/util/helpers/MoneyUtils.java
===================================================================
--- src/org/mifos/framework/util/helpers/MoneyUtils.java	(revision 0)
+++ src/org/mifos/framework/util/helpers/MoneyUtils.java	(revision 0)
@@ -0,0 +1,17 @@
+package org.mifos.framework.util.helpers;
+
+public class MoneyUtils {
+
+	public static Money add(Money firstAmount, Money secondAmount) {
+		Money sum = firstAmount == null ? secondAmount : firstAmount
+				.add(secondAmount);
+		return sum;
+	}
+
+	public static Double getMoneyDoubleValue(Money money) {
+		return money == null ? null : money.getAmountDoubleValue();
+	}
+
+	public static final Money ZERO = new Money("0.00");
+
+}
Index: src/org/mifos/framework/util/helpers/Predicate.java
===================================================================
--- src/org/mifos/framework/util/helpers/Predicate.java	(revision 0)
+++ src/org/mifos/framework/util/helpers/Predicate.java	(revision 0)
@@ -0,0 +1,5 @@
+package org.mifos.framework.util.helpers;
+
+public interface Predicate<T> {
+	public boolean evaluate(T object) throws Exception;
+}
Index: src/org/mifos/framework/util/helpers/ServletUtils.java
===================================================================
--- src/org/mifos/framework/util/helpers/ServletUtils.java	(revision 0)
+++ src/org/mifos/framework/util/helpers/ServletUtils.java	(revision 0)
@@ -0,0 +1,14 @@
+package org.mifos.framework.util.helpers;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class ServletUtils {
+
+	public static String getParameter(HttpServletRequest request,
+			String paramName) {
+		String parameter = request.getParameter(paramName);
+		return parameter != null ? parameter : request.getAttribute(parameter)
+				.toString();
+	}
+
+}
Index: src/org/mifos/framework/util/helpers/NumberUtils.java
===================================================================
--- src/org/mifos/framework/util/helpers/NumberUtils.java	(revision 0)
+++ src/org/mifos/framework/util/helpers/NumberUtils.java	(revision 0)
@@ -0,0 +1,26 @@
+package org.mifos.framework.util.helpers;
+
+public class NumberUtils {
+
+	public static Short convertIntegerToShort(Integer intValue) {
+		if (intValue == null) {
+			return null;
+		}
+		return new Short(intValue.shortValue());
+	}
+
+	public static Integer convertShortToInteger(Short shortValue) {
+		if (shortValue == null) {
+			return null;
+		}
+		return new Integer(shortValue.intValue());
+	}
+
+	public static boolean isDigits(String number) {
+		if (number == null)
+			return false;
+		if (number.startsWith("-"))
+			number = number.substring(1);
+		return org.apache.commons.lang.math.NumberUtils.isDigits(number);
+	}
+}
Index: src/org/mifos/framework/util/helpers/FilePaths.java
===================================================================
--- src/org/mifos/framework/util/helpers/FilePaths.java	(revision 12247)
+++ src/org/mifos/framework/util/helpers/FilePaths.java	(working copy)
@@ -64,4 +64,6 @@
 		"org/mifos/framework/util/resources/customTableTag/tabletag.xsd";	
 	public static final String CONFIGURABLEMIFOSDBPROPERTIESFILE = 
 		"deploymifosDB.properties";
+	public static final String REPORT_PRODUCT_OFFERING_CONFIG = "/org/mifos/application/reports/resources/reportproducts.properties";
+	public static final String REPORT_SERVICE_BEAN_FILE = "/org/mifos/config/reportServices.xml";
 }
Index: src/org/mifos/framework/util/helpers/DateUtils.java
===================================================================
--- src/org/mifos/framework/util/helpers/DateUtils.java	(revision 12247)
+++ src/org/mifos/framework/util/helpers/DateUtils.java	(working copy)
@@ -57,13 +57,17 @@
 
 
 public class DateUtils {
-	
+
 	// three different types of date direction validation
-	public enum DIRECTION {FUTURE, PAST, NONE}
+	public enum DIRECTION {
+		FUTURE, PAST, NONE
+	}
 
 	private final static String dbFormat = "yyyy-MM-dd";
-	private final static Locale internalLocale = Localization.getInstance().getMainLocale(); 
-	private static String dateSeparator = LocalizationConverter.getInstance().getDateSeparatorForCurrentLocale();
+	private final static Locale internalLocale = Localization.getInstance()
+			.getMainLocale();
+	private static String dateSeparator = LocalizationConverter.getInstance()
+			.getDateSeparatorForCurrentLocale();
 
 	public static String convertUserToDbFmt(String userDate, String userPattern) {
 		try {
@@ -76,9 +80,8 @@
 			throw new InvalidDateException(userDate);
 		}
 	}
-	
-	public static String getDateSeparator()
-	{
+
+	public static String getDateSeparator() {
 		return dateSeparator;
 	}
 
@@ -89,15 +92,15 @@
 			SimpleDateFormat userFormat = new SimpleDateFormat(userPattern);
 			return userFormat.format(date);
 		}
-		
+
 		catch (ParseException e) {
 			throw new InvalidDateException(dbDate);
 		}
 	}
-	
+
 	public static String getUserLocaleDate(Locale locale, Date databaseDate) {
 		SimpleDateFormat shortFormat = (SimpleDateFormat) DateFormat
-			.getDateInstance(DateFormat.SHORT, locale);
+				.getDateInstance(DateFormat.SHORT, locale);
 		return shortFormat.format(databaseDate);
 	}
 
@@ -114,8 +117,8 @@
 				throw e;
 			}
 			catch (Exception e) {
-				System.out.println("databaseDate=" + databaseDate
-						+ ", locale=" + locale);
+				System.out.println("databaseDate=" + databaseDate + ", locale="
+						+ locale);
 				throw new FrameworkRuntimeException(e);
 			}
 		}
@@ -123,9 +126,10 @@
 			return "";
 		}
 	}
-	
+
 	public static String getUserLocaleDate(String databaseDate) {
-		if (internalLocale != null && databaseDate != null && !databaseDate.equals("")) {
+		if (internalLocale != null && databaseDate != null
+				&& !databaseDate.equals("")) {
 			try {
 				SimpleDateFormat shortFormat = (SimpleDateFormat) DateFormat
 						.getDateInstance(DateFormat.SHORT, internalLocale);
@@ -137,8 +141,8 @@
 				throw e;
 			}
 			catch (Exception e) {
-				System.out.println("databaseDate=" + databaseDate
-						+ ", locale=" + internalLocale);
+				System.out.println("databaseDate=" + databaseDate + ", locale="
+						+ internalLocale);
 				throw new FrameworkRuntimeException(e);
 			}
 		}
@@ -146,13 +150,14 @@
 			return "";
 		}
 	}
-	
 
+
 	public static java.util.Date getDate(String value) {
 		if (value != null && !value.equals("")) {
 			try {
-				
-				String formatStr = "dd" + dateSeparator + "MM" + dateSeparator + "yyyy";
+
+				String formatStr = "dd" + dateSeparator + "MM" + dateSeparator
+						+ "yyyy";
 				SimpleDateFormat format = new SimpleDateFormat(formatStr);
 				// Enable this once we've taken a bit more of a look
 				// at where this gets called, run the tests, etc.
@@ -169,7 +174,7 @@
 			return null;
 		}
 	}
-	
+
 	/**
 	 * Converts a string of a date in DB format ("yyyy-MM-dd") to a
 	 * {@link java.util.Date} object.
@@ -184,12 +189,12 @@
 				return format.parse(date);
 			}
 			catch (ParseException e) {
-			throw new RuntimeException(e);
+				throw new RuntimeException(e);
 			}
-		} else
-			return null;
+		}
+		else return null;
 	}
-	
+
 	public static String getCurrentDate() {
 		Calendar currentCalendar = new GregorianCalendar();
 		int year = currentCalendar.get(Calendar.YEAR);
@@ -254,8 +259,9 @@
 		String month = "";
 		String year = "";
 		String token;
-		String separator = LocalizationConverter.getInstance().getDateSeparatorForCurrentLocale();
-		
+		String separator = LocalizationConverter.getInstance()
+				.getDateSeparatorForCurrentLocale();
+
 		MFIfmt = convertToDateTagFormat(MFIfmt);
 		StringTokenizer stfmt = new StringTokenizer(format, separator);
 		StringTokenizer stdt = new StringTokenizer(date, separator);
@@ -276,15 +282,19 @@
 	}
 
 	// parse new-style browser date format... separate m,d,y fields, no js assembling
-	public static java.sql.Date parseBrowserDateFields(HttpServletRequest request, String property) throws InvalidDateException {
+	public static java.sql.Date parseBrowserDateFields(
+			HttpServletRequest request, String property)
+			throws InvalidDateException {
 		String yearStr = request.getParameter(property + "YY");
 		String monthStr = request.getParameter(property + "MM");
 		String dayStr = request.getParameter(property + "DD");
 		return parseBrowserDateFields(yearStr, monthStr, dayStr);
 	}
-	
-	public static java.sql.Date parseBrowserDateFields(String yearStr, String monthStr, String dayStr) {
-		return getDateAsSentFromBrowser(dayStr + dateSeparator + monthStr + dateSeparator + yearStr);
+
+	public static java.sql.Date parseBrowserDateFields(String yearStr,
+			String monthStr, String dayStr) {
+		return getDateAsSentFromBrowser(dayStr + dateSeparator + monthStr
+				+ dateSeparator + yearStr);
 	}
 
 	/**
@@ -298,12 +308,13 @@
 		}
 		try {
 			String formatStr = "d" + dateSeparator + "M" + dateSeparator + "yy";
-			SimpleDateFormat format = new SimpleDateFormat(formatStr, internalLocale);
-			
+			SimpleDateFormat format = new SimpleDateFormat(formatStr,
+					internalLocale);
+
 			format.setLenient(false);
 			return new java.sql.Date(format.parse(value).getTime());
 		}
-		
+
 		catch (ParseException e) {
 			throw new InvalidDateException(value);
 		}
@@ -314,7 +325,7 @@
 	public static boolean isValidDate(String value) {
 		try {
 			SimpleDateFormat shortFormat = (SimpleDateFormat) DateFormat
-					.getDateInstance(DateFormat.SHORT, internalLocale); 
+					.getDateInstance(DateFormat.SHORT, internalLocale);
 			shortFormat.setLenient(false);
 			shortFormat.parse(value);
 			return true;
@@ -324,7 +335,7 @@
 			return false;
 		}
 	}
-	
+
 	public static java.sql.Date getLocaleDate(String value) {
 		if (internalLocale != null && value != null && !value.equals("")) {
 			try {
@@ -372,20 +383,20 @@
 	public static String getMFIFormat() {
 		// TODO change this to pick from app config
 		String formatStr = "dd" + dateSeparator + "mm" + dateSeparator + "yy";
-		
+
 		return formatStr;
 	}
 
 	public static String getMFIShortFormat() {
 		String formatStr = "dd" + dateSeparator + "mm" + dateSeparator + "yy";
-		
+
 		return formatStr;
 	}
 
 	public static String convertToDateTagFormat(String pattern) {
 		char chArray[] = pattern.toCharArray();
 		String separator = dateSeparator;
-		
+
 		StringBuilder fmt = new StringBuilder();
 		boolean d = false;
 		boolean m = false;
@@ -423,7 +434,7 @@
 	public static String createDateString(String day, String month,
 			String year, String format) {
 		String separator = dateSeparator;
-		
+
 		StringTokenizer stfmt = new StringTokenizer(format, separator);
 		String token;
 		StringBuilder dt = new StringBuilder();
@@ -509,7 +520,7 @@
 		int result = date.compareTo(currentDate);
 		return result;
 	}
-	
+
 	public static String makeDateAsSentFromBrowser() {
 		Date date = new Date();
 		return makeDateAsSentFromBrowser(date);
@@ -517,12 +528,13 @@
 
 	public static String makeDateAsSentFromBrowser(Date date) {
 		String formatStr = "d" + dateSeparator + "M" + dateSeparator + "yyyy";
-		
+
 		SimpleDateFormat format = new SimpleDateFormat(formatStr,
 				internalLocale);
 		return format.format(date);
 	}
 
+
 	/**
 	 * Nothing to instantiate here.
 	 */
@@ -537,7 +549,7 @@
 		currentDateCalendar = new GregorianCalendar(year, month, day);
 		return new Date(currentDateCalendar.getTimeInMillis());
 	}
-	
+
 	public static Date getDateWithoutTimeStamp(long timeInMills) {
 		Calendar dateCalendar = new GregorianCalendar();
 		dateCalendar.setTimeInMillis(timeInMills);
@@ -547,67 +559,72 @@
 		dateCalendar = new GregorianCalendar(year, month, day);
 		return new Date(dateCalendar.getTimeInMillis());
 	}
-	
+
 	public static Calendar getCalendarDate(long timeInMills) {
 		Calendar dateCalendar = new GregorianCalendar();
 		dateCalendar.setTimeInMillis(timeInMills);
 		return dateCalendar;
 	}
 
-	public static Date getLastDayOfCurrentYear(){
+	public static Date getLastDayOfCurrentYear() {
 		Calendar cal = Calendar.getInstance();
-		cal.set(Calendar.MONTH,Calendar.DECEMBER);
+		cal.set(Calendar.MONTH, Calendar.DECEMBER);
 		cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
 		Calendar cal1 = Calendar.getInstance();
-		cal1.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DATE),0,0,0);
+		cal1.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal
+				.get(Calendar.DATE), 0, 0, 0);
 		return new Date(cal1.getTimeInMillis());
 	}
-	
-	public static Calendar getFistDayOfNextYear(Calendar cal){
-		cal.roll(Calendar.YEAR,1);
-		cal.set(Calendar.MONTH,Calendar.JANUARY);
+
+	public static Calendar getFistDayOfNextYear(Calendar cal) {
+		cal.roll(Calendar.YEAR, 1);
+		cal.set(Calendar.MONTH, Calendar.JANUARY);
 		cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DATE));
 		Calendar cal1 = Calendar.getInstance();
-		cal1.set(cal.get(Calendar.YEAR),cal.get(Calendar.MONTH),cal.get(Calendar.DATE),0,0,0);
+		cal1.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal
+				.get(Calendar.DATE), 0, 0, 0);
 		return cal1;
 	}
-	
-	public static Date getLastDayOfNextYear(){
+
+	public static Date getLastDayOfNextYear() {
 		Calendar cal = GregorianCalendar.getInstance();
-		cal.set(Calendar.MONTH,Calendar.DECEMBER);
+		cal.set(Calendar.MONTH, Calendar.DECEMBER);
 		cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
 		Calendar cal1 = Calendar.getInstance();
-		cal1.set(cal.get(Calendar.YEAR)+1,cal.get(Calendar.MONTH),cal.get(Calendar.DATE),0,0,0);
+		cal1.set(cal.get(Calendar.YEAR) + 1, cal.get(Calendar.MONTH), cal
+				.get(Calendar.DATE), 0, 0, 0);
 		return cal1.getTime();
 	}
-	
-	public static Calendar getLastDayOfYearAfterNextYear(){
+
+	public static Calendar getLastDayOfYearAfterNextYear() {
 		Calendar cal = GregorianCalendar.getInstance();
-		cal.set(Calendar.MONTH,Calendar.DECEMBER);
+		cal.set(Calendar.MONTH, Calendar.DECEMBER);
 		cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
 		Calendar cal1 = Calendar.getInstance();
-		cal1.set(cal.get(Calendar.YEAR)+2,cal.get(Calendar.MONTH),cal.get(Calendar.DATE),0,0,0);
+		cal1.set(cal.get(Calendar.YEAR) + 2, cal.get(Calendar.MONTH), cal
+				.get(Calendar.DATE), 0, 0, 0);
 		return cal1;
 	}
-	
-	public static Date getCurrentDateOfNextYearWithOutTimeStamp(){
+
+	public static Date getCurrentDateOfNextYearWithOutTimeStamp() {
 		Calendar currentDateCalendar = new GregorianCalendar();
 		int year = currentDateCalendar.get(Calendar.YEAR);
 		int month = currentDateCalendar.get(Calendar.MONTH);
 		int day = currentDateCalendar.get(Calendar.DAY_OF_MONTH);
-		currentDateCalendar = new GregorianCalendar(year+1, month, day);
+		currentDateCalendar = new GregorianCalendar(year + 1, month, day);
 		return new Date(currentDateCalendar.getTimeInMillis());
 	}
-	
-	public static Calendar getFistDayOfYearAfterNextYear(){
+
+	public static Calendar getFistDayOfYearAfterNextYear() {
 		Calendar cal = GregorianCalendar.getInstance();
-		cal.set(Calendar.MONTH,Calendar.JANUARY);
+		cal.set(Calendar.MONTH, Calendar.JANUARY);
 		cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DATE));
 		Calendar cal1 = Calendar.getInstance();
-		cal1.set(cal.get(Calendar.YEAR)+2,cal.get(Calendar.MONTH),cal.get(Calendar.DATE),0,0,0);
+		cal1.set(cal.get(Calendar.YEAR) + 2, cal.get(Calendar.MONTH), cal
+				.get(Calendar.DATE), 0, 0, 0);
 		return cal1;
 	}
-	
+
 	/**
 	 * Not sure why this is just copying over the year, month, and day.
 	 * Also see {@link #getCalendarDate(long)}.
@@ -621,7 +638,7 @@
 		dateCalendar = new GregorianCalendar(year, month, day);
 		return dateCalendar;
 	}
-	
+
 	public static long getNumberOfDaysBetweenTwoDates(Date date1, Date date2) {
 		Calendar cal1 = Calendar.getInstance();
 		Calendar cal2 = Calendar.getInstance();
@@ -640,7 +657,7 @@
 		return ((cal1.getTime().getTime() - cal2.getTime().getTime()) / (24 * 60 * 60 * 1000));
 
 	}
-	
+
 	public static Date getDatePlusXDays(Date date, int dayNombre) {
 		Date dateplus;
 		Calendar cal = Calendar.getInstance();
@@ -650,4 +667,42 @@
 		return dateplus;
 	}
 
+	public static java.sql.Date getSqlDate(int year, int month, int date) {
+		return convertToSqlDate(getCalendarAsOn(year, month, date));
+	}
+
+	public static Calendar getCalendarAsOn(int year, int month, int date) {
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(year, month, date, 0, 0, 0);
+		calendar.set(Calendar.MILLISECOND, 0);
+		return calendar;
+	}
+
+	public static Date getDate(int year, int month, int date) {
+		return getCalendarAsOn(year, month, date).getTime();
+	}
+
+	public static Date currentDate() {
+		return new Date(System.currentTimeMillis());
+	}
+
+	public static java.sql.Date currentDateAsSqlDate() {
+		return convertToSqlDate(currentDate());
+	}
+
+	private static java.sql.Date convertToSqlDate(Calendar calendar) {
+		return new java.sql.Date(calendar.getTimeInMillis());
+	}
+
+	public static java.sql.Date convertToSqlDate(Date date) {
+		return new java.sql.Date(date.getTime());
+	}
+
+	public static java.sql.Date sqlToday() {
+		Calendar calendar = Calendar.getInstance();
+		Calendar calendarAsOnToday = getCalendarAsOn(calendar
+				.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar
+				.get(Calendar.DATE));
+		return convertToSqlDate(calendarAsOnToday);
+	}
 }
Index: src/org/mifos/framework/util/resources/hibernate.cfg.xml
===================================================================
--- src/org/mifos/framework/util/resources/hibernate.cfg.xml	(revision 12247)
+++ src/org/mifos/framework/util/resources/hibernate.cfg.xml	(working copy)
@@ -133,6 +133,8 @@
 		<mapping resource="org/mifos/application/collectionsheet/business/CollSheetCustBO.hbm.xml" />
 		<mapping resource="org/mifos/application/collectionsheet/business/CollSheetLnDetailsEntity.hbm.xml" />
 		<mapping resource="org/mifos/application/collectionsheet/business/CollSheetSavingsDetailsEntity.hbm.xml" />
+		<mapping resource="org/mifos/application/reports/ui/SelectionItem.hbm.xml" />
+		<mapping resource="org/mifos/application/reports/ui/DateSelectionItem.hbm.xml" />
 		<!-- Mapping files for Master Data -->
 		<mapping resource="org/mifos/application/master/business/MifosCurrency.hbm.xml" />
 		<mapping resource="org/mifos/application/master/business/CountryEntity.hbm.xml" />
Index: src/org/mifos/framework/util/CollectionUtils.java
===================================================================
--- src/org/mifos/framework/util/CollectionUtils.java	(revision 0)
+++ src/org/mifos/framework/util/CollectionUtils.java	(revision 0)
@@ -0,0 +1,38 @@
+package org.mifos.framework.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.mifos.framework.util.helpers.Predicate;
+
+public class CollectionUtils {
+
+	// Same as commons-collections but with generics
+	public static <T> T find(Collection<T> collections, Predicate<T> predicate)
+			throws Exception {
+		if (collections != null && predicate != null) {
+			for (T item : collections) {
+				if (predicate.evaluate(item))
+					return item;
+			}
+		}
+		return null;
+	}
+
+	public static<T> List<T> asList(
+			T element) {
+		List<T> list = new ArrayList<T>();
+		list.add(element);
+		return list;
+	}
+
+	public static<T> Set<T> asSet(
+			T element) {
+		Set<T> collectionSheetsForMeetingDate = new HashSet<T>();
+		collectionSheetsForMeetingDate.add(element);
+		return collectionSheetsForMeetingDate;
+	}
+}
Index: build.xml
===================================================================
--- build.xml	(revision 12247)
+++ build.xml	(working copy)
@@ -32,6 +32,7 @@
 	<property name="src.dir" value="${basedir}/src"/>
 	<property name="birt.web.viewer.dir" value="${basedir}/BirtWebViewer"/>
 	<property name="birt.report.design.dir" value="${basedir}/BirtReportDesign"/>
+	<property name="birt.report.resource.dir" value="${basedir}/BirtReportResource"/>
 	<property name="test.dir" value="${basedir}/test"/>
 	<property name="sql.dir" value="${basedir}/sql"/>
 	<property name="build.dir" value="${basedir}/build"/>
@@ -257,6 +258,9 @@
 		<copy todir="${build.src.dir}/report">
 			<fileset dir="${birt.report.design.dir}" />
 		</copy>
+		<copy todir="${build.src.dir}/report/BirtReportResource">
+			<fileset dir="${birt.report.resource.dir}" />
+		</copy>
 	</target>
 
 	<target name="lib" depends="compile" description="Build the mifos library">
Index: .classpath
===================================================================
--- .classpath	(revision 12247)
+++ .classpath	(working copy)
@@ -48,5 +48,5 @@
 	<classpathentry kind="lib" path="lib/commons-lang-2.3.jar"/>
 	<classpathentry kind="lib" path="lib/commons-collections-3.2.jar"/>
 	<classpathentry kind="lib" path="lib/strutstest-2.1.4.jar"/>
-	<classpathentry kind="output" path="bin"/>
+	<classpathentry kind="output" path="classes"/>
 </classpath>
Index: BirtReportResource/GrameenKootaCollectionSheetReportResource.properties
===================================================================
--- BirtReportResource/GrameenKootaCollectionSheetReportResource.properties	(revision 0)
+++ BirtReportResource/GrameenKootaCollectionSheetReportResource.properties	(revision 0)
@@ -0,0 +1,46 @@
+#
+#Wed Dec 26 15:49:13 IST 2007
+collection.sheet.title=Collection Sheet Report
+collection.sheet.signature.center.leader=Center Leader
+collection.sheet.center.label=Center \:
+collection.sheet.table.issues=Issues
+collection.sheet.table.other.collection=Other Collection
+collection.sheet.summary.loans.issued=No. of Loans Issued
+collection.sheet.table.other.collection.fines=Fines
+collection.sheet.summary.disbursement.other=Other Disbursement
+collection.sheet.summary.collection=Collection
+collection.sheet.signature.cashier=Cashier
+collection.sheet.table.att=Att
+collection.sheet.summary.absent=Absent / Defaults
+collection.sheet.summary.collection.due=Due Collection
+collection.sheet.table.member.id=ID
+collection.sheet.report.parameter.meetingdate=Select Chaeting Date
+collection.sheet.summary.collection.total=Total Collection
+collection.sheet.summary.disbursement=Disbursement
+collection.sheet.table.issues.subheader=Loan Instance
+collection.sheet.signature.center.manager=Center Manager
+collection.sheet.table.due.savings=Savings Instance
+collection.sheet.report.parameter.center=Select Center
+collection.sheet.report.parameter.group=Select Group
+collection.sheet.report.parameter.branch=Select Branch
+collection.sheet.meetingdate.label=Meeting Date \:
+collection.sheet.signature.branch.manager=Branch Manager
+collection.sheet.local.title=Grameen Koota
+collection.sheet.table.balances.savings=Savings Instance
+collection.sheet.table.due.loan=Loan Instance
+collection.sheet.summary.disbursement.actual=Actual Disbursement
+collection.sheet.report.parameter.loanofficer=Select Loan Officer
+collection.sheet.summary.disbursement.due=Due Disbursement
+collection.sheet.table.other.collection.fees=Fees
+collection.sheet.loanofficer.label=Loan Officer \:
+collection.sheet.branch.label=Branch \:
+collection.sheet.summary.application.taken=Application Taken
+collection.sheet.table.due=Due
+collection.sheet.summary.disbursement.total=Total Disbursement
+collection.sheet.table.member.name=Member
+collection.sheet.summary.announcements=Announcements
+collection.sheet.table.due.loan.total=Total Due
+collection.sheet.summary.collection.other=Other Collection
+collection.sheet.table.balances=Balances
+collection.sheet.summary.amount.taken.back=Amount taken back to office
+collection.sheet.table.balances.loan=Loan Instance
Index: lib/spring-modules-cache.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: D:\Workspace\trash\backup-01012008-mifos\lib\spring-modules-cache.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

