use of org.mifos.application.servicefacade.ListItem in project head by mifos.
the class ImportTransactionsAction method load.
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
final ImportTransactionsActionForm importTransactionsForm = (ImportTransactionsActionForm) form;
importTransactionsForm.clear();
clearOurSessionVariables(request.getSession());
final List<ListItem<String>> importPlugins = this.importTransactionsServiceFacade.retrieveImportPlugins();
request.setAttribute("importPlugins", importPlugins);
return mapping.findForward("import_load");
}
use of org.mifos.application.servicefacade.ListItem 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.ListItem in project head by mifos.
the class WebTierAccountServiceFacade method constructPaymentTypeList.
private List<ListItem<Short>> constructPaymentTypeList(String paymentType, Short localeId) {
try {
List<PaymentTypeEntity> paymentTypeList = null;
if (paymentType != null && !Constants.EMPTY_STRING.equals(paymentType.trim())) {
if (isLoanPayment(paymentType)) {
paymentTypeList = acceptedPaymentTypePersistence.getAcceptedPaymentTypesForATransaction(localeId, TrxnTypes.loan_repayment.getValue());
} else {
paymentTypeList = acceptedPaymentTypePersistence.getAcceptedPaymentTypesForATransaction(localeId, TrxnTypes.fee.getValue());
}
}
List<ListItem<Short>> listItems = new ArrayList<ListItem<Short>>();
for (PaymentTypeEntity paymentTypeEntity : paymentTypeList) {
listItems.add(new ListItem<Short>(paymentTypeEntity.getId(), paymentTypeEntity.getName()));
}
return listItems;
} catch (PersistenceException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.application.servicefacade.ListItem in project head by mifos.
the class WebTierAccountServiceFacade method getAccountPaymentInformation.
@Override
public AccountPaymentDto getAccountPaymentInformation(Integer accountId, String paymentType, Short localeId, UserReferenceDto userReferenceDto, Date paymentDate) {
try {
AccountBO account = accountBusinessService.getAccount(accountId);
CustomerDto customer = account.getCustomer().toCustomerDto();
List<SavingsDetailDto> savingsInUse = clientServiceFacade.retrieveSavingsInUseForClient(customer.getCustomerId());
List<SavingsDetailDto> accountsForTransfer = new ArrayList<SavingsDetailDto>();
if (savingsInUse != null) {
for (SavingsDetailDto savingsAccount : savingsInUse) {
if (savingsAccount.getAccountStateId().equals(AccountState.SAVINGS_ACTIVE.getValue())) {
accountsForTransfer.add(savingsAccount);
}
}
}
if (isLoanPayment(paymentType)) {
scheduleCalculatorAdaptor.computeExtraInterest((LoanBO) account, paymentDate);
}
UserReferenceDto accountUser = userReferenceDto;
if (account.getPersonnel() != null) {
accountUser = new UserReferenceDto(account.getPersonnel().getPersonnelId());
}
List<ListItem<Short>> paymentTypeList = constructPaymentTypeList(paymentType, localeId);
AccountTypeDto accountType = AccountTypeDto.getAccountType(account.getAccountType().getAccountTypeId());
Money totalPaymentDueMoney = account.getTotalPaymentDue();
String totalPaymentDue;
if (account instanceof LoanBO && totalPaymentDueMoney.isZero()) {
totalPaymentDue = ((LoanBO) account).getTotalRepayableAmount().toString();
} else {
totalPaymentDue = totalPaymentDueMoney.toString();
}
clearSessionAndRollback();
return new AccountPaymentDto(accountType, account.getVersionNo(), paymentTypeList, totalPaymentDue, accountUser, getLastPaymentDate(account), accountsForTransfer, customer);
} catch (ServiceException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.application.servicefacade.ListItem in project head by mifos.
the class ApplyAdjustment method previewAdjustment.
@TransactionDemarcate(joinToken = true)
public ActionForward previewAdjustment(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ApplyAdjustmentActionForm appAdjustActionForm = (ApplyAdjustmentActionForm) form;
appAdjustActionForm.setAdjustData(!appAdjustActionForm.getAdjustcheckbox());
if (appAdjustActionForm.isAdjustData()) {
@SuppressWarnings("unchecked") List<ListItem<Short>> paymentTypes = (List<ListItem<Short>>) SessionUtils.getAttribute(MasterConstants.PAYMENT_TYPE, request);
Short elementType = Short.valueOf(appAdjustActionForm.getPaymentType());
for (ListItem<Short> item : paymentTypes) {
if (item.getId().equals(elementType)) {
SessionUtils.setAttribute(Constants.ADJUSTMENT_PAYMENT_TYPE, item.getDisplayValue(), request);
}
}
}
if (appAdjustActionForm.getNewAmounts() != null && !appAdjustActionForm.getNewAmounts().isEmpty()) {
BigDecimal newAmount = BigDecimal.ZERO;
for (String memberNewAmountString : appAdjustActionForm.getNewAmounts().values()) {
BigDecimal memberNewAmount = BigDecimal.ZERO;
if (!StringUtils.isBlank(memberNewAmountString)) {
memberNewAmount = new BigDecimal(memberNewAmountString);
}
newAmount = newAmount.add(memberNewAmount);
}
appAdjustActionForm.setAmount(newAmount.toString());
}
request.setAttribute("method", "previewAdjustment");
return mapping.findForward("previewadj_success");
}
Aggregations