Skip navigation links
atg.commerce.pricing

Class TaxPricingEngineImpl

    • Field Detail

      • CLASS_VERSION

        public static java.lang.String CLASS_VERSION
        Class version string
    • Constructor Detail

      • TaxPricingEngineImpl

        public TaxPricingEngineImpl()
    • Method Detail

      • setPreCalculators

        public void setPreCalculators(TaxPricingCalculator[] pPreCalculators)
        Sets the PricingCalculators which are run before any discounts are applied
      • getPreCalculators

        public TaxPricingCalculator[] getPreCalculators()
        Gets the PricingCalculators which are run before any discounts are applied
      • setPrePromotionProcessing

        public void setPrePromotionProcessing(atg.commerce.pricing.PromotionProcessingComponent[] pPrePromotionProcessing)
        Sets property PrePromotionProcessing
      • getPrePromotionProcessing

        public atg.commerce.pricing.PromotionProcessingComponent[] getPrePromotionProcessing()
        Returns property PrePromotionProcessing
      • setPostCalculators

        public void setPostCalculators(TaxPricingCalculator[] pPostCalculators)
        Sets the PricingCalculators which are run after any discounts are applied
      • getPostCalculators

        public TaxPricingCalculator[] getPostCalculators()
        Gets the PricingCalculators which are run after any discounts are applied
      • getPricingModels

        public java.util.Collection getPricingModels(RepositoryItem pProfile)
        Returns a List of pricing models (e.g. promotions) for a given Profile.
        Specified by:
        getPricingModels in interface PricingEngine
        Parameters:
        pProfile - The user's profile from which the engine will extract promotions
        Returns:
        List of RepositoryItems which represent pricing models for use in pricing.
      • getCurrencyCode

        protected java.lang.String getCurrencyCode(Order pOrder,
                                                   java.util.Collection pPricingModels,
                                                   java.util.Locale pLocale,
                                                   RepositoryItem pProfile,
                                                   java.util.Map pExtraParameters)
                                            throws PricingException
        Return the currency code that should be used in the context of this pricing request
        Throws:
        PricingException - if an error occurs while attempting to determine the currency code
      • priceTax

        public TaxPriceInfo priceTax(Order pOrder,
                                     java.util.Collection pPricingModels,
                                     java.util.Locale pLocale,
                                     RepositoryItem pProfile,
                                     java.util.Map pExtraParameters)
                              throws PricingException
        Tax an order within a context. The context is represented by the input parameters.
        Specified by:
        priceTax in interface TaxPricingEngine
        Parameters:
        pOrder - The order to tax
        pPricingModels - A Collection of RepositoryItems representing PricingModels
        pLocale - The Locale to use for pricing
        pProfile - The user's profile
        pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
        Returns:
        TaxPriceInfo representing the tax quote for the order. Return null if no pricing info can be determined. This may occur if the order supplied is null.
        Throws:
        PricingException - if an error occurs while attempting to price
      • applyPromotions

        protected java.util.Collection<RepositoryItem> applyPromotions(java.util.Collection pPricingModels,
                                                                       TaxPriceInfo pTaxPriceQuote,
                                                                       PricingContext pPricingContext,
                                                                       java.util.Map pExtraParameters)
                                                                throws PricingException
        Apply the pricing models (promotions) to the Order being priced for tax. Evaluates the promotions and calls the associated calculator services to price the Order.
        Parameters:
        pPricingModels - Collection of PricingModel items
        pTaxPriceQuote - TaxPriceInfo for the Object being priced
        pPricingContext - PricingContext
        pExtraParameters - Map of extra parameters, may be null
        Returns:
        Collection of RepositoryItem promotions that were applied, i.e. weren't vetoed
        Throws:
        PricingException
      • applyCalculator

        protected void applyCalculator(java.lang.Object pCalc,
                                       TaxPriceInfo pTaxPriceQuote,
                                       PricingContext pPricingContext,
                                       java.util.Map pExtraParameters)
                                throws PricingException
        Calls the supplied calculator service to price an Order for tax.
        Parameters:
        pCalc - OrderPricingCalculator to call
        pTaxPriceQuote - TaxPriceInfo for the Order
        pPricingContext - PricingContext
        pExtraParameters - Map of extra parameters
        Throws:
        PricingException
      • checkPromotionsForCloseness

        public void checkPromotionsForCloseness(TaxPriceInfo pPriceInfo,
                                                Order pOrder,
                                                java.util.Collection pPricingModels,
                                                java.util.Locale pLocale,
                                                RepositoryItem pProfile,
                                                java.util.Map pExtraParameters)
                                         throws PricingException
        Check to see if the order qualifies under any of the pricingModels' "closenessQualifiers". If so, add the closenessQualifiers to the priceInfo.
        Parameters:
        pPriceInfo - The TaxPriceInfo object associated with the order.
        pOrder - The order to check
        pPricingModels - A Collection of RepositoryItems representing PricingModels
        pLocale - The Locale to use for pricing
        pProfile - The user's profile
        pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
        Throws:
        PricingException - if a problem occurred when checking for closeness
      • didPromotionQualify

        protected boolean didPromotionQualify(RepositoryItem pPricingModel,
                                              PricingContext pPricingContext,
                                              java.util.Map pExtraParameters)
                                       throws PricingException
        Determines if a promotion qualified or not. Returns true if the promotion qualified, false otherwise.
        Overrides:
        didPromotionQualify in class PricingEngineService
        Parameters:
        pPricingModel - promotion to check
        pPricingContext - PricingContext
        pExtraParameters - Map of extra parameters, may be null
        Returns:
        true if the promotion qualified, false otherwise
        Throws:
        PricingException - if something went wrong
      • getPriceInfoDetails

        protected java.util.List<AmountInfo> getPriceInfoDetails(PricingContext pPricingContext,
                                                                 java.util.Map pExtraParameters)
        Returns price info details for each item.
        Overrides:
        getPriceInfoDetails in class PricingEngineService
        Parameters:
        pPricingContext - PricingContext
        pExtraParameters - Map of extra parameters, may be null
        Returns:
        true if the promotion qualified, false otherwise