use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class CenterCustActionForm method clearActionFormFields.
public void clearActionFormFields() {
setDefaultFees(new ArrayList<ApplicableAccountFeeDto>());
setAdditionalFees(new ArrayList<ApplicableAccountFeeDto>());
setCustomerPositions(new ArrayList<CustomerPositionDto>());
setCustomFields(new ArrayList<CustomFieldDto>());
setAddress(new Address());
setDisplayName(null);
setMfiJoiningDate(null);
setGlobalCustNum(null);
setCustomerId(null);
setExternalId(null);
setLoanOfficerId(null);
setQuestionGroups(null);
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class ClientCustActionForm method clearMostButNotAllFieldsOnActionForm.
public void clearMostButNotAllFieldsOnActionForm() {
setDefaultFees(new ArrayList<ApplicableAccountFeeDto>());
setAdditionalFees(new ArrayList<ApplicableAccountFeeDto>());
setCustomFields(new ArrayList<CustomFieldDto>());
setFamilyNames(new ArrayList<ClientNameDetailDto>());
setFamilyDetails(new ArrayList<ClientFamilyDetailDto>());
setFamilyRelationship(new ArrayList<Short>());
setFamilyFirstName(new ArrayList<String>());
setFamilyMiddleName(new ArrayList<String>());
setFamilyLastName(new ArrayList<String>());
setFamilySecondLastName(new ArrayList<String>());
setFamilyDateOfBirthDD(new ArrayList<String>());
setFamilyDateOfBirthMM(new ArrayList<String>());
setFamilyDateOfBirthYY(new ArrayList<String>());
setFamilyGender(new ArrayList<Short>());
setFamilyLivingStatus(new ArrayList<Short>());
initializeFamilyMember();
addFamilyMember();
setAddress(new Address());
setDisplayName(null);
setDateOfBirthDD(null);
setDateOfBirthMM(null);
setDateOfBirthYY(null);
setGovernmentId(null);
setMfiJoiningDate(null);
setGlobalCustNum(null);
setCustomerId(null);
setExternalId(null);
setLoanOfficerId(null);
setLoanOfficerName("");
setFormedByPersonnel(null);
setTrained(null);
setTrainedDate(null);
setClientName(new ClientNameDetailDto());
setSpouseName(new ClientNameDetailDto());
setClientDetailView(new ClientPersonalDetailDto());
setNextOrPreview("next");
setQuestionGroups(null);
for (int i = 0; i < getSelectedOfferings().size(); i++) {
getSelectedOfferings().set(i, null);
}
setFiles(new ArrayList<FormFile>());
setFilesMetadata(new ArrayList<UploadedFileDto>());
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class CenterCustAction method manage.
// NOTE edit center details
@TransactionDemarcate(joinToken = true)
public ActionForward manage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CenterCustActionForm actionForm = (CenterCustActionForm) form;
actionForm.clearActionFormFields();
CenterBO center = (CenterBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
final Integer centerId = center.getCustomerId();
center = this.customerDao.findCenterBySystemId(center.getGlobalCustNum());
SessionUtils.setAttribute(Constants.BUSINESS_KEY, null, request);
CenterDto centerDto = this.centerServiceFacade.retrieveCenterDetailsForUpdate(centerId);
actionForm.setLoanOfficerId(centerDto.getLoanOfficerIdAsString());
actionForm.setCustomerId(centerDto.getCustomerIdAsString());
actionForm.setGlobalCustNum(centerDto.getGlobalCustNum());
actionForm.setExternalId(centerDto.getExternalId());
actionForm.setMfiJoiningDate(centerDto.getMfiJoiningDateAsString());
actionForm.setMfiJoiningDate(centerDto.getMfiJoiningDate().getDayOfMonth(), centerDto.getMfiJoiningDate().getMonthOfYear(), centerDto.getMfiJoiningDate().getYear());
actionForm.setAddress(center.getAddress());
actionForm.setCustomerPositions(centerDto.getCustomerPositionViews());
actionForm.setCustomFields(new ArrayList<CustomFieldDto>());
SessionUtils.setAttribute(Constants.BUSINESS_KEY, center, request);
SessionUtils.setCollectionAttribute(CustomerConstants.LOAN_OFFICER_LIST, centerDto.getActiveLoanOfficersForBranch(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, new ArrayList<CustomFieldDto>(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.POSITIONS, centerDto.getCustomerPositionViews(), request);
SessionUtils.setCollectionAttribute(CustomerConstants.CLIENT_LIST, centerDto.getClientList(), request);
return mapping.findForward(ActionForwards.manage_success.toString());
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class CenterUpdateUsingCustomerServiceIntegrationTest method canUpdateCenterWithDifferentLoanOfficer.
@Test
public void canUpdateCenterWithDifferentLoanOfficer() throws Exception {
// setup
String externalId = center.getExternalId();
String mfiJoiningDate = new SimpleDateFormat("dd/MM/yyyy").format(center.getMfiJoiningDate());
AddressDto address = null;
if (center.getAddress() != null) {
address = Address.toDto(center.getAddress());
}
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
List<CustomerPositionDto> customerPositions = new ArrayList<CustomerPositionDto>();
UserContext userContext = TestUtils.makeUser();
otherLoanOfficer.setPreferredLocale(userContext.getLocaleId());
IntegrationTestObjectMother.createPersonnel(otherLoanOfficer);
String updatedDisplayName = "Center " + RandomStringUtils.randomAlphanumeric(5);
CenterUpdate centerUpdate = new CenterUpdate(center.getCustomerId(), updatedDisplayName, center.getVersionNo(), otherLoanOfficer.getPersonnelId(), externalId, mfiJoiningDate, address, customFields, customerPositions);
// exercise test
customerService.updateCenter(userContext, centerUpdate);
// verification
center = customerDao.findCenterBySystemId(center.getGlobalCustNum());
assertThat(center.getPersonnel().getDisplayName(), is(otherLoanOfficer.getDisplayName()));
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class CenterUpdateUsingCustomerServiceIntegrationTest method canUpdateCenterWithNoLoanOfficerWhenCenterIsInactive.
@Test
public void canUpdateCenterWithNoLoanOfficerWhenCenterIsInactive() throws Exception {
// setup
CustomerStatusFlag centerStatusFlag = null;
CustomerNoteEntity customerNote = null;
customerService.updateCenterStatus(center, CustomerStatus.CENTER_INACTIVE, centerStatusFlag, customerNote);
StaticHibernateUtil.flushAndClearSession();
Short loanOfficerId = null;
String externalId = center.getExternalId();
String mfiJoiningDate = new SimpleDateFormat("dd/MM/yyyy").format(center.getMfiJoiningDate());
AddressDto address = null;
if (center.getAddress() != null) {
address = Address.toDto(center.getAddress());
}
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
List<CustomerPositionDto> customerPositions = new ArrayList<CustomerPositionDto>();
String updatedDisplayName = "Center " + RandomStringUtils.randomAlphanumeric(5);
CenterUpdate centerUpdate = new CenterUpdate(center.getCustomerId(), updatedDisplayName, center.getVersionNo(), loanOfficerId, externalId, mfiJoiningDate, address, customFields, customerPositions);
UserContext userContext = TestUtils.makeUser();
// exercise test
customerService.updateCenter(userContext, centerUpdate);
// verification
center = customerDao.findCenterBySystemId(center.getGlobalCustNum());
assertThat(center.getPersonnel(), is(nullValue()));
}
Aggregations