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.offer.service.discount.domain;
 
 
 import java.util.List;
 
 
 public interface PromotableOrderItemPriceDetail {
    
    
Adds the adjustment to the item's adjustment list and discounts the item's prices by the value of the adjustment.

Parameters:
itemAdjustment
 

Returns:
 
Returns true if this detail has nonCombinable adjustments. Used primarily with legacy offers (prior to 2.0)

Returns:
 
     boolean hasNonCombinableAdjustments();


    
Returns true if a notCombinableOffer or totalitarian offer was applied to this priceDetail.

Returns:
 
     boolean isTotalitarianOfferApplied();
    
    
Returns true if a non-combinable offer has been applied to this item.
 
     boolean isNonCombinableOfferApplied();

    
This method will check to see if the salePriceAdjustments or retailPriceAdjustments are better and remove those that should not apply.

Returns:
 
     void chooseSaleOrRetailAdjustments();

    
Removes all adjustments from this detail. Typically called when it has been determined that another "totalitarian" offer has been applied.
 
     void removeAllAdjustments();

    
Returns the promotion discounts applied to this detail object.

Returns:
 
     List<PromotionDiscountgetPromotionDiscounts();
    
    
Returns the times this item is being used as a promotionQualifier

Returns:
 
Returns the quantity associated with this priceDetail.

Returns:
 
     public int getQuantity();

    
Sets the quantity for this price detail.

Parameters:
quantity
 
    public void setQuantity(int quantity);

    
Return the parent promotableOrderItem
Returns the quantity of this item that can be used as a qualifier for the passed in itemOffer

Parameters:
itemOffer
Returns:
Returns the quantity of this item that can be used as a target for the passed in itemOffer

Parameters:
itemOffer
Returns:
Adds a promotionQualifier entry to this itemDetail. PromotionQualifiers record the fact that this item has been marked to be used as a qualifier for other items to receive a discount. If other conditions are met this qualifier will be finalized.

Parameters:
itemOffer
itemCriteria
qtyToMarkAsQualifier
Returns:
    PromotionQualifier addPromotionQualifier(PromotableCandidateItemOffer itemOfferOfferItemCriteria itemCriteriaint qtyToMarkAsQualifier);

    
Adds a promotionDiscount entry to this itemDetail. PromotionDiscounts record the fact that this item has been targeted to receive a discount. If other conditions are met this discount will be finalized so that it can then be set on the underlying orderItem.

Parameters:
itemOffer
itemCriteria
qtyToMarkAsTarget
    void addPromotionDiscount(PromotableCandidateItemOffer itemOfferOfferItemCriteria itemCriteriaint qtyToMarkAsTarget);

    
Returns the price to be used for this priceDetail taking into account whether or not the sales price can be used.

Parameters:
allowSalePrice
Returns:
    Money calculateItemUnitPriceWithAdjustments(boolean allowSalePrice);

    
Updates the target and qualifier quantities to indicate the number that are being used.
    void finalizeQuantities();

    
Clears target and qualifier quantities that were marked for a promotion that did not have enough qualifiers or targets to get applied.
    void clearAllNonFinalizedQuantities();

    
Creates a key that represents a unique priceDetail

Returns:
    String buildDetailKey();

    
Returns the final total for this item taking into account the finalized adjustments. Intended to be called after the adjustments have been finalized with a call chooseSaleOrRetailAdjustments().
Returns the total adjustment value as the sum of the adjustments times the quantity represented by this PriceDetail

Returns:
Checks to see that the discount quantities match the target quantities. If not, splits this item into two.

Returns:
Returns true if the sale adjustments should be used.

Returns:
    boolean useSaleAdjustments();
    boolean isAdjustmentsFinalized();
    void setAdjustmentsFinalized(boolean adjustmentsFinalized);

    
Copies the PromotableOrderItemPriceDetail without Qualifiers, Discounts, or Adjustments

Returns:
Copies the PromotableOrderItemPriceDetail with all Finalized Qualifiers, Discounts, and Adjustments

Returns:
New to GrepCode? Check out our FAQ X