Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.TaxLanguage


        Iterator<?> taxesIterator = cust.getTaxes().iterator();
        Vector<JSONEscapeObject> taxesVector = new Vector<JSONEscapeObject>();
        while (taxesIterator.hasNext()) {
          TaxRegionProductCustTax trTax = (TaxRegionProductCustTax) taxesIterator.next();
          Tax tax = trTax.getTax();
        TaxLanguage taxLanguage = null;
        for (TaxLanguage language : tax.getTaxLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
            taxLanguage = language;
          }
        }
          JSONEscapeObject taxObj = new JSONEscapeObject();
          taxObj.put("taxRegionProductCustTaxId", trTax.getTaxRegionProductCustTaxId());
          taxObj.put("taxId", tax.getTaxId());
          taxObj.put("seqNum", trTax.getSeqNum());
          taxObj.put("taxName", taxLanguage.getTaxName());
          taxObj.put("taxRate", tax.getTaxRate());
          taxesVector.add(taxObj);
        }
        customer.put("taxes", taxesVector);
        customers.add(customer);
View Full Code Here


        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<TaxDisplayForm> vector = new Vector<TaxDisplayForm>();
        while (iterator.hasNext()) {
          Tax tax = (Tax) iterator.next();
          TaxLanguage taxLanguage = null;
          for (TaxLanguage language : tax.getTaxLanguages()) {
            if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
              taxLanguage = language;
            }
          }
        TaxDisplayForm taxDisplay = new TaxDisplayForm();
        taxDisplay.setTaxId(Format.getLong(tax.getTaxId()));
        taxDisplay.setTaxCode(taxLanguage.getTaxCode());
        taxDisplay.setTaxName(taxLanguage.getTaxName());
        taxDisplay.setTaxRate(Format.getFloatObj4(tax.getTaxRate()));
        taxDisplay.setPublished(String.valueOf(tax.getPublished()));
        vector.add(taxDisplay);
        }
        form.setTaxes(vector);
View Full Code Here

      form.setTaxCodeLang(tax.getTaxLanguage().getTaxCode());
      form.setTaxNameLang(tax.getTaxLanguage().getTaxName());
        boolean found = false;
        Long siteProfileClassId = form.getSiteProfileClassId();
        Iterator<?> iterator = tax.getTaxLanguages().iterator();
        TaxLanguage taxLanguage = null;
        while (iterator.hasNext()) {
          taxLanguage = (TaxLanguage) iterator.next();
          if (taxLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
            found = true;
            break;
          }
        }
        if (found) {
          if (taxLanguage.getTaxCode() != null) {
            form.setTaxCodeLangFlag(true);
            form.setTaxCodeLang(taxLanguage.getTaxCode());
          }
          if (taxLanguage.getTaxName() != null) {
            form.setTaxNameLangFlag(true);
            form.setTaxNameLang(taxLanguage.getTaxName());
          }
        }
    }
        initListInfo(form, tax);
        initSearchInfo(form, request);
View Full Code Here

    if (!form.isSiteProfileClassDefault()) {
      form.setTaxNameLang(form.getTaxName());
        boolean found = false;
        Long siteProfileClassId = form.getSiteProfileClassId();
        Iterator<?> iterator = tax.getTaxLanguages().iterator();
        TaxLanguage taxLanguage = null;
        while (iterator.hasNext()) {
          taxLanguage = (TaxLanguage) iterator.next();
          if (taxLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
            found = true;
            break;
          }
        }
        if (found) {
          if (taxLanguage.getTaxCode() != null) {
            form.setTaxCodeLangFlag(true);
            form.setTaxCodeLang(taxLanguage.getTaxCode());
          }
          if (taxLanguage.getTaxName() != null) {
            form.setTaxNameLangFlag(true);
            form.setTaxNameLang(taxLanguage.getTaxName());
          }
        }
    }
       
        initListInfo(form, tax);
View Full Code Here

    return mapping.findForward("success");
  }
 
  public void saveDefault(Tax tax, TaxMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    TaxLanguage taxLanguage = tax.getTaxLanguage();
    if (taxLanguage == null) {
      taxLanguage = new TaxLanguage();
      taxLanguage.setTax(tax);
      tax.getTaxLanguages().add(taxLanguage);
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, form.getSiteProfileClassDefaultId());
        taxLanguage.setSiteProfileClass(siteProfileClass);
        taxLanguage.setRecCreateBy(adminBean.getUser().getUserId());
        taxLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        tax.setTaxLanguage(taxLanguage);
    }
    taxLanguage.setTaxCode(form.getTaxCode());
    taxLanguage.setTaxName(form.getTaxName());
    taxLanguage.setRecUpdateBy(adminBean.getUser().getUserId());
    taxLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.persist(taxLanguage);
   
    tax.setTaxRate(Format.getFloatObj(form.getTaxRate()));
    tax.setPublished(Constants.PUBLISHED_NO);
    if (form.getPublished() != null && form.getPublished().equals(String.valueOf(Constants.PUBLISHED_YES))) {
View Full Code Here

      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteProfileClassId = form.getSiteProfileClassId();
      User user = adminBean.getUser();
      Iterator<?> iterator = tax.getTaxLanguages().iterator();
      boolean found = false;
      TaxLanguage taxLanguage = null;
      while (iterator.hasNext()) {
        taxLanguage = (TaxLanguage) iterator.next();
        if (taxLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          found = true;
          break;
        }
      }
      if (!found) {
        taxLanguage = new TaxLanguage();
        taxLanguage.setRecCreateBy(user.getUserId());
        taxLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        taxLanguage.setSiteProfileClass(siteProfileClass);
        taxLanguage.setTax(tax);
      }
      if (form.isTaxCodeLangFlag()) {
        taxLanguage.setTaxCode(form.getTaxCodeLang());
      }
      else {
        taxLanguage.setTaxCode(null);
      }
      if (form.isTaxNameLangFlag()) {
        taxLanguage.setTaxName(form.getTaxNameLang());
      }
      else {
        taxLanguage.setTaxName(null);
      }

      taxLanguage.setRecUpdateBy(user.getUserId());
      taxLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      em.persist(taxLanguage);
  }
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.TaxLanguage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.