Esempio n. 1
0
  /**
   * Set Product - Callout
   *
   * @param oldM_Product_ID old value
   * @param newM_Product_ID new value
   * @param windowNo window
   * @throws Exception
   */
  @UICallout
  public void setM_Product_ID(String oldM_Product_ID, String newM_Product_ID, int windowNo)
      throws Exception {
    if (newM_Product_ID == null || newM_Product_ID.length() == 0) return;
    int M_Product_ID = Integer.parseInt(newM_Product_ID);

    super.setM_Product_ID(M_Product_ID);
    if (M_Product_ID == 0) return;

    //	Employee
    MTimeExpense hdr = new MTimeExpense(getCtx(), getS_TimeExpense_ID(), null);
    int C_BPartner_ID = hdr.getC_BPartner_ID();
    BigDecimal Qty = getQty();
    boolean IsSOTrx = true;
    MProductPricing pp =
        new MProductPricing(
            getAD_Client_ID(), getAD_Org_ID(), M_Product_ID, C_BPartner_ID, Qty, IsSOTrx);
    //
    int M_PriceList_ID = hdr.getM_PriceList_ID();
    pp.setM_PriceList_ID(M_PriceList_ID);
    Timestamp orderDate = getDateExpense();
    pp.setPriceDate(orderDate);
    //
    setExpenseAmt(pp.getPriceStd());
    setC_Currency_ID(pp.getC_Currency_ID());
    setAmt(windowNo, "M_Product_ID");
    setC_UOM_ID(pp.getC_UOM_ID()); // Setting UOM for the Selected product
  } //	setM_Product_ID
Esempio n. 2
0
 /**
  * Get C_Currency_ID of Report (Price List)
  *
  * @return currency
  */
 public int getC_Currency_Report_ID() {
   if (m_C_Currency_Report_ID != 0) return m_C_Currency_Report_ID;
   //	Get it from header
   MTimeExpense te = new MTimeExpense(getCtx(), getS_TimeExpense_ID(), get_Trx());
   m_C_Currency_Report_ID = te.getC_Currency_ID();
   return m_C_Currency_Report_ID;
 } //	getC_Currency_Report_ID