本文整理汇总了Java中org.compiere.model.PO.get_Value方法的典型用法代码示例。如果您正苦于以下问题:Java PO.get_Value方法的具体用法?Java PO.get_Value怎么用?Java PO.get_Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.model.PO
的用法示例。
在下文中一共展示了PO.get_Value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateActualQty
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
*
* @param dataEntry
* @param po
* @param colName
* @param isToClearChanged if <code>true</code>, then we assume that IsToClean has been change to 'Y'. In that case, we don't add the difference between old and new value, but just the new value
*/
private void updateActualQty(
final I_C_Flatrate_DataEntry dataEntry,
final I_C_Invoice_Candidate invoiceCand,
final String colName,
final boolean isToClearClanged)
{
final PO po = InterfaceWrapperHelper.getPO(invoiceCand);
BigDecimal oldValue = (BigDecimal)po.get_ValueOld(colName);
if (isToClearClanged || oldValue == null)
{
oldValue = BigDecimal.ZERO;
}
BigDecimal currentValue = (BigDecimal)po.get_Value(colName);
if (currentValue == null)
{
currentValue = BigDecimal.ZERO;
}
final BigDecimal diff = currentValue.subtract(oldValue);
dataEntry.setActualQty(dataEntry.getActualQty().add(diff));
}
示例2: MatchablePO
import org.compiere.model.PO; //导入方法依赖的package包/类
public MatchablePO(final PO poToMatch) {
if (!(poToMatch instanceof MInvoice)
&& !(poToMatch instanceof MOrder)) {
throw new IllegalArgumentException(poToMatch
+ " must be a MOrder or MInvoice");
}
this.poToMatch = poToMatch;
final Boolean isSOTrx = (Boolean) poToMatch
.get_Value(I_C_Order.COLUMNNAME_IsSOTrx);
if (isSOTrx == null) {
throw new IllegalArgumentException(poToMatch
+ " lacks a value for " + I_C_Order.COLUMNNAME_IsSOTrx);
}
soTrx = isSOTrx;
}
示例3: retrievePaymentTerm
import org.compiere.model.PO; //导入方法依赖的package包/类
@Cached
private MPaymentTerm retrievePaymentTerm(final PO poToMatch) {
final Integer paymentTermId = (Integer) poToMatch
.get_Value(I_C_Order.COLUMNNAME_C_PaymentTerm_ID);
if (paymentTermId == null) {
throw new IllegalArgumentException(poToMatch
+ " lacks a value for "
+ I_C_Order.COLUMNNAME_C_PaymentTerm_ID);
}
final MPaymentTerm paymentTerm = new MPaymentTerm(poToMatch
.getCtx(), paymentTermId, poToMatch.get_TrxName());
return paymentTerm;
}
示例4: assertPostedFlag
import org.compiere.model.PO; //导入方法依赖的package包/类
public AcctFactAssert assertPostedFlag(Object model, boolean isPosted)
{
Assert.assertNotNull("model is null", model);
PO po = InterfaceWrapperHelper.getPO(model);
Assert.assertNotNull("no PO found for model " + model, po);
final int idx = po.get_ColumnIndex("Posted");
Assert.assertTrue("Object " + po + " has no Posted column", idx >= 0);
final boolean isPostedActual;
final Object postedObj = po.get_Value(idx);
if (postedObj instanceof Boolean)
isPostedActual = ((Boolean)postedObj).booleanValue();
else if (postedObj instanceof String)
isPostedActual = "Y".equals(postedObj);
else
throw new AdempiereException("Unsupported Posted field type "+postedObj+" for model "+model);
Assert.assertEquals("Document's " + po + " Posted flag does not match expectation", isPosted, isPostedActual);
return this;
}
示例5: makeUnique
import org.compiere.model.PO; //导入方法依赖的package包/类
private static final void makeUnique(final PO to, final String columnName)
{
final IMsgBL msgBL = Services.get(IMsgBL.class);
final Properties ctx = Env.getCtx();
final Format formatter = new SimpleDateFormat("yyyyMMdd:HH:mm:ss");
final Timestamp timestamp = new Timestamp(System.currentTimeMillis());
final String timestampStr = formatter.format(timestamp);
final String username = Services.get(IUserDAO.class).retrieveUserFullname(Env.getAD_User_ID(ctx));
final String language = Env.getAD_Language(ctx);
final String msg = "(" + msgBL.getMsg(language, "CopiedOn", new String[] { timestampStr }) + " " + username + ")";
final String oldValue = (String)to.get_Value(columnName);
to.set_CustomColumn(columnName, oldValue + msg);
}
示例6: getDecodedValue
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* F3P: Decode value string, for each substring enclosed in @:
* COL= remaining value is interpreted as a column of the associated record
*
* @param sValue value to be decoded
* @param PO model object bound to the activity
*
*/
protected String getDecodedValue(String sValue, PO po)
{
String sRet = sValue;
if(sValue != null && sValue.startsWith("@"))
{
if(sValue.startsWith("@COL="))
{
Object o = po.get_Value(sValue.substring(5));
if(o != null)
sRet = o.toString();
}
}
return sRet;
}
示例7: isSOTrx
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Is SO Trx
*
* @return SO Trx or of not found true
*/
public boolean isSOTrx()
{
PO po = getPO();
if (po.get_ID() == 0)
return true;
// Is there a Column?
int index = po.get_ColumnIndex("IsSOTrx");
if (index < 0)
{
if (po.get_TableName().startsWith("M_"))
return false;
return true;
}
// we have a column
try
{
Boolean IsSOTrx = (Boolean)po.get_Value(index);
return IsSOTrx.booleanValue();
}
catch (Exception e)
{
log.error("", e);
}
return true;
}
示例8: getC_DocType_ID
import org.compiere.model.PO; //导入方法依赖的package包/类
private static int getC_DocType_ID(PO po)
{
int index = po.get_ColumnIndex("C_DocType_ID");
if (index != -1)
{
Integer ii = (Integer)po.get_Value(index);
// DocType does not exist - get DocTypeTarget
if (ii != null && ii.intValue() == 0)
{
index = po.get_ColumnIndex("C_DocTypeTarget_ID");
if (index != -1)
ii = (Integer)po.get_Value(index);
}
if (ii != null)
return ii.intValue();
}
return -1;
}
示例9: getChangeLog
import org.compiere.model.PO; //导入方法依赖的package包/类
private String getChangeLog(PO po)
{
StringBuffer sb = new StringBuffer();
for (int i = 0; i < po.get_ColumnCount(); i++)
{
if (!po.is_ValueChanged(i))
continue;
String columnName = po.get_ColumnName(i);
Object valueOld = po.get_ValueOld(i);
Object valueNew = po.get_Value(i);
if (sb.length() > 0)
sb.append("; ");
sb.append(columnName).append(":[").append(valueOld).append("]->[").append(valueNew).append("]");
}
return sb.toString();
}
示例10: getValueToCopy
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public Object getValueToCopy(final PO to, final PO from, final String columnName)
{
if (COLUMNNAMES_ToCopyDirectly.contains(columnName))
{
return from.get_Value(columnName);
}
//
// Fallback to super:
return super.getValueToCopy(to, from, columnName);
}
示例11: extractValue
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public Object extractValue(final Object model, final String columnName)
{
final PO po = InterfaceWrapperHelper.getPO(model);
final Object value = po.get_Value(columnName);
return value;
}
示例12: setUser_ID
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Set User from
* - (1) Responsible
* - (2) Document Sales Rep
* - (3) Document UpdatedBy
* - (4) Process invoker
* @param User_ID process invoker
*/
private void setUser_ID (Integer User_ID)
{
// Responsible
MWFResponsible resp = MWFResponsible.get(getCtx(), getAD_WF_Responsible_ID());
// (1) User - Directly responsible
int AD_User_ID = resp.getAD_User_ID();
// Invoker - get Sales Rep or last updater of Document
if (AD_User_ID == 0 && resp.isInvoker())
{
final PO po = getPO();
// (2) Doc Owner
final IDocument document = po != null ? Services.get(IDocumentBL.class).getDocumentOrNull(po) : null;
if (document != null)
{
AD_User_ID = document.getDoc_User_ID();
}
// (2) Sales Rep
if (AD_User_ID == 0 && po != null && po.get_ColumnIndex("SalesRep_ID") != -1)
{
Object sr = po.get_Value("SalesRep_ID");
if (sr != null && sr instanceof Integer)
AD_User_ID = ((Integer)sr).intValue();
}
// (3) UpdatedBy
if (AD_User_ID == 0 && po != null)
AD_User_ID = po.getUpdatedBy();
}
// (4) Process Owner
if (AD_User_ID == 0 && User_ID != null)
AD_User_ID = User_ID.intValue();
// Fallback
if (AD_User_ID == 0)
AD_User_ID = Env.getAD_User_ID(getCtx());
//
setAD_User_ID(AD_User_ID);
}
示例13: isNull
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Check if given columnName's value is null
*
* @param model
* @param columnName
* @return true if columnName's value is null
*/
public static boolean isNull(final Object model, final String columnName)
{
final PO po = getStrictPO(model);
if (po == null)
{
return true;
}
final Object value = po.get_Value(columnName);
return value == null;
}
示例14: createEvaluationContext
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public Evaluatee createEvaluationContext()
{
final Properties privateCtx = Env.deriveCtx(getCtx());
final PO po = getPO();
final POInfo poInfo = po.getPOInfo();
for (int i = 0; i < poInfo.getColumnCount(); i++)
{
final Object val;
final int dispType = poInfo.getColumnDisplayType(i);
if (DisplayType.isID(dispType))
{
// make sure we get a 0 instead of a null for foreign keys
val = po.get_ValueAsInt(i);
}
else
{
val = po.get_Value(i);
}
if (val == null)
{
continue;
}
if (val instanceof Integer)
{
Env.setContext(privateCtx, "#" + po.get_ColumnName(i), (Integer)val);
}
else if (val instanceof String)
{
Env.setContext(privateCtx, "#" + po.get_ColumnName(i), (String)val);
}
}
return Evaluatees.ofCtx(privateCtx, Env.WINDOW_None, false);
}
示例15: loadTable
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Load Table from Object Array
*
* @param pos array of POs
*/
@Override
public void loadTable(PO[] pos)
{
if (m_layout == null)
throw new UnsupportedOperationException("Layout not defined");
// Clear Table
setRowCount(0);
//
for (int i = 0; i < pos.length; i++)
{
PO myPO = pos[i];
int row = getRowCount();
setRowCount(row + 1);
for (int col = 0; col < m_layout.length; col++)
{
String columnName = m_layout[col].getColSQL();
Object data = myPO.get_Value(columnName);
if (data != null)
{
Class<?> c = m_layout[col].getColClass();
if (c == IDColumn.class)
data = new IDColumn(((Integer)data).intValue());
else if (c == Double.class)
data = new Double(((BigDecimal)data).doubleValue());
}
// store
setValueAt(data, row, col);
}
}
if (getShowTotals())
addTotals(m_layout);
autoSize();
log.info("Row(array)=" + getRowCount());
}