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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations