public ActionForward deleteBudgetPersonnelDetails(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    BudgetForm budgetForm = (BudgetForm) form;
    BudgetDocument budgetDocument = budgetForm.getBudgetDocument();
    Budget budget = budgetDocument.getBudget();
    int selectedBudgetPeriodIndex = budgetForm.getViewBudgetPeriod() - 1;
    int selectedBudgetLineItemIndex = budgetForm.getSelectedBudgetLineItemIndex();
    BudgetPersonnelBudgetService budgetPersonnelBudgetService =
        KraServiceLocator.getService(BudgetPersonnelBudgetService.class);
    budgetPersonnelBudgetService.deleteBudgetPersonnelDetails(
        budget, selectedBudgetPeriodIndex, selectedBudgetLineItemIndex, getLineToDelete(request));
    HashMap uniqueBudgetPersonnelCount = new HashMap();
    int qty = 0;
    for (BudgetPersonnelDetails budgetPersonnelDetails :
        budget
            .getBudgetPeriod(selectedBudgetPeriodIndex)
            .getBudgetLineItem(selectedBudgetLineItemIndex)
            .getBudgetPersonnelDetailsList()) {
      if (!uniqueBudgetPersonnelCount.containsValue(budgetPersonnelDetails.getPersonId())) {
        uniqueBudgetPersonnelCount.put(qty, budgetPersonnelDetails.getPersonId());
        qty = qty + 1;
      }
    }
    budget
        .getBudgetPeriod(selectedBudgetPeriodIndex)
        .getBudgetLineItem(selectedBudgetLineItemIndex)
        .setQuantity(new Integer(qty));

    getCalculationService()
        .calculateBudgetPeriod(budget, budget.getBudgetPeriod(selectedBudgetPeriodIndex));
    return mapping.findForward(Constants.MAPPING_BASIC);
  }
 /**
  * This method calculates the salary
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return mapping forward
  * @throws Exception
  */
 public ActionForward calculateSalary(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   BudgetForm budgetForm = (BudgetForm) form;
   BudgetDocument budgetDocument = budgetForm.getBudgetDocument();
   Budget budget = budgetDocument.getBudget();
   int selectedBudgetPeriodIndex = budgetForm.getViewBudgetPeriod() - 1;
   int selectedBudgetLineItemIndex = budgetForm.getSelectedBudgetLineItemIndex();
   BudgetLineItem selectedBudgetLineItem =
       budget
           .getBudgetPeriod(selectedBudgetPeriodIndex)
           .getBudgetLineItem(selectedBudgetLineItemIndex);
   BudgetPersonnelDetails budgetPersonnelDetails =
       selectedBudgetLineItem.getBudgetPersonnelDetailsList().get(getLineToDelete(request));
   boolean errorFound = false;
   GlobalVariables.getMessageMap().addToErrorPath("document");
   if (budgetPersonnelDetails.getPercentEffort().isGreaterThan(new BudgetDecimal(100))) {
     GlobalVariables.getMessageMap()
         .putError(
             "budgetPeriod["
                 + selectedBudgetPeriodIndex
                 + "].budgetLineItems["
                 + selectedBudgetLineItemIndex
                 + "].budgetPersonnelDetailsList["
                 + getLineToDelete(request)
                 + "].percentEffort",
             KeyConstants.ERROR_PERCENTAGE,
             Constants.PERCENT_EFFORT_FIELD);
     errorFound = true;
   }
   if (budgetPersonnelDetails.getPercentCharged().isGreaterThan(new BudgetDecimal(100))) {
     GlobalVariables.getMessageMap()
         .putError(
             "budgetPeriod["
                 + selectedBudgetPeriodIndex
                 + "].budgetLineItems["
                 + selectedBudgetLineItemIndex
                 + "].budgetPersonnelDetailsList["
                 + getLineToDelete(request)
                 + "].percentCharged",
             KeyConstants.ERROR_PERCENTAGE,
             Constants.PERCENT_CHARGED_FIELD);
     errorFound = true;
   }
   if (budgetPersonnelDetails
       .getPercentCharged()
       .isGreaterThan(budgetPersonnelDetails.getPercentEffort())) {
     GlobalVariables.getMessageMap()
         .putError(
             "budgetPeriod["
                 + selectedBudgetPeriodIndex
                 + "].budgetLineItems["
                 + selectedBudgetLineItemIndex
                 + "].budgetPersonnelDetailsList["
                 + getLineToDelete(request)
                 + "].percentCharged",
             KeyConstants.ERROR_PERCENT_EFFORT_LESS_THAN_PERCENT_CHARGED);
     errorFound = true;
   }
   errorFound =
       errorFound
           || personnelDatesCheck(
               selectedBudgetLineItem,
               budgetPersonnelDetails,
               selectedBudgetPeriodIndex,
               selectedBudgetLineItemIndex,
               getLineToDelete(request));
   if (!errorFound) {
     BudgetPersonnelBudgetService budgetPersonnelBudgetService =
         KraServiceLocator.getService(BudgetPersonnelBudgetService.class);
     budgetPersonnelBudgetService.calculateBudgetPersonnelBudget(
         budget, selectedBudgetLineItem, budgetPersonnelDetails, getLineToDelete(request));
   }
   return mapping.findForward(Constants.MAPPING_BASIC);
 }