Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Tax


        query.setParameter("siteId", adminBean.getSite().getSiteId());
        Iterator<?> iterator = query.getResultList().iterator();
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      Vector<JSONEscapeObject> vector = new Vector<JSONEscapeObject>();
        while (iterator.hasNext()) {
          Tax tax = (Tax) iterator.next();
          JSONEscapeObject jsonItem = new JSONEscapeObject();
          jsonItem.put("taxId", tax.getTaxId());
          jsonItem.put("taxName", tax.getTaxLanguage().getTaxName());
          jsonItem.put("taxRate", Format.getFloat(tax.getTaxRate()));
          vector.add(jsonItem);
        }
        jsonResult.put("taxes", vector);
        String jsonString = jsonResult.toHtmlString();
        response.setContentType("text/html");
View Full Code Here


       
        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

      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxId = Format.getLong(form.getTaxId());
        Long trProductCustId = Format.getLong(form.getTaxRegionProductCustId());
        TaxRegionProductCust taxRegionProductCust = (TaxRegionProductCust) em.find(TaxRegionProductCust.class, trProductCustId);
        Tax tax = (Tax) em.find(Tax.class, taxId);
       
        Iterator<?> iterator = taxRegionProductCust.getTaxes().iterator();
        while (iterator.hasNext()) {
          TaxRegionProductCustTax t = (TaxRegionProductCustTax) iterator.next();
          if (t.getTax().getTaxId().equals(tax.getTaxId())) {
              jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
              jsonResult.put("message", "Tax code already exist");
              streamWebService(response, jsonResult.toHtmlString());
            return null;
          }
View Full Code Here

          query.setParameter("published", form.getSrPublished());
        }
        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);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

        TaxListingActionForm form = (TaxListingActionForm) actionForm;
        String taxIds[] = form.getTaxIds();
       
        if (taxIds != null) {
          for (int i = 0; i < taxIds.length; i++) {
              Tax tax = new Tax();
              tax = TaxDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(taxIds[i]));
              em.remove(tax);
          }
        }
View Full Code Here

        String sql = "from Tax where siteId = :siteId";
        Query query = em.createQuery(sql);
        query.setParameter("siteId", Constants.SITE_SYSTEM);
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          Tax master = (Tax) iterator.next();
          Tax tax = new Tax();
          Set<Country> countries = tax.getCountries();
          Set<State> states = tax.getStates();
          PropertyUtils.copyProperties(tax, master);
          tax.setSite(site);
          tax.setTaxId(null);
          tax.setRecUpdateBy(userId);
          tax.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          tax.setRecCreateBy(userId);
          tax.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          tax.setTaxLanguages(null);
      tax.setCountries(countries);
      tax.setStates(states);
          Iterator<?> it = null;
          if (master.getCountries() != null) {
            it = master.getCountries().iterator();
            while (it.hasNext()) {
              Country mc = (Country) it.next();
              Country country = CountryDAO.loadByCountryName(site.getSiteId(), mc.getCountryName());
              tax.getCountries().add(country);
            }
          }
          if (master.getStates() != null) {
            it = master.getStates().iterator();
            while (it.hasNext()) {
              State mc = (State) it.next();
              State state = StateDAO.loadByStateName(site.getSiteId(), mc.getStateName());
              tax.getStates().add(state);
            }
          }
          em.persist(tax);
        }
  }
View Full Code Here

      form = new TaxMaintActionForm();
    }
   
    Site site = getAdminBean(request).getSite();
    initSiteProfiles(form, site);
    Tax tax = (Tax) em.find(Tax.class, Format.getLong(form.getTaxId()));
   
        GoogleTranslate translator = new GoogleTranslate(form.getFromLocale(), form.getToLocale());
       
        form.setTaxCodeLangFlag(true);
        form.setTaxNameLangFlag(true);
        form.setTaxCodeLang(translator.translate(tax.getTaxLanguage().getTaxCode()));
        form.setTaxNameLang(translator.translate(tax.getTaxLanguage().getTaxName()));
       
        initListInfo(form, tax);
        initSearchInfo(form, request);
   
    FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
View Full Code Here

      form = new TaxMaintActionForm();
    }
   
    Site site = getAdminBean(request).getSite();
    initSiteProfiles(form, site);
    Tax tax = (Tax) em.find(Tax.class, Format.getLong(form.getTaxId()));
    if (!form.isSiteProfileClassDefault()) {
      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;
View Full Code Here

    initSiteProfiles(form, adminBean.getSite());
        if (form == null) {
            form = new TaxMaintActionForm();
        }
    String taxId = request.getParameter("taxId");
        Tax tax = TaxDAO.load(adminBean.getSite().getSiteId(), Format.getLong(taxId));
        form.setMode("U");
    form.setTaxId(Format.getLong(tax.getTaxId()));
    form.setTaxCode(tax.getTaxLanguage().getTaxCode());
    form.setTaxName(tax.getTaxLanguage().getTaxName());
    form.setTaxRate(Format.getFloatObj4(tax.getTaxRate()));
    form.setPublished(String.valueOf(tax.getPublished()));
    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;
View Full Code Here

            HttpServletResponse response)
    throws Throwable {
   
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    TaxMaintActionForm form = (TaxMaintActionForm) actionForm;
    Tax tax = TaxDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(form.getTaxId()));
    em.remove(tax);
    ActionForward actionForward = actionMapping.findForward("removeSuccess");
    return actionForward;
  }
View Full Code Here

TOP

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

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.