Class QuoteHelper

Object
LineItemHelper
QuoteHelper
All Implemented Interfaces:
Reviewable

public class QuoteHelper extends LineItemHelper implements Reviewable
A helper class that assists in manipulating the quote object. Instance of this class can be obtained via call quoteProcessor.getHelper() from quote header logic.

Example:

  def isOpportunity = quoteProcessor.getHelper().getRoot().getInputByName("IsOpportunity")?.value
 
See Also:
  • Constructor Details

  • Method Details

    • findAllWithSKU

      public List<LineItemHelper.LineItem> findAllWithSKU(String sku)
      Retrieves a list of all line items that are for a particular sku
      Parameters:
      sku - The sku to search for
      Returns:
      The list of line items
    • isInReview

      public boolean isInReview()
      Checks if the user who triggered the calculation can do the review of the line items.

      Example:

      
       if (quoteProcessor.getHelper().isInReview()) {
           // Execute review-specific validation or calculations
       }
       
      Specified by:
      isInReview in interface Reviewable
      Returns:
      true if the quote is in a review workflow step and there is active review sub step for the current user, false otherwise
    • getReviewSubStep

      public LineItemHelper.ReviewSubStep getReviewSubStep()
      Gets the current review sub-step information.

      Example:

      
       def helper = quoteProcessor.getHelper()
       if (helper.isInReview()) {
           def label = helper.getReviewSubStep().label
           def userGroupName = helper.getReviewSubStep().userGroupName
       }
       
      Specified by:
      getReviewSubStep in interface Reviewable
      Returns:
      The review sub-step or null if the user is not in review
    • getItemsForReview

      public List<LineItemHelper.LineItem> getItemsForReview()
      Gets a list of line items that are assigned to the current user for review.

      This method returns the line items that are part of the current user's review scope. Only line items that have an active review assignment for the current user's review user group are included.

      Example:

      
       def helper = quoteProcessor.getHelper()
       if (helper.isInReview()) {
           def itemsForReview = helper.getItemsForReview()
           for (item in itemsForReview) {
               // Process each line item assigned for review
               api.logInfo("Reviewing item", item.lineId)
           }
       }
       
      Specified by:
      getItemsForReview in interface Reviewable
      Overrides:
      getItemsForReview in class LineItemHelper
      Returns:
      A list of LineItemHelper.LineItem objects for the current user's review, or an empty list if not in review or no items are assigned