Пример #1
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;
           }
         }
       }
     }
   }
 }
Пример #2
0
 private boolean isSelectedFeePeriodic(FeeView selectedFee, List<FeeView> additionalFeeList) {
   for (FeeView fee : additionalFeeList) {
     if (fee.getFeeId().equals(selectedFee.getFeeId())) {
       return fee.isPeriodic();
     }
   }
   return false;
 }
Пример #3
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;
     }
   }
 }