Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * #%L
  * BroadleafCommerce Framework
  * %%
  * Copyright (C) 2009 - 2013 Broadleaf Commerce
  * %%
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.broadleafcommerce.core.order.fulfillment.domain;

This entity defines the bands that can be specified for BandedPriceFulfillmentOption. Bands work on the retail price of an Order and should be calculated as follows:

  1. The prices of all of the OrderItems in a org.broadleafcommerce.core.order.domain.FulfillmentGroup (which is obtained through their relationship with org.broadleafcommerce.core.order.domain.FulfillmentGroupItem are summed together
  2. The FulfillmentPriceBand should be looked up by getting the closest band less than the sum of the price
  3. If FulfillmentBand.getResultAmountType() returns org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType.RATE, then the cost for the fulfillment group is whatever is defined in FulfillmentBand.getResultAmount()
  4. If FulfillmentBand.getResultAmountType() returns org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType.PERCENTAGE, then the fulfillment cost is the percentage obtained by FulfillmentBand.getResultAmount() * retailPriceTotal
  5. If two bands have the same retail price minimum amount, the cheapest resulting amount is used

Author(s):
Phillip Verheyden
See also:
BandedPriceFulfillmentOption
public interface FulfillmentPriceBand extends FulfillmentBand {

    
Gets the minimum amount that this band is valid for. If the addition of all of the retail prices on all the org.broadleafcommerce.core.order.domain.OrderItems in a org.broadleafcommerce.core.order.domain.FulfillmentGroup comes to at least this amount, this band result amount will be applied to the fulfillment cost.

Returns:
the minimum retail price amount of the sum of the org.broadleafcommerce.core.order.domain.OrderItems in a org.broadleafcommerce.core.order.domain.FulfillmentGroup that this band qualifies for
    public BigDecimal getRetailPriceMinimumAmount();

    
Set the minimum amount that this band is valid for. If the addition of all of the retail prices on all the org.broadleafcommerce.core.order.domain.OrderItems in a org.broadleafcommerce.core.order.domain.FulfillmentGroup comes to at least this amount, this band result amount will be applied to the fulfillment cost.

Parameters:
minimumRetailPriceAmount - the minimum retail price amount from adding up the org.broadleafcommerce.core.order.domain.OrderItems in a org.broadleafcommerce.core.order.domain.FulfillmentGroup
    public void setRetailPriceMinimumAmount(BigDecimal retailPriceMinimumAmount);

    
Gets the BandedPriceFulfillmentOption that this band is associated to

Returns:
the associated BandedPriceFulfillmentOption
    public BandedPriceFulfillmentOption getOption();

    
Sets the BandedPriceFulfillmentOption to associate with this band

Parameters:
option
    public void setOption(BandedPriceFulfillmentOption option);
New to GrepCode? Check out our FAQ X