Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.Tax


        Criteria criteria = createDefaultCriteria(Tax.class);
       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);
       
        criteria.add(Restrictions.eq("id", taxId));
        Tax tax = (Tax) criteria.uniqueResult();
        if(tax != null){
            tax.setFetchPlan(fetchPlan);
        }
        return tax;
  }
View Full Code Here


        Criteria criteria = createDefaultCriteria(Tax.class);

        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);

        criteria.add(Restrictions.eq("code", handleCodeValue(taxCode)));
        Tax tax = (Tax) criteria.uniqueResult();
        if(tax != null){
            tax.setFetchPlan(fetchPlan);
        }
        return tax;
    }
View Full Code Here

  public Tax saveOrUpdateTax(final Tax tax) {
        if (tax.getId() != null) {
            if(em.contains(tax)){
                em.refresh(tax);
            }
            Tax mergedTax = em.merge(tax);
            em.flush();
            return mergedTax;
        } else {
            em.persist(tax);
            return tax;
View Full Code Here

        return deliveryMethodService.saveOrUpdateDeliveryMethod(deliveryMethod);
    }
   
    public Tax createOrUpdateTax(Tax tax, final TaxForm taxForm) {
        if (tax == null) {
            tax = new Tax();
        }
        if (StringUtils.isNotEmpty(taxForm.getCode())) {
            tax.setCode(taxForm.getCode());
        }
        if (StringUtils.isNotEmpty(taxForm.getName())) {
View Full Code Here

    public ModelAndView taxDetails(final HttpServletRequest request, final Model model) throws Exception {
        ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.TAX_DETAILS.getVelocityPage());
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String taxCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_TAX_CODE);
        final Tax tax = taxService.getTaxByCode(taxCode);
       
        // SANITY CHECK
        if(tax != null){
            modelAndView.addObject(ModelConstants.TAX_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanTax(requestData, tax));
        } else {
            final String url = requestUtil.getLastRequestUrl(request);
            return new ModelAndView(new RedirectView(url));
        }

        model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.TAX_LIST, requestData));
       
        Object[] params = {tax.getName() + " (" + tax.getCode() + ")"};
        overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.TAX_DETAILS.getKey(), params);

        return modelAndView;
    }
View Full Code Here

        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String taxCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_TAX_CODE);
        if(StringUtils.isNotEmpty(taxCode)){
            // EDIT MODE
            final Tax tax = taxService.getTaxByCode(taxCode);

            TaxViewBean taxViewBean = backofficeViewBeanFactory.buildViewBeanTax(requestData, tax);
            request.setAttribute(ModelConstants.TAX_VIEW_BEAN, taxViewBean);

            Object[] params = {tax.getName() + " (" + tax.getCode() + ")"};
            overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.TAX_EDIT.getKey(), params);

            model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.TAX_DETAILS, requestData, tax));
        } else {
            // ADD MODE
View Full Code Here

       
        if (result.hasErrors()) {
            return taxEdit(request, model, taxForm);
        }
       
        Tax tax = null;
        if(StringUtils.isNotEmpty(taxForm.getId())){
            tax = taxService.getTaxById(taxForm.getId());
        }

        try {
            // CREATE OR UPDATE TAX
            Tax savedTax = webBackofficeService.createOrUpdateTax(tax, taxForm);
           
            if (tax == null) {
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.TAX, "create_success_message", locale));
            } else {
                addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.TAX, "update_success_message", locale));
View Full Code Here

    protected TaxForm initTaxForm(final HttpServletRequest request, final Model model) throws Exception {
        final RequestData requestData = requestUtil.getRequestData(request);
       
        final String taxCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_TAX_CODE);
        if(StringUtils.isNotEmpty(taxCode)){
            final Tax taxEdit = taxService.getTaxByCode(taxCode);
            return backofficeFormFactory.buildTaxForm(requestData, taxEdit);
        }
       
        return backofficeFormFactory.buildTaxForm(requestData, null);
    }
View Full Code Here

        PagedListHolder<TaxViewBean> TaxViewBeanPagedListHolder = new PagedListHolder<TaxViewBean>();
       
        final List<TaxViewBean> TaxViewBeans = new ArrayList<TaxViewBean>();
        for (Iterator<Tax> iterator = taxs.iterator(); iterator.hasNext();) {
            Tax taxIt = (Tax) iterator.next();
            TaxViewBeans.add(backofficeViewBeanFactory.buildViewBeanTax(requestData, taxIt));
        }
        TaxViewBeanPagedListHolder = new PagedListHolder<TaxViewBean>(TaxViewBeans);
        TaxViewBeanPagedListHolder.setPageSize(Constants.PAGE_SIZE);
        request.getSession().setAttribute(sessionKey, TaxViewBeanPagedListHolder);
View Full Code Here

                    } else if (param instanceof DeliveryMethod) {
                        DeliveryMethod deliveryMethod = (DeliveryMethod) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_DELIVERY_METHOD_CODE, handleParamValue(deliveryMethod.getCode().toString()));
                        break;
                    } else if (param instanceof Tax) {
                        Tax tax = (Tax) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_TAX_CODE, handleParamValue(tax.getCode().toString()));
                        break;
                    } else if (param instanceof OrderCustomer) {
                        OrderCustomer order = (OrderCustomer) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_ORDER_NUM, handleParamValue(order.getOrderNum().toString()));
                        break;
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.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.