Package org.broadleafcommerce.common.currency.domain

Examples of org.broadleafcommerce.common.currency.domain.BroadleafCurrency


        brc.setMessageSource(messageSource);
       
        TimeZone timeZone = broadleafTimeZoneResolver.resolveTimeZone(request);
        brc.setTimeZone(timeZone);

        BroadleafCurrency currency = currencyResolver.resolveCurrency(request);
        brc.setBroadleafCurrency(currency);

        prepareSandBox(request, brc);
    }
View Full Code Here


        return brc.getJavaLocale();
    }

    @Override
    protected Currency getCurrency(ExtractValueRequest extractValueRequest, Property property) {
        BroadleafCurrency bc = null;
        if (extractValueRequest.getEntity() instanceof Product && isDefaultSkuProperty(extractValueRequest, property)) {
            Product p = (Product) extractValueRequest.getEntity();
            bc = p.getDefaultSku().getCurrency();
        } else if (extractValueRequest.getEntity() instanceof Sku) {
            Sku s = (Sku) extractValueRequest.getEntity();
            bc = s.getCurrency();
        }
       
        if (bc == null) {
            BroadleafRequestContext brc = BroadleafRequestContext.getBroadleafRequestContext();
            return brc.getJavaCurrency();
        } else {
            return Currency.getInstance(bc.getCurrencyCode());
        }
    }
View Full Code Here

public class BroadleafCurrencyProvider {
 
    @DataProvider(name = "USCurrency")
    public static Object[][] provideUSCurrency() {
        BroadleafCurrency currency=new BroadleafCurrencyImpl();
        currency.setCurrencyCode("USD");
        currency.setDefaultFlag(true);
        currency.setFriendlyName("US Dollar");
       
        return new Object[][] { { currency } };
    }
View Full Code Here

       
        return new Object[][] { { currency } };
    }
    @DataProvider(name = "FRCurrency")
    public static Object[][] provideFRCurrency() {
        BroadleafCurrency currency=new BroadleafCurrencyImpl();
        currency.setCurrencyCode("EUR");
        currency.setDefaultFlag(true);
        currency.setFriendlyName("EURO Dollar");
        return new Object[][] { { currency } };
    }
View Full Code Here

*/
public class PromotableOfferUtility {
   
    public static Money computeAdjustmentValue(Money currentPriceDetailValue, BigDecimal offerUnitValue, OfferHolder offerHolder, PromotionRounding rounding) {
        Offer offer = offerHolder.getOffer();
        BroadleafCurrency currency = offerHolder.getCurrency();

        OfferDiscountType discountType = offer.getDiscountType();
        Money adjustmentValue;
        if (currency != null) {
            adjustmentValue = new Money(currency);
View Full Code Here

    @Resource(name = "blUpdateCartServiceExtensionManager")
    protected UpdateCartServiceExtensionManager extensionManager;

    @Override
    public boolean currencyHasChanged() {
        BroadleafCurrency currency = findActiveCurrency();
        if (getSavedCurrency() == null) {
            setSavedCurrency(currency);
        } else if (getSavedCurrency() != currency){
            return true;
        }
View Full Code Here

    @Override
    public UpdateCartResponse copyCartToCurrentContext(Order currentCart) {
        if(currentCart.getOrderItems() == null){
            return null;
        }
        BroadleafCurrency currency = findActiveCurrency();
        if(currency == null){
            return null;
        }

        //Reprice order logic
View Full Code Here

        BroadleafRequestContext.setBroadleafRequestContext(brc);

        Locale locale = localeResolver.resolveLocale(request);
        TimeZone timeZone = broadleafTimeZoneResolver.resolveTimeZone(request);
        BroadleafCurrency currency = currencyResolver.resolveCurrency(request);
        // Assumes BroadleafProcess
        RequestDTO requestDTO = (RequestDTO) request.getAttribute(REQUEST_DTO_PARAM_NAME, WebRequest.SCOPE_REQUEST);
        if (requestDTO == null) {
            requestDTO = new RequestDTOImpl(request);
        }
View Full Code Here

        return resolveCurrency(new ServletWebRequest(request));
    }

    @Override
    public BroadleafCurrency resolveCurrency(WebRequest request) {
        BroadleafCurrency currency = null;

        // 1) Check request for currency
        currency = (BroadleafCurrency) request.getAttribute(CURRENCY_VAR, WebRequest.SCOPE_REQUEST);

        // 2) Check for a request parameter
View Full Code Here

                    fgOffers.remove(j);
                }
            }
            for (PromotableCandidateFulfillmentGroupOffer candidate : fgOffers) {
                if (potential.getTotalSavings().getAmount().equals(BankersRounding.zeroAmount())) {
                    BroadleafCurrency currency = order.getOrderCurrency();
                    if (currency != null) {
                        potential.setTotalSavings(new Money(BigDecimal.ZERO, currency.getCurrencyCode()));
                    } else {
                        potential.setTotalSavings(new Money(BigDecimal.ZERO));
                    }
                }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.currency.domain.BroadleafCurrency

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.