Search in sources :

Example 1 with CollectionSheetEntryFormDto

use of org.mifos.application.servicefacade.CollectionSheetEntryFormDto in project head by mifos.

the class CollectionSheetEntryAction method load.

/**
     * This method is called before the load page for center is called It sets this information in session and
     * context.This should be removed after center was successfully created.
     */
@TransactionDemarcate(saveToken = true)
public ActionForward load(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    logTrackingInfo("load", request);
    // clean up
    request.getSession().setAttribute(CollectionSheetEntryConstants.BULKENTRYACTIONFORM, null);
    request.getSession().setAttribute(Constants.BUSINESS_KEY, null);
    final UserContext userContext = getUserContext(request);
    final CollectionSheetEntryFormDto collectionSheetForm = collectionSheetServiceFacade.loadAllActiveBranchesAndSubsequentDataIfApplicable(userContext);
    // settings for action
    request.setAttribute(CollectionSheetEntryConstants.REFRESH, collectionSheetForm.getReloadFormAutomatically());
    storeOnRequestCollectionSheetEntryFormDto(request, collectionSheetForm);
    return mapping.findForward(CollectionSheetEntryConstants.LOADSUCCESS);
}
Also used : UserContext(org.mifos.security.util.UserContext) CollectionSheetEntryFormDto(org.mifos.application.servicefacade.CollectionSheetEntryFormDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with CollectionSheetEntryFormDto

use of org.mifos.application.servicefacade.CollectionSheetEntryFormDto in project head by mifos.

the class CollectionSheetEntryAction method getLastMeetingDateForCustomer.

/**
     * This method retrieves the last meeting date for the chosen customer. This meeting date is put as the default date
     * for the transaction date in the search criteria
     *
     */
@TransactionDemarcate(joinToken = true)
public ActionForward getLastMeetingDateForCustomer(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    final BulkEntryActionForm actionForm = (BulkEntryActionForm) form;
    final Integer customerId = Integer.valueOf(actionForm.getCustomerId());
    final CollectionSheetEntryFormDto previousCollectionSheetEntryFormDto = retrieveFromRequestCollectionSheetEntryFormDto(request);
    final CollectionSheetEntryFormDto latestCollectionSheetEntryFormDto = collectionSheetServiceFacade.loadMeetingDateForCustomer(customerId, previousCollectionSheetEntryFormDto);
    actionForm.setTransactionDate(latestCollectionSheetEntryFormDto.getMeetingDate());
    storeOnRequestCollectionSheetEntryFormDto(request, latestCollectionSheetEntryFormDto);
    return mapping.findForward(CollectionSheetEntryConstants.LOADSUCCESS);
}
Also used : BulkEntryActionForm(org.mifos.application.collectionsheet.struts.actionforms.BulkEntryActionForm) CollectionSheetEntryFormDto(org.mifos.application.servicefacade.CollectionSheetEntryFormDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 3 with CollectionSheetEntryFormDto

use of org.mifos.application.servicefacade.CollectionSheetEntryFormDto in project head by mifos.

the class BulkEntryActionStrutsTest method createCollectionSheetDto.

private CollectionSheetEntryFormDto createCollectionSheetDto(final CustomerDto customerDto, final OfficeDetailsDto officeDetailsDto, final PersonnelDto personnelDto) {
    List<ListItem<Short>> paymentTypesDtoList = new ArrayList<ListItem<Short>>();
    List<OfficeDetailsDto> activeBranches = Arrays.asList(officeDetailsDto);
    List<CustomerDto> customerList = Arrays.asList(customerDto);
    List<PersonnelDto> loanOfficerList = Arrays.asList(personnelDto);
    final Short reloadFormAutomatically = Constants.YES;
    final Short backDatedTransactionAllowed = Constants.NO;
    final Short centerHierarchyExists = Constants.YES;
    final Date meetingDate = new Date();
    return new CollectionSheetEntryFormDto(activeBranches, paymentTypesDtoList, loanOfficerList, customerList, reloadFormAutomatically, centerHierarchyExists, backDatedTransactionAllowed, meetingDate);
}
Also used : ArrayList(java.util.ArrayList) CustomerDto(org.mifos.dto.domain.CustomerDto) PersonnelDto(org.mifos.dto.domain.PersonnelDto) ListItem(org.mifos.application.servicefacade.ListItem) OfficeDetailsDto(org.mifos.dto.domain.OfficeDetailsDto) Date(java.util.Date) CollectionSheetEntryFormDto(org.mifos.application.servicefacade.CollectionSheetEntryFormDto)

Example 4 with CollectionSheetEntryFormDto

use of org.mifos.application.servicefacade.CollectionSheetEntryFormDto in project head by mifos.

the class CollectionSheetEntryAction method loadLoanOfficers.

@TransactionDemarcate(joinToken = true)
public ActionForward loadLoanOfficers(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    final BulkEntryActionForm bulkEntryActionForm = (BulkEntryActionForm) form;
    final Short officeId = Short.valueOf(bulkEntryActionForm.getOfficeId());
    final UserContext userContext = getUserContext(request);
    final CollectionSheetEntryFormDto previousCollectionSheetEntryFormDto = collectionSheetServiceFacade.loadAllActiveBranchesAndSubsequentDataIfApplicable(userContext);
    final CollectionSheetEntryFormDto latestCollectionSheetEntryFormDto = collectionSheetServiceFacade.loadLoanOfficersForBranch(officeId, userContext, previousCollectionSheetEntryFormDto);
    // add reference data for view
    storeOnRequestCollectionSheetEntryFormDto(request, latestCollectionSheetEntryFormDto);
    return mapping.findForward(CollectionSheetEntryConstants.LOADSUCCESS);
}
Also used : BulkEntryActionForm(org.mifos.application.collectionsheet.struts.actionforms.BulkEntryActionForm) UserContext(org.mifos.security.util.UserContext) CollectionSheetEntryFormDto(org.mifos.application.servicefacade.CollectionSheetEntryFormDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 5 with CollectionSheetEntryFormDto

use of org.mifos.application.servicefacade.CollectionSheetEntryFormDto 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);
}
Also used : BulkEntryActionForm(org.mifos.application.collectionsheet.struts.actionforms.BulkEntryActionForm) FormEnteredDataAssembler(org.mifos.application.servicefacade.FormEnteredDataAssembler) CollectionSheetFormEnteredDataDto(org.mifos.application.servicefacade.CollectionSheetFormEnteredDataDto) CollectionSheetEntryFormDtoDecorator(org.mifos.application.servicefacade.CollectionSheetEntryFormDtoDecorator) MifosCurrency(org.mifos.application.master.business.MifosCurrency) CollectionSheetEntryFormDto(org.mifos.application.servicefacade.CollectionSheetEntryFormDto) CollectionSheetEntryGridDto(org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

CollectionSheetEntryFormDto (org.mifos.application.servicefacade.CollectionSheetEntryFormDto)7 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)5 BulkEntryActionForm (org.mifos.application.collectionsheet.struts.actionforms.BulkEntryActionForm)4 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 ListItem (org.mifos.application.servicefacade.ListItem)2 CustomerDto (org.mifos.dto.domain.CustomerDto)2 OfficeDetailsDto (org.mifos.dto.domain.OfficeDetailsDto)2 PersonnelDto (org.mifos.dto.domain.PersonnelDto)2 UserContext (org.mifos.security.util.UserContext)2 CollectionSheetEntryGridDto (org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto)1 MifosCurrency (org.mifos.application.master.business.MifosCurrency)1 CollectionSheetEntryFormDtoDecorator (org.mifos.application.servicefacade.CollectionSheetEntryFormDtoDecorator)1 CollectionSheetFormEnteredDataDto (org.mifos.application.servicefacade.CollectionSheetFormEnteredDataDto)1 FormEnteredDataAssembler (org.mifos.application.servicefacade.FormEnteredDataAssembler)1