Search in sources :

Example 6 with MElementValue

use of org.compiere.model.MElementValue in project adempiere by adempiere.

the class Charge method createElementValue.

//  dynInit
/**************************************************************************
	 *  Create ElementValue for primary AcctSchema
	 *  @param value value
	 *  @param name name
	 *  @param isExpenseType is expense
	 *  @return element value
	 */
protected int createElementValue(String value, String name, boolean isExpenseType) {
    log.config(name);
    //
    MElementValue ev = new MElementValue(Env.getCtx(), value, name, null, isExpenseType ? MElementValue.ACCOUNTTYPE_Expense : MElementValue.ACCOUNTTYPE_Revenue, MElementValue.ACCOUNTSIGN_Natural, false, false, null);
    ev.setAD_Org_ID(m_AD_Org_ID);
    ev.setC_Element_ID(m_C_Element_ID);
    if (!ev.save())
        log.log(Level.WARNING, "C_ElementValue_ID not created");
    return ev.getC_ElementValue_ID();
}
Also used : MElementValue(org.compiere.model.MElementValue)

Aggregations

MElementValue (org.compiere.model.MElementValue)6 BigDecimal (java.math.BigDecimal)2 MAccount (org.compiere.model.MAccount)2 MPeriod (org.compiere.model.MPeriod)2 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1 TreeMap (java.util.TreeMap)1 MPriceList (org.compiere.model.MPriceList)1 MPriceListVersion (org.compiere.model.MPriceListVersion)1 MProduct (org.compiere.model.MProduct)1 MProductPrice (org.compiere.model.MProductPrice)1 Query (org.compiere.model.Query)1 X_I_ElementValue (org.compiere.model.X_I_ElementValue)1 X_M_Product_Acct (org.compiere.model.X_M_Product_Acct)1