Search in sources :

Example 1 with AccountTypeCustomerLevelDto

use of org.mifos.dto.screen.AccountTypeCustomerLevelDto in project head by mifos.

the class ApplyChargeAction method cancel.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    request.removeAttribute(AccountConstants.APPLICABLE_CHARGE_LIST);
    ApplyChargeActionForm applyChargeActionForm = (ApplyChargeActionForm) form;
    Integer accountId = Integer.valueOf(applyChargeActionForm.getAccountId());
    AccountTypeCustomerLevelDto accountTypeCustomerLevel = accountServiceFacade.getAccountTypeCustomerLevelDto(accountId);
    return mapping.findForward(getDetailAccountPage(accountTypeCustomerLevel));
}
Also used : AccountTypeCustomerLevelDto(org.mifos.dto.screen.AccountTypeCustomerLevelDto) ApplyChargeActionForm(org.mifos.accounts.struts.actionforms.ApplyChargeActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with AccountTypeCustomerLevelDto

use of org.mifos.dto.screen.AccountTypeCustomerLevelDto in project head by mifos.

the class ApplyChargeAction method update.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ApplyChargeActionForm applyChargeActionForm = (ApplyChargeActionForm) form;
    Short feeId = Short.valueOf(applyChargeActionForm.getFeeId());
    Double chargeAmount = 0.0;
    AccountBO account = new AccountBusinessService().getAccount(Integer.valueOf(applyChargeActionForm.getAccountId()));
    if (!(account instanceof CustomerAccountBO) && null == ((LoanBO) account).getParentAccount() && account.isGroupLoanAccount()) {
        this.accountServiceFacade.applyGroupCharge(applyChargeActionForm.getIndividualValues(), feeId, applyChargeActionForm.isPenaltyType());
    } else {
        chargeAmount = getDoubleValue(request.getParameter("charge"));
        this.accountServiceFacade.applyCharge(account.getAccountId(), feeId, chargeAmount, applyChargeActionForm.isPenaltyType());
    }
    AccountTypeCustomerLevelDto accountTypeCustomerLevel = accountServiceFacade.getAccountTypeCustomerLevelDto(account.getAccountId());
    return mapping.findForward(getDetailAccountPage(accountTypeCustomerLevel));
}
Also used : AccountTypeCustomerLevelDto(org.mifos.dto.screen.AccountTypeCustomerLevelDto) CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) AccountBO(org.mifos.accounts.business.AccountBO) CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) AccountBusinessService(org.mifos.accounts.business.service.AccountBusinessService) ApplyChargeActionForm(org.mifos.accounts.struts.actionforms.ApplyChargeActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

ApplyChargeActionForm (org.mifos.accounts.struts.actionforms.ApplyChargeActionForm)2 AccountTypeCustomerLevelDto (org.mifos.dto.screen.AccountTypeCustomerLevelDto)2 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)2 AccountBO (org.mifos.accounts.business.AccountBO)1 AccountBusinessService (org.mifos.accounts.business.service.AccountBusinessService)1 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)1