Package org.broadleafcommerce.common.money

Examples of org.broadleafcommerce.common.money.Money


        order = dataProvider.createBasicOrder();

        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offer1.setApplyDiscountToSalePrice(false);
        order.getOrderItems().get(0).setSalePrice(new Money(1D));
        order.getOrderItems().get(1).setSalePrice(new Money(1D));
        offerService.applyAndSaveOffersToOrder(offers, order);

        assertTrue(order.getTotalAdjustmentsValue().getAmount().doubleValue() == 0);

        verify();
View Full Code Here


        // Offer 1 back to nonCombinable but don't allow discount to the sale price
        // and make the sale price a better overall offer
        offer1.setCombinableWithOtherOffers(false);
        offer1.setApplyDiscountToSalePrice(false);
        order = dataProvider.createBasicOrder();
        order.getOrderItems().get(1).setSalePrice(new Money(10D));
        offerService.applyAndSaveOffersToOrder(offerListWithOneOffer, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 0);

        // Try again with two offers.   The second should be applied.  
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
View Full Code Here

        }
    }

    @Override
    public void setOrderSubTotalToPriceWithoutAdjustments() {
        Money calculatedSubTotal = calculateSubtotalWithoutAdjustments();
        order.setSubTotal(calculatedSubTotal);
    }
View Full Code Here

        order.setSubTotal(calculatedSubTotal);
    }
   
    @Override
    public void setOrderSubTotalToPriceWithAdjustments() {
        Money calculatedSubTotal = calculateSubtotalWithAdjustments();
        order.setSubTotal(calculatedSubTotal);
    }
View Full Code Here

        return false;
    }

    @Override
    public Money calculateOrderAdjustmentTotal() {
        Money orderAdjustmentTotal = BroadleafCurrencyUtils.getMoney(order.getCurrency());
        for (PromotableOrderAdjustment adjustment : candidateOrderOfferAdjustments) {
            orderAdjustmentTotal = orderAdjustmentTotal.add(adjustment.getAdjustmentValue());
        }
        return orderAdjustmentTotal;
    }
View Full Code Here

        return orderAdjustmentTotal;
    }

    @Override
    public Money calculateItemAdjustmentTotal() {
        Money itemAdjustmentTotal = BroadleafCurrencyUtils.getMoney(order.getCurrency());

        for (PromotableOrderItem item : getDiscountableOrderItems()) {
            itemAdjustmentTotal = itemAdjustmentTotal.add(item.calculateTotalAdjustmentValue());
        }
        return itemAdjustmentTotal;
    }
View Full Code Here

        return true;
    }
   
    @Override
    public Money calculateSubtotalWithoutAdjustments() {
        Money calculatedSubTotal = BroadleafCurrencyUtils.getMoney(order.getCurrency());
        for (PromotableOrderItem orderItem : getAllOrderItems()) {
            calculatedSubTotal = calculatedSubTotal.add(orderItem.calculateTotalWithoutAdjustments());
        }
        return calculatedSubTotal;
    }
View Full Code Here

        return calculatedSubTotal;
    }

    @Override
    public Money calculateSubtotalWithAdjustments() {
        Money calculatedSubTotal = BroadleafCurrencyUtils.getMoney(order.getCurrency());
        for (PromotableOrderItem orderItem : getAllOrderItems()) {
            calculatedSubTotal = calculatedSubTotal.add(orderItem.calculateTotalWithAdjustments());
        }
        return calculatedSubTotal;
    }
View Full Code Here

            payment.setBillingAddress(this.billingAddress.unwrap(request, context));
        }

        if (this.amount != null) {
            if (this.currency != null) {
                payment.setAmount(new Money(this.amount, this.currency));
            } else {
                payment.setAmount(new Money(this.amount));
            }
        }

        if (this.transactions != null && !this.transactions.isEmpty()) {
            for (PaymentTransactionWrapper transactionWrapper : this.transactions) {
View Full Code Here

    }
   
    private void doSliderRange(JspWriter outthrows JspException, IOException {
        List<Product> products = ((SearchFilterTag) getParent()).getProducts();

        Money min = null;
        Money max = null;
        BeanToPropertyValueTransformer valueTransformer = new BeanToPropertyValueTransformer(property, true);

        for (Product product : products) {
            Money propertyObject = (Money) valueTransformer.transform(product);
            if (propertyObject == null) {
                min = new Money(0D);
                max = new Money(0D);
            } else {
                min = propertyObject.min(min);
                max = propertyObject.max(max);
            }
        }

        String propertyCss = property.replaceAll("[.\\[\\]]", "_");
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.money.Money

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.