use of org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto in project head by mifos.
the class CollectionSheetServiceFacadeWebTier method previewCollectionSheetEntry.
@Override
public CollectionSheetEntryGridDto previewCollectionSheetEntry(final CollectionSheetEntryGridDto previousCollectionSheetEntryDto, final CollectionSheetDataDto dataView) {
CollectionSheetEntryGridDto newCollectionSheetEntryGridDto = null;
final CollectionSheetEntryDto bulkEntryParent = previousCollectionSheetEntryDto.getBulkEntryParent();
switch(CustomerLevel.getLevel(bulkEntryParent.getCustomerDetail().getCustomerLevelId())) {
case CENTER:
newCollectionSheetEntryGridDto = new CollectionSheetEntryGridDtoTranslator().translateAsCenter(previousCollectionSheetEntryDto, dataView);
break;
case GROUP:
case CLIENT:
newCollectionSheetEntryGridDto = new CollectionSheetEntryGridDtoTranslator().translateAsGroup(previousCollectionSheetEntryDto, dataView);
break;
}
return newCollectionSheetEntryGridDto;
}
use of org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto in project head by mifos.
the class ProductDtoComparator method toLegacyDto.
@Override
public CollectionSheetEntryGridDto toLegacyDto(final CollectionSheetDto collectionSheet, final CollectionSheetFormEnteredDataDto formEnteredDataDto, final List<CustomValueListElementDto> attendanceTypesList, final MifosCurrency currency) {
final CollectionSheetEntryDto collectionSheetEntryViewHierarchy = createEntryViewHierarchyFromCollectionSheetData(collectionSheet.getCollectionSheetCustomer(), currency);
final PersonnelDto loanOfficer = formEnteredDataDto.getLoanOfficer();
final OfficeDetailsDto office = formEnteredDataDto.getOffice();
final ListItem<Short> paymentType = formEnteredDataDto.getPaymentType();
final Date meetingDate = formEnteredDataDto.getMeetingDate();
final String receiptId = formEnteredDataDto.getReceiptId();
final Date receiptDate = formEnteredDataDto.getReceiptDate();
final List<ProductDto> loanProductDtos = createListOfLoanProducts(collectionSheet.getCollectionSheetCustomer());
final List<ProductDto> savingProductDtos = createListOfSavingProducts(collectionSheet.getCollectionSheetCustomer());
final CollectionSheetEntryGridDto translatedGridDto = new CollectionSheetEntryGridDto(collectionSheetEntryViewHierarchy, loanOfficer, office, paymentType, meetingDate, receiptId, receiptDate, loanProductDtos, savingProductDtos, attendanceTypesList);
return translatedGridDto;
}
use of org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto in project head by mifos.
the class BulkEntryTag method doStartTag.
@SuppressWarnings("unchecked")
@Override
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
JspWriter out = pageContext.getOut();
StringBuilder builder = new StringBuilder();
CollectionSheetEntryGridDto bulkEntry = null;
try {
bulkEntry = (CollectionSheetEntryGridDto) SessionUtils.getAttribute(CollectionSheetEntryConstants.BULKENTRY, request);
} catch (PageExpiredException e) {
logger.error("Page expired getting BulkEntryBO.");
}
if (null != bulkEntry) {
List<ProductDto> loanProducts = bulkEntry.getLoanProducts();
List<ProductDto> savingsProducts = bulkEntry.getSavingProducts();
try {
final List<CustomValueListElementDto> custAttTypes = (List<CustomValueListElementDto>) SessionUtils.getAttribute(CollectionSheetEntryConstants.CUSTOMERATTENDANCETYPES, request);
String method = request.getParameter(CollectionSheetEntryConstants.METHOD);
generateTagData(bulkEntry, loanProducts, savingsProducts, custAttTypes, method, builder);
} catch (ApplicationException ae) {
throw new JspException(ae);
} catch (SystemException se) {
throw new JspException(se);
}
}
try {
out.write(builder.toString());
} catch (IOException ioe) {
throw new JspException(ioe);
}
return SKIP_BODY;
}
use of org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto in project head by mifos.
the class CollectionSheetEntryAction method get.
/**
* This method is called once the search criteria have been entered by the user to generate the bulk entry details
* for a particular customer It retrieves the loan officer office, and parent customer that was selected and sets
* them into the bulk entry business object. The list of attendance types and product list associated with the
* center, and its children are also retrieved
*/
@TransactionDemarcate(joinToken = true)
public ActionForward get(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
logTrackingInfo("get", request, form);
final BulkEntryActionForm collectionSheetEntryActionForm = (BulkEntryActionForm) form;
final CollectionSheetEntryFormDto previousCollectionSheetEntryFormDto = retrieveFromRequestCollectionSheetEntryFormDto(request);
final CollectionSheetEntryFormDtoDecorator dtoDecorator = new CollectionSheetEntryFormDtoDecorator(previousCollectionSheetEntryFormDto);
final CollectionSheetFormEnteredDataDto formEnteredDataDto = new FormEnteredDataAssembler(collectionSheetEntryActionForm, dtoDecorator).toDto();
final MifosCurrency currency = Configuration.getInstance().getSystemConfig().getCurrency();
final CollectionSheetEntryGridDto collectionSheetEntry = collectionSheetServiceFacade.generateCollectionSheetEntryGridView(formEnteredDataDto, currency);
storeOnRequestCollectionSheetEntryDto(request, collectionSheetEntry);
return mapping.findForward(CollectionSheetEntryConstants.GETSUCCESS);
}
use of org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto in project head by mifos.
the class BulkEntryActionStrutsTest method testSuccessfulPreview.
@Test
public void testSuccessfulPreview() throws Exception {
CollectionSheetEntryGridDto bulkEntry = getSuccessfulBulkEntry();
Calendar meetinDateCalendar = new GregorianCalendar();
int year = meetinDateCalendar.get(Calendar.YEAR);
int month = meetinDateCalendar.get(Calendar.MONTH);
int day = meetinDateCalendar.get(Calendar.DAY_OF_MONTH);
meetinDateCalendar = new GregorianCalendar(year, month, day);
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
SessionUtils.setAttribute(CollectionSheetEntryConstants.BULKENTRY, bulkEntry, request);
setRequestPathInfo("/collectionsheetaction.do");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter("method", "preview");
addRequestParameter("attendanceSelected[0]", "1");
addRequestParameter("enteredAmount[0][0]", "212.0");
addRequestParameter("enteredAmount[1][1]", "212.0");
addRequestParameter("enteredAmount[0][1]", "212.0");
addRequestParameter("enteredAmount[1][0]", "212.0");
addRequestParameter("withDrawalAmountEntered[2][2]", "100.0");
addRequestParameter("depositAmountEntered[2][2]", "100.0");
addRequestParameter("withDrawalAmountEntered[0][0]", "100.0");
addRequestParameter("depositAmountEntered[0][0]", "100.0");
addRequestDateParameter("transactionDate", day + "/" + (month + 1) + "/" + year);
performNoErrors();
verifyForward("preview_success");
groupAccount = TestObjectFactory.getObject(LoanBO.class, groupAccount.getAccountId());
clientAccount = TestObjectFactory.getObject(LoanBO.class, clientAccount.getAccountId());
centerSavingsAccount = TestObjectFactory.getObject(SavingsBO.class, centerSavingsAccount.getAccountId());
clientSavingsAccount = TestObjectFactory.getObject(SavingsBO.class, clientSavingsAccount.getAccountId());
groupSavingsAccount = TestObjectFactory.getObject(SavingsBO.class, groupSavingsAccount.getAccountId());
center = TestObjectFactory.getCustomer(center.getCustomerId());
group = TestObjectFactory.getCustomer(group.getCustomerId());
client = TestObjectFactory.getClient(client.getCustomerId());
}
Aggregations