use of org.mifos.dto.domain.FeeCreateDto in project head by mifos.
the class FeeAction method create.
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
FeeActionForm actionForm = (FeeActionForm) form;
Short feeCategory = null;
if (actionForm.getCategoryTypeValue() != null) {
feeCategory = actionForm.getCategoryTypeValue().getValue();
}
Short feeFrequency = null;
if (actionForm.getFeeFrequencyTypeValue() != null) {
feeFrequency = actionForm.getFeeFrequencyTypeValue().getValue();
}
Short feePayment = null;
if (actionForm.getFeePaymentTypeValue() != null) {
feePayment = actionForm.getFeePaymentTypeValue().getValue();
}
Short feeFormula = null;
if (actionForm.getFeeFormulaValue() != null) {
feeFormula = actionForm.getFeeFormulaValue().getValue();
}
Short feeRecurrence = null;
if (actionForm.getFeeRecurrenceTypeValue() != null) {
feeRecurrence = actionForm.getFeeRecurrenceTypeValue().getValue();
}
FeeCreateDto feeCreateRequest = new FeeCreateDto(feeCategory, feeFrequency, actionForm.getGlCodeValue(), feePayment, feeFormula, actionForm.getFeeName(), actionForm.isRateFee(), actionForm.isCustomerDefaultFee(), actionForm.getRateValue(), actionForm.getCurrencyId(), actionForm.getAmount(), feeRecurrence, actionForm.getMonthRecurAfterValue(), actionForm.getWeekRecurAfterValue());
String feeId = this.feeServiceFacade.createFee(feeCreateRequest);
actionForm.setFeeId(feeId);
return mapping.findForward(ActionForwards.create_success.toString());
}
Aggregations