Class ProductInfo


  • public class ProductInfo
    extends Object
    • Method Detail

      • getAccount

        public Account getAccount​(String AcctType,
                                  AcctSchema as,
                                  ConnectionProvider conn)
        Line Account from Product
        Parameters:
        AcctType - see ACCTTYPE_* (1..8)
        as - Accounting Schema
        Returns:
        Requested Product Account
      • getAccountDefault

        public Account getAccountDefault​(String AcctType,
                                         AcctSchema as,
                                         ConnectionProvider conn)
        Account from Accounting Schema defaults, then from default Product Category and finally from oldest Product Category
        Parameters:
        AcctType - see ACCTTYPE_* (1..8)
        as - accounting schema
        Returns:
        Requested Product Account
      • setQty

        public void setQty​(String qty,
                           String C_UOM_ID,
                           ConnectionProvider conn)
        Set Quantity in UOM
        Parameters:
        qty - quantity
        C_UOM_ID - UOM
      • getConvertedQty

        @Deprecated
        public static String getConvertedQty​(String qty,
                                             String C_UOM_From_ID,
                                             String C_UOM_To_ID,
                                             String StdPrecision,
                                             ConnectionProvider conn)
        Deprecated.
        should not be used
        Get Converted Qty
        Parameters:
        qty - The quantity to be converted
        C_UOM_From_ID - The C_UOM_ID of the qty
        C_UOM_To_ID - The targeted UOM
        StdPrecision - if true, standard precision, if false costing precision
        Returns:
        amount
      • getProductDefaultCosts

        public String getProductDefaultCosts​(String date,
                                             BigDecimal _qty,
                                             Organization org,
                                             Warehouse wh,
                                             Currency currency)
                                      throws OBException
        Calculates the total cost of a product in the currency of the organizations Legal Entity. Used for products that are not stocked items. For stocked items get the cost from the corresponding material transaction record.
        Parameters:
        date - The date of the document being posted.
        _qty - The product quantity of the document, when empty existing m_qty is used.
        org - Organization of the document.
        wh - Warehouse of the document.
        Returns:
        String representing the total cost of the product.
        Throws:
        OBException - When the Product does not have a standard cost defined for the given date on the organization's Legal Entity