Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.OrderItemViewBean


     */
    public OrderItemViewBean buildViewBeanOrderItem(final RequestData requestData, final OrderItem orderItem) throws Exception {
        final Localization localization = requestData.getMarketAreaLocalization();
        final String localizationCode = localization.getCode();

        final OrderItemViewBean orderItemViewBean = new OrderItemViewBean();

        orderItemViewBean.setSkuCode(orderItem.getProductSkuCode());
        if(StringUtils.isNotEmpty(orderItem.getProductSkuCode())){
            ProductSku ProductSku = productService.getProductSkuByCode(orderItem.getProductSkuCode());
            orderItemViewBean.setName(ProductSku.getI18nName(localizationCode));
        }

        final BigDecimal price = orderItem.getPrice();
        if (price != null) {
            orderItemViewBean.setPrice(orderItem.getCurrency().formatPriceWithStandardCurrencySign(price));
        }

        orderItemViewBean.setQuantity(orderItem.getQuantity());

        final BigDecimal totalAmountOrderItem = orderItem.getTotalAmountOrderItem();
        if (totalAmountOrderItem != null) {
            orderItemViewBean.setAmount(orderItem.getCurrency().formatPriceWithStandardCurrencySign(totalAmountOrderItem));
        }
       
        return orderItemViewBean;
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.OrderItemViewBean

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.