Package org.openbravo.materialmgmt
Class ServicePriceUtils
- java.lang.Object
-
- org.openbravo.materialmgmt.ServicePriceUtils
-
public class ServicePriceUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
UNIQUE_QUANTITY
-
Constructor Summary
Constructors Constructor Description ServicePriceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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.static Long
getNewLineNo(String orderId)
Method that returns the next Line Number of a Sales Orderstatic BigDecimal
getProductPrice(Date date, PriceList priceList, Product product)
Method that returns the listPrice of a product in a Price List on a given datestatic HashMap<String,BigDecimal>
getRelatedAmountAndQty(OrderLine orderLine)
Method that returns the total amount, quantity and price of all lines related to the given linestatic BigDecimal
getServiceAmount(OrderLine orderline, BigDecimal linesTotalAmount, BigDecimal totalDiscounts, BigDecimal totalPrice, BigDecimal relatedQty, BigDecimal unitDiscountsAmt)
Method to obtain Service Amount to be added for a certain service order line based on selected product lines amountstatic BigDecimal
getServiceAmount(OrderLine orderline, BigDecimal linesTotalAmount, BigDecimal totalDiscounts, BigDecimal totalPrice, BigDecimal relatedQty, BigDecimal unitDiscountsAmt, org.codehaus.jettison.json.JSONObject relatedInfo)
static ServicePriceRule
getServicePriceRule(Product serviceProduct, Date orderDate)
Method that returns for a "Price Rule Based" Service product the Service Price Rule on the given datestatic 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 datestatic 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 notstatic org.codehaus.jettison.json.JSONObject
serviceReturnAllowedRFC(ShipmentInOutLine shipmentLine, Product serviceProduct, Date rfcOrderDate)
-
-
-
Field Detail
-
UNIQUE_QUANTITY
public static final String UNIQUE_QUANTITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getServiceAmount
public static BigDecimal getServiceAmount(OrderLine orderline, BigDecimal linesTotalAmount, BigDecimal totalDiscounts, BigDecimal totalPrice, BigDecimal relatedQty, BigDecimal unitDiscountsAmt)
Method to obtain Service Amount to be added for a certain service order line based on selected product lines amount
-
getServiceAmount
public static BigDecimal getServiceAmount(OrderLine orderline, BigDecimal linesTotalAmount, BigDecimal totalDiscounts, BigDecimal totalPrice, BigDecimal relatedQty, BigDecimal unitDiscountsAmt, org.codehaus.jettison.json.JSONObject relatedInfo)
-
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 OrderpriceList
- Price List assigned in the Service Price Rule Rangeproduct
- 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 ProductorderDate
- 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 ProductorderDate
- Order Date of the Sales OrderrelatedLine
- 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 addedorderLineToRelate
- Order Line to which the service is related
-
serviceReturnAllowedRFC
@Deprecated public static org.codehaus.jettison.json.JSONObject serviceReturnAllowedRFC(ShipmentInOutLine shipmentLine, Product serviceProduct, Date rfcOrderDate)
Method that returns a warning message if a service of a Return From Customer is not Returnable of the return period is expired.
-
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
-
-