Examples of TaxRegionProductCust


Examples of com.jada.jpa.entity.TaxRegionProductCust

      jsonResult.put("productClassName", trProduct.getProductClass().getProductClassName());
     
      Vector<JSONEscapeObject> customers = new Vector<JSONEscapeObject>();
      Iterator<?> custIterator = trProduct.getCustomerClasses().iterator();
      while (custIterator.hasNext()) {
        TaxRegionProductCust cust = (TaxRegionProductCust) custIterator.next();
        JSONEscapeObject customer = new JSONEscapeObject();
        customer.put("taxRegionProductCustId", cust.getTaxRegionProductCustId());
        customer.put("custClassId", cust.getCustomerClass().getCustClassId());
        customer.put("custClassName", cust.getCustomerClass().getCustClassName());
       
        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;
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
        Long taxRegionProductCustId = Format.getLong(form.getTaxRegionProductCustId());
        TaxRegionProductCust customer = (TaxRegionProductCust) em.find(TaxRegionProductCust.class, taxRegionProductCustId);
        customer.getTaxRegionProduct().getCustomerClasses().remove(customer);
/*
      Iterator<?> taxes = customer.getTaxes().iterator();
      while (taxes.hasNext()) {
        TaxRegionProductCustTax tax = (TaxRegionProductCustTax) taxes.next();
        em.remove(tax);
      }
*/
      em.remove(customer);
    String result = getJSONProduct(request, customer.getTaxRegionProduct());
    streamWebService(response, result);
      return null;
  }
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

        TaxRegionProduct taxRegionProduct = (TaxRegionProduct) em.find(TaxRegionProduct.class, trProductId);
        CustomerClass customerClass = (CustomerClass) em.find(CustomerClass.class, custClassId);
       
        Iterator<?> iterator = taxRegionProduct.getCustomerClasses().iterator();
        while (iterator.hasNext()) {
          TaxRegionProductCust c = (TaxRegionProductCust) iterator.next();
          if (c.getCustomerClass().getCustClassId().equals(customerClass.getCustClassId())) {
              jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
              jsonResult.put("message", "Customer class already exist");
              streamWebService(response, jsonResult.toHtmlString());
            return null;
          }
        }
       
        TaxRegionProductCust trProductCust = new TaxRegionProductCust();
        trProductCust.setTaxRegionProduct(taxRegionProduct);
        trProductCust.setCustomerClass(customerClass);
        trProductCust.setRecUpdateBy(adminBean.getUser().getUserId());
        trProductCust.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
        trProductCust.setRecCreateBy(adminBean.getUser().getUserId());
        trProductCust.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        taxRegionProduct.getCustomerClasses().add(trProductCust);
   
    em.persist(trProductCust);
   
    String result = getJSONProduct(request, taxRegionProduct);
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

      JSONEscapeObject jsonResult = new JSONEscapeObject();
      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;
          }
        }
       
        TaxRegionProductCustTax trProductCustTax = new TaxRegionProductCustTax();
        trProductCustTax.setTaxRegionProductCust(taxRegionProductCust);
        trProductCustTax.setTax(tax);
        trProductCustTax.setRecUpdateBy(adminBean.getUser().getUserId());
        trProductCustTax.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
        trProductCustTax.setRecCreateBy(adminBean.getUser().getUserId());
        trProductCustTax.setRecCreateDatetime(new Date(System.currentTimeMillis()));
   
    em.persist(trProductCustTax);
   
    String result = getJSONProduct(request, taxRegionProductCust.getTaxRegionProduct());
    streamWebService(response, result);
    return null;
  }
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long trProductCustId = Format.getLong(form.getTaxRegionProductCustId());
        TaxRegionProductCust taxRegionProductCust = (TaxRegionProductCust) em.find(TaxRegionProductCust.class, trProductCustId);
    
        String trProductCustTaxIds[] = form.getTaxRegionProductCustTaxIds();     
        for (int i = 0; i < trProductCustTaxIds.length; i++) {
          Long id = Format.getLong(trProductCustTaxIds[i]);
          TaxRegionProductCustTax tax = (TaxRegionProductCustTax) em.find(TaxRegionProductCustTax.class, id);
          tax.getTaxRegionProductCust().getTaxes().remove(tax);
          em.remove(tax);
        }
    String result = getJSONProduct(request, taxRegionProductCust.getTaxRegionProduct());
    streamWebService(response, result);
    return null;
  }
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

        HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
        Long trProductCustId = Format.getLong(form.getTaxRegionProductCustId());
        TaxRegionProductCust taxRegionProductCust = (TaxRegionProductCust) em.find(TaxRegionProductCust.class, trProductCustId);
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Hashtable<String, String> hashtable = new Hashtable<String, String>();
        int i = 0;
        while (true) {
          String seqNum = request.getParameter("seqNum_" + Integer.valueOf(i).toString());
          if (seqNum == null) {
            break;
          }
          if (!Format.isInt(seqNum)) {
            MessageResources resources = this.getResources(request);
              jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
              jsonResult.put("message", resources.getMessage("error.int.invalid"));
              streamWebService(response, jsonResult.toHtmlString());
            return null;
          }
          hashtable.put("seqNum_" + Integer.valueOf(i).toString(), seqNum);
           String taxRegionProductCustTaxId = request.getParameter("taxRegionProductCustTaxId_" + Integer.valueOf(i).toString());
          hashtable.put("tax_" + Integer.valueOf(i).toString(), taxRegionProductCustTaxId);
          i++;
        }
        i = 0;
        while (true) {
          String taxRegionProductCustTaxId = (String) hashtable.get("tax_" + Integer.valueOf(i).toString());
          if (taxRegionProductCustTaxId == null) {
            break;
          }
          TaxRegionProductCustTax trProductCustTax = (TaxRegionProductCustTax) em.find(TaxRegionProductCustTax.class, Format.getLong(taxRegionProductCustTaxId));
          String seqNum = (String) hashtable.get("seqNum_" + Integer.valueOf(i).toString());
          trProductCustTax.setSeqNum(Format.getInt(seqNum));
          em.persist(trProductCustTax);
          i++;
        }
    String result = getJSONProduct(request, taxRegionProductCust.getTaxRegionProduct());
    streamWebService(response, result);
    return null;
  }
View Full Code Here

Examples of com.jada.jpa.entity.TaxRegionProductCust

         continue;
      }
     
      found = false;
      iterator = txProduct.getCustomerClasses().iterator();
      TaxRegionProductCust txProductCust = null;
      while (iterator.hasNext()) {
        txProductCust = (TaxRegionProductCust) iterator.next();
        if (txProductCust.getCustomerClass().getCustClassId().equals(customerClass.getCustClassId())) {
          found = true;
          break;
        }
      }
      if (!found) {
        continue;
      }
     
      Iterator<TaxRegionProductCustTax> txTaxes = txProductCust.getTaxes().iterator();
      int seqNum = -1;
      float total = amount;
      float taxAmount = 0;
      while (txTaxes.hasNext()) {
        TaxRegionProductCustTax txTax = (TaxRegionProductCustTax) txTaxes.next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.