use of org.mifos.framework.business.util.Address in project head by mifos.
the class OffActionForm method populate.
public void populate(OfficeBO officeBO) throws OfficeException {
this.officeId = officeBO.getOfficeId().toString();
this.officeLevel = officeBO.getOfficeLevel().getValue().toString();
this.officeStatus = officeBO.getOfficeStatus().getValue().toString();
this.officeName = officeBO.getOfficeName();
this.shortName = officeBO.getShortName();
if (officeBO.getAddress() != null && officeBO.getAddress().getAddress() != null) {
this.address.setLine1(officeBO.getAddress().getAddress().getLine1());
this.address.setLine2(officeBO.getAddress().getAddress().getLine2());
this.address.setLine3(officeBO.getAddress().getAddress().getLine3());
this.address.setPhoneNumber(officeBO.getAddress().getAddress().getPhoneNumber());
this.address.setCity(officeBO.getAddress().getAddress().getCity());
this.address.setState(officeBO.getAddress().getAddress().getState());
this.address.setCountry(officeBO.getAddress().getAddress().getCountry());
this.address.setZip(officeBO.getAddress().getAddress().getZip());
} else {
this.address = new Address();
}
if (officeBO.getParentOffice() != null) {
this.parentOfficeId = officeBO.getParentOffice().getOfficeId().toString();
} else {
this.parentOfficeId = null;
}
}
use of org.mifos.framework.business.util.Address in project head by mifos.
the class GroupCreationUsingCustomerServiceIntegrationTest method shouldSaveAllDetailsToDoWithGroup.
@Test
public void shouldSaveAllDetailsToDoWithGroup() throws Exception {
// setup
Address address = new Address("line1", "line2", "line3", "city", "state", "country", "zip", "phonenumber");
GroupBO group = new GroupBuilder().withName("newGroup").withAddress(address).withStatus(CustomerStatus.GROUP_ACTIVE).withParentCustomer(existingCenter).formedBy(existingUser).build();
// exercise test
customerService.createGroup(group, existingMeeting, noAccountFees);
// verification
assertThat(group.getDisplayName(), is("newGroup"));
assertThat(group.getAddress().getDisplayAddress(), is("line1, line2, line3"));
assertThat(group.getSearchId(), is("1." + group.getParentCustomer().getCustomerId() + ".3"));
assertThat(group.getStatus(), is(CustomerStatus.GROUP_ACTIVE));
assertThat(group.getGroupPerformanceHistory().getGroup().getCustomerId(), is(group.getCustomerId()));
assertThat(group.getCustomFields().size(), is(0));
assertThat(group.getMaxChildCount(), is(0));
assertThat(existingCenter.getMaxChildCount(), is(3));
}
use of org.mifos.framework.business.util.Address in project head by mifos.
the class ClientCustActionStrutsTest method createClientForAuditLog.
private void createClientForAuditLog() throws Exception {
OfficeBO office = new OfficePersistence().getOffice(TestObjectFactory.HEAD_OFFICE);
PersonnelBO personnel = legacyPersonnelDao.getPersonnel(PersonnelConstants.TEST_USER);
meeting = getMeeting();
Integer salutation = 47;
Integer ethnicity = 218;
Integer citizenship = 130;
Integer handicapped = 138;
Integer businessActivities = 225;
Integer educationLevel = 226;
Short numChildren = Short.valueOf("1");
Short gender = Short.valueOf("49");
Short povertyStatus = Short.valueOf("41");
StaticHibernateUtil.startTransaction();
ClientNameDetailDto clientNameDetailDto = new ClientNameDetailDto(NameType.CLIENT.getValue(), salutation, "Client", "", "1", "");
clientNameDetailDto.setNames(ClientRules.getNameSequence());
ClientNameDetailDto spouseNameDetailView = new ClientNameDetailDto(NameType.SPOUSE.getValue(), TestObjectFactory.SAMPLE_SALUTATION, "first", "middle", "last", "secondLast");
spouseNameDetailView.setNames(ClientRules.getNameSequence());
ClientPersonalDetailDto clientPersonalDetailDto = new ClientPersonalDetailDto(ethnicity, citizenship, handicapped, businessActivities, ClientPersonalDetailDto.MARRIED, educationLevel, numChildren, gender, povertyStatus);
client = new ClientBO(TestUtils.makeUser(), clientNameDetailDto.getDisplayName(), CustomerStatus.fromInt(new Short("1")), null, null, new Address(), getCustomFields(), null, null, personnel, office, meeting, personnel, new java.util.Date(), null, null, null, YesNoFlag.NO.getValue(), clientNameDetailDto, spouseNameDetailView, clientPersonalDetailDto, null);
legacyClientDao.saveClient(client);
StaticHibernateUtil.flushAndClearSession();
client = TestObjectFactory.getClient(new Integer(client.getCustomerId()).intValue());
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
}
use of org.mifos.framework.business.util.Address in project head by mifos.
the class TestObjectFactory method getAddressHelper.
/**
* This is just a helper method which returns a address object , this is just a helper it does not persist any data.
*/
public static Address getAddressHelper() {
Address address = new Address();
address.setLine1("line1");
address.setCity("city");
address.setCountry("country");
return address;
}
use of org.mifos.framework.business.util.Address in project head by mifos.
the class OfficeBO method update.
public void update(UserContext userContext, OfficeUpdateRequest officeUpdateRequest, OfficeBO newParentOffice) throws OfficeException {
updateDetails(userContext);
OfficeStatus officeStatus = OfficeStatus.getOfficeStatus(officeUpdateRequest.getNewStatus());
OfficeLevel officeLevel = OfficeLevel.getOfficeLevel(officeUpdateRequest.getNewlevel());
Address address = null;
AddressDto dto = officeUpdateRequest.getAddress();
if (dto != null) {
address = new Address(dto.getLine1(), dto.getLine2(), dto.getLine3(), dto.getCity(), dto.getState(), dto.getCountry(), dto.getZip(), dto.getPhoneNumber());
}
update(officeUpdateRequest.getOfficeName(), officeUpdateRequest.getShortName(), officeStatus, officeLevel, newParentOffice, address, new ArrayList<CustomFieldDto>());
}
Aggregations