Examples of Tax


Examples of com.jada.jpa.entity.Tax

            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

Examples of com.jada.jpa.entity.Tax

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    initSiteProfiles(form, site);

    Tax tax = new Tax();
    if (!insertMode) {
      tax = TaxDAO.load(site.getSiteId(), Format.getLong(form.getTaxId()));
    }

    ActionMessages errors = validate(form);
    if (errors.size() != 0) {
      saveMessages(request, errors);
          initListInfo(form, tax);
          initSearchInfo(form, request);
          if (insertMode) {
              FormUtils.setFormDisplayMode(request, form, FormUtils.CREATE_MODE);
          }
          else {
              FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
          }
      return mapping.findForward("error");
    }

    if (insertMode) {
      tax.setRecCreateBy(adminBean.getUser().getUserId());
      tax.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      tax.setSite(site);
    }
   
    if (form.isSiteProfileClassDefault()) {
      saveDefault(tax, form, adminBean);
      if (insertMode) {
        em.persist(tax);
      }
    }
    else {
      saveLanguage(tax, form, adminBean);     
    }
        form.setTaxId(Format.getLong(tax.getTaxId()));
    form.setMode("U");
       
        initListInfo(form, tax);
        initSearchInfo(form, request);
       
View Full Code Here

Examples of com.jada.jpa.entity.Tax

        TaxMaintActionForm form = (TaxMaintActionForm) actionForm;
    initSiteProfiles(form, getAdminBean(request).getSite());
    Site site = getAdminBean(request).getSite();
  
        Long taxId = Format.getLong(form.getTaxId());
        Tax tax = TaxDAO.load(site.getSiteId(), taxId);

        String countries[] = form.getCountries();
        if (countries != null) {
          for (int i = 0; i < countries.length; i++) {
              Country country = CountryDAO.load(site.getSiteId(), Format.getLong(countries[i]));
            tax.getCountries().add(country);
          }
        }

        String states[] = form.getStates();
        if (states != null) {
          for (int i = 0; i < states.length; i++) {
              State state = StateDAO.load(site.getSiteId(), Format.getLong(states[i]));
            tax.getStates().add(state);
          }
        }
        em.flush();
        initListInfo(form, tax);
        initSearchInfo(form, request);
View Full Code Here

Examples of com.jada.jpa.entity.Tax

    initSiteProfiles(form, getAdminBean(request).getSite());
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        Site site = getAdminBean(request).getSite();
       
        Long taxId = Format.getLong(form.getTaxId());
        Tax tax = TaxDAO.load(site.getSiteId(), taxId);

        String removeCountries[] = form.getRemoveCountries();
        if (removeCountries != null) {
          for (int i = 0; i < removeCountries.length; i++) {
              Country country = CountryDAO.load(site.getSiteId(), Format.getLong(removeCountries[i]));
            tax.getCountries().remove(country);
          }
        }

        String removeStates[] = form.getRemoveStates();
        if (removeStates != null) {
          for (int i = 0; i < removeStates.length; i++) {
              State state = StateDAO.load(site.getSiteId(), Format.getLong(removeStates[i]));
            tax.getStates().remove(state);
          }
        }
        em.flush();
       
        initListInfo(form, tax);
View Full Code Here

Examples of com.jada.jpa.entity.Tax

      ItemTax taxes[] = shoppingCart.getTaxes();
       Vector<ShoppingCartTaxInfo> taxVector = new Vector<ShoppingCartTaxInfo>();
      if (taxes != null) {
        for (int i = 0; i < taxes.length; i++) {
          ShoppingCartTaxInfo taxInfo = new ShoppingCartTaxInfo();
          Tax tax = taxes[i].getTax();
          taxInfo.setTaxName(tax.getTaxLanguage().getTaxName());
          if (!contentBean.getContentSessionBean().isSiteProfileClassDefault()) {
            for (TaxLanguage language : tax.getTaxLanguages()) {
              if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentBean.getContentSessionKey().getSiteProfileClassId())) {
                if (language.getTaxName() != null) {
                  taxInfo.setTaxName(language.getTaxName());
                }
                break;
View Full Code Here

Examples of com.jada.jpa.entity.Tax

public class TaxDAO extends Tax {
  private static final long serialVersionUID = 93652739634851609L;

  public static Tax load(String siteId, Long taxId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Tax tax = (Tax) em.find(Tax.class, taxId);
    if (!tax.getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return tax;
  }
View Full Code Here

Examples of com.jada.jpa.entity.Tax

      int seqNum = -1;
      float total = amount;
      float taxAmount = 0;
      while (txTaxes.hasNext()) {
        TaxRegionProductCustTax txTax = (TaxRegionProductCustTax) txTaxes.next();
        Tax tax = txTax.getTax();
        if (tax.getPublished() != Constants.VALUE_YES) {
          continue;
        }
        if (txTax.getSeqNum() != seqNum) {
          total += taxAmount;
          taxAmount = 0;
        }
        ItemTax itemTax = new ItemTax();
        itemTax.setTax(tax);
        itemTax.setTaxRate(tax.getTaxRate().floatValue());
        itemTax.setTaxCode(tax.getTaxLanguage().getTaxCode());
        if (!contentSessionKey.isSiteProfileClassDefault()) {
          for (TaxLanguage language : tax.getTaxLanguages()) {
            if (language.getSiteProfileClass().getSiteProfileClassId().equals(contentSessionKey.getSiteProfileClassId())) {
              if (language.getTaxCode() != null) {
                itemTax.setTaxCode(language.getTaxCode());
              }
              break;
            }
          }
        }
        float value = Utility.round(tax.getTaxRate().floatValue() * total / 100, 2);
        itemTax.setTaxAmount(value);
        vector.add(itemTax);
        taxAmount += value;
        seqNum = txTax.getSeqNum();
      }
View Full Code Here

Examples of com.openbravo.ws.externalsales.Tax

    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Tax)) {
            return false;
        }
        Tax other = (Tax) obj;
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
                ((this.id == null && other.getId() == null) ||
                (this.id != null &&
                this.id.equals(other.getId()))) &&
                ((this.name == null && other.getName() == null) ||
                (this.name != null &&
                this.name.equals(other.getName()))) &&
                this.percentage == other.getPercentage();
        __equalsCalc = null;
        return _equals;
    }
View Full Code Here

Examples of net.virtuemart.www.externalsales.Tax

    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Tax)) {
            return false;
        }
        Tax other = (Tax) obj;
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
                ((this.id == null && other.getId() == null) ||
                (this.id != null &&
                this.id.equals(other.getId()))) &&
                ((this.name == null && other.getName() == null) ||
                (this.name != null &&
                this.name.equals(other.getName()))) &&
                this.percentage == other.getPercentage();
        __equalsCalc = null;
        return _equals;
    }
View Full Code Here

Examples of org.bigk.invoices.model.Tax

          + ") - start");
    }

    // read and set Tax object
    if (invoicePosition.getTaxId() != null) {
      Tax tax = taxesService.getTax(invoicePosition.getTaxId());
      invoicePosition.setTax(tax);
    }
   
    // set parent of this position
    invoicePosition.setInvoice(invoice);
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.