use of org.mifos.customers.office.persistence.OfficePersistence in project head by mifos.
the class TestObjectFactory method createGroupUnderBranch.
public static GroupBO createGroupUnderBranch(final String customerName, final CustomerStatus customerStatus, final String externalId, final boolean trained, final Date trainedDate, final Address address, final List<CustomFieldDto> customFields, final List<FeeDto> fees, final Short formedById, final Short officeId, final MeetingBO meeting, final Short loanOfficerId) {
GroupBO group;
PersonnelBO loanOfficer = null;
try {
if (loanOfficerId != null) {
loanOfficer = getPersonnel(loanOfficerId);
}
group = new GroupBO(TestUtils.makeUserWithLocales(), customerName, customerStatus, externalId, trained, trainedDate, address, customFields, fees, getPersonnel(formedById), new OfficePersistence().getOffice(officeId), meeting, loanOfficer);
new GroupPersistence().saveGroup(group);
StaticHibernateUtil.flushSession();
} catch (Exception e) {
throw new RuntimeException(e);
}
return group;
}
use of org.mifos.customers.office.persistence.OfficePersistence in project head by mifos.
the class TestObjectFactory method generateSearchId.
private static String generateSearchId(OfficeBO parentOffice) throws OfficeException {
Integer noOfChildern;
try {
noOfChildern = new OfficePersistence().getChildCount(parentOffice.getOfficeId());
} catch (PersistenceException e) {
throw new OfficeException(e);
}
String parentSearchId = HierarchyManager.getInstance().getSearchId(parentOffice.getOfficeId());
parentSearchId += ++noOfChildern;
parentSearchId += ".";
return parentSearchId;
}
Aggregations