示例#1
0
 private boolean isSelectedFeePeriodic(FeeView selectedFee, List<FeeView> additionalFeeList) {
   for (FeeView fee : additionalFeeList) {
     if (fee.getFeeId().equals(selectedFee.getFeeId())) {
       return fee.isPeriodic();
     }
   }
   return false;
 }
示例#2
0
 protected void validateForFeeRecurrence(HttpServletRequest request, ActionErrors errors)
     throws ApplicationException {
   MeetingBO meeting = getCustomerMeeting(request);
   if (meeting != null) {
     List<FeeView> feeList = getDefaultFees();
     for (FeeView fee : feeList) {
       if (!fee.isRemoved() && fee.isPeriodic() && !isFrequencyMatches(fee, meeting)) {
         errors.add(
             CustomerConstants.ERRORS_FEE_FREQUENCY_MISMATCH,
             new ActionMessage(CustomerConstants.ERRORS_FEE_FREQUENCY_MISMATCH));
         return;
       }
     }
     List<FeeView> additionalFeeList =
         (List<FeeView>)
             SessionUtils.getAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, request);
     for (FeeView selectedFee : getAdditionalFees()) {
       for (FeeView fee : additionalFeeList) {
         if (selectedFee.getFeeIdValue() != null
             && selectedFee.getFeeId().equals(fee.getFeeId())) {
           if (fee.isPeriodic() && !isFrequencyMatches(fee, meeting)) {
             errors.add(
                 CustomerConstants.ERRORS_FEE_FREQUENCY_MISMATCH,
                 new ActionMessage(CustomerConstants.ERRORS_FEE_FREQUENCY_MISMATCH));
             return;
           }
         }
       }
     }
   }
 }
示例#3
0
 public List<FeeView> getFeesToApply() {
   List<FeeView> feesToApply = new ArrayList<FeeView>();
   for (FeeView fee : getAdditionalFees()) {
     if (fee.getFeeIdValue() != null) {
       feesToApply.add(fee);
     }
   }
   for (FeeView fee : getDefaultFees()) {
     if (!fee.isRemoved()) {
       feesToApply.add(fee);
     }
   }
   return feesToApply;
 }
示例#4
0
 protected void validateForFeeAmount(ActionErrors errors, Locale locale) {
   List<FeeView> feeList = getFeesToApply();
   for (FeeView fee : feeList) {
     if (StringUtils.isBlank(fee.getAmount())) {
       errors.add(
           CustomerConstants.FEE, new ActionMessage(CustomerConstants.ERRORS_SPECIFY_FEE_AMOUNT));
     } else {
       validateAmount(
           fee.getAmount(),
           CustomerConstants.FEE,
           errors,
           locale,
           FilePaths.CUSTOMER_UI_RESOURCE_PROPERTYFILE);
     }
   }
 }
示例#5
0
 protected void validateForDuplicatePeriodicFee(HttpServletRequest request, ActionErrors errors)
     throws ApplicationException {
   List<FeeView> additionalFeeList =
       (List<FeeView>) SessionUtils.getAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, request);
   for (FeeView selectedFee : getAdditionalFees()) {
     int count = 0;
     for (FeeView duplicateSelectedfee : getAdditionalFees()) {
       if (selectedFee.getFeeIdValue() != null
           && selectedFee.getFeeId().equals(duplicateSelectedfee.getFeeId())) {
         if (isSelectedFeePeriodic(selectedFee, additionalFeeList)) {
           count++;
         }
       }
     }
     if (count > 1) {
       errors.add(
           CustomerConstants.FEE,
           new ActionMessage(CustomerConstants.ERRORS_DUPLICATE_PERIODIC_FEE));
       break;
     }
   }
 }
示例#6
0
 private boolean isFrequencyMatches(FeeView fee, MeetingBO meeting) {
   return (fee.getFrequencyType().equals(RecurrenceType.MONTHLY) && meeting.isMonthly())
       || (fee.getFrequencyType().equals(RecurrenceType.WEEKLY) && meeting.isWeekly());
 }