Class ServicePriceUtils


  • public class ServicePriceUtils
    extends Object
    • Constructor Detail

      • ServicePriceUtils

        public ServicePriceUtils()
    • Method Detail

      • getRelatedAmountAndQty

        public static HashMap<String,​BigDecimal> getRelatedAmountAndQty​(OrderLine orderLine)
        Method that returns the total amount, quantity and price of all lines related to the given line
      • getProductPrice

        public static BigDecimal getProductPrice​(Date date,
                                                 PriceList priceList,
                                                 Product product)
        Method that returns the listPrice of a product in a Price List on a given date
        Parameters:
        date - Order Date of the Sales Order
        priceList - Price List assigned in the Service Price Rule Range
        product - Product to search in Price List
      • getServicePriceRule

        public static ServicePriceRule getServicePriceRule​(Product serviceProduct,
                                                           Date orderDate)
        Method that returns for a "Price Rule Based" Service product the Service Price Rule on the given date
        Parameters:
        serviceProduct - Service Product
        orderDate - Order Date of the Sales Order
      • getServicePriceRule

        public static ServicePriceRule getServicePriceRule​(Product serviceProduct,
                                                           Date orderDate,
                                                           String relatedLine)
        Method that returns for a "Price Rule Based" Service product the Service Price Rule on the given date
        Parameters:
        serviceProduct - Service Product
        orderDate - Order Date of the Sales Order
        relatedLine - Line related to the service
      • getNewLineNo

        public static Long getNewLineNo​(String orderId)
        Method that returns the next Line Number of a Sales Order
        Parameters:
        orderId - Order
      • deferredSaleAllowed

        public static org.codehaus.jettison.json.JSONObject deferredSaleAllowed​(OrderLine orderline,
                                                                                OrderLine orderLineToRelate)
        This method returns null json object if a deferred sale of a service can be done in orderline related to orderLineToRelate. If it is not possible it will return the json object with the error obtained.
        Parameters:
        orderline - Order Line in which the service deferred it is wanted to be added
        orderLineToRelate - Order Line to which the service is related
      • servicePriceRuleIsAfterDiscounts

        public static boolean servicePriceRuleIsAfterDiscounts​(OrderLine orderline,
                                                               BigDecimal linesTotalAmount,
                                                               BigDecimal totalPrice,
                                                               BigDecimal totalDiscounts,
                                                               BigDecimal unitDiscountsAmt)
        Check if certain Service Price Range for certain amount is 'After Discounts' or not
        Parameters:
        orderline - OrderLine