Exemple #1
1
  @Override
  public void doBeforeRender(HstRequest request, HstResponse response) {
    // TODO Auto-generated method stub
    if (log.isInfoEnabled()) {
      log.info("This is Other Income page");
    }
    super.doBeforeRender(request, response);
    String whichITRForm =
        request.getRequestContext().getResolvedSiteMapItem().getParameter("whichITRForm");
    if (whichITRForm != null) {
      request.setAttribute("ITR2", whichITRForm);
    }

    if (log.isInfoEnabled()) {
      log.info(whichITRForm + " do before render whichITRForm");
    }
    request.setAttribute("Max_allowed_ITR1", eRROR_MAX_ALLOWED);
    // the following line of code is needed to add a field if the package is ITR3 or ITR4
    MemberPersonalInformation objMemberPersonalInformation =
        (MemberPersonalInformation)
            request.getAttribute(MemberPersonalInformation.class.getSimpleName().toLowerCase());
    if (objMemberPersonalInformation != null) {
      String packageName = objMemberPersonalInformation.getFlexField("flex_string_ITRForm", "");
      if ((!packageName.isEmpty()) && (packageName.equals("ITR3"))
          || (packageName.equals("ITR4"))) {
        request.setAttribute("ITR3_4", packageName);
      }
    }
  }
Exemple #2
0
 @Override
 protected boolean validate(HstRequest request, HstResponse response, FormMap formMap) {
   // TODO Auto-generated method stub
   boolean ret = super.validate(request, response, formMap);
   if (ret) {
     boolean con_exempt = true;
     String max_allowed_exempt =
         request.getRequestContext().getResolvedSiteMapItem().getParameter("max_allowed_exempt");
     String total_taxfree_income =
         getITRInitData(request).getFormMap().getField("Total_taxfree_income").getValue();
     MemberPersonalInformation personalinfo =
         (MemberPersonalInformation)
             request.getAttribute(MemberPersonalInformation.class.getSimpleName().toLowerCase());
     if (max_allowed_exempt != null) {
       if (personalinfo.getSelectedITRForm().toString().equals("ITR1")) {
         if (Integer.parseInt(total_taxfree_income) > Integer.parseInt(max_allowed_exempt)) {
           log.info("Exceed Over Limit For ITR1");
           eRROR_MAX_ALLOWED = "err.maxallowed.exceed";
           getITRInitData(request)
               .getFormMap()
               .addMessage("Total_taxfree_income", "err.maxallowed.exceed");
           con_exempt = false;
         } else {
           eRROR_MAX_ALLOWED = null;
         }
       }
     }
     return con_exempt;
   } else {
     return ret;
   }
 }
  /**
   * Retrieve the current StoreConfig from the HstRequest The config has been set by the Konakart
   * Valve
   *
   * @param request the hst request
   * @return the Konakart store config.
   */
  @Nonnull
  public KKStoreConfig getKKStoreConfig(@Nonnull HstRequest request) {
    KKStoreConfig kkStoreConfig =
        (KKStoreConfig) request.getAttribute(KKStoreConfig.KK_STORE_CONFIG);

    return checkNotNull(kkStoreConfig);
  }
  /**
   * Retrieve the Konakart client from the HstRequest. The client has been set by the Konakart
   * Valve.
   *
   * @param request the hst request
   * @return the Konakart client.
   */
  @Nonnull
  public KKAppEng getKKAppEng(@Nonnull HstRequest request) {
    KKAppEng kkAppEng = (KKAppEng) request.getAttribute(KKAppEng.KONAKART_KEY);

    return checkNotNull(kkAppEng);
  }