本文整理汇总了Java中org.compiere.model.PO.is_ValueChanged方法的典型用法代码示例。如果您正苦于以下问题:Java PO.is_ValueChanged方法的具体用法?Java PO.is_ValueChanged怎么用?Java PO.is_ValueChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.model.PO
的用法示例。
在下文中一共展示了PO.is_ValueChanged方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sponsorChange
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Implemented for US1026: aenderung Verguetungsplan (2011010610000028), R01A06
*
* @param sponsor
* @param type
* @return
*/
private String sponsorChange(final I_C_Sponsor sponsor, final int type)
{
if (type == ModelValidator.TYPE_BEFORE_NEW || type == ModelValidator.TYPE_BEFORE_CHANGE)
{
final PO po = InterfaceWrapperHelper.getPO(sponsor);
final Integer objOldSalaryGroupId = (Integer)po.get_ValueOld(I_C_Sponsor.COLUMNNAME_C_AdvCommissionSalaryGroup_ID);
final int oldSalaryGroupId = objOldSalaryGroupId == null ? 0 : objOldSalaryGroupId;
if (po.is_ValueChanged(I_C_Sponsor.COLUMNNAME_IsManualRank))
{
Services.get(ISponsorBL.class).onIsManualRankChange(sponsor, true, oldSalaryGroupId);
}
else if (po.is_ValueChanged(I_C_Sponsor.COLUMNNAME_C_AdvCommissionSalaryGroup_ID) && sponsor.isManualRank())
{
Services.get(ISponsorBL.class).onManualRankChange(sponsor, false, oldSalaryGroupId);
}
}
return null;
}
示例2: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(PO po, int type) throws Exception
{
if (I_C_Location.Table_Name.equals(po.get_TableName()))
{
if (po.isReplication())
{
// don't validate the postal if we got the record from replication
return null;
}
I_C_Location location = InterfaceWrapperHelper.create(po, I_C_Location.class);
if (type == TYPE_AFTER_NEW
|| (type == TYPE_AFTER_CHANGE && po.is_ValueChanged(I_C_Location.COLUMNNAME_Postal))
|| !location.isPostalValidated())
{
// TODO: add to SysConfig to be configurable if we want to deactivate it or not
// Services.get(ILocationBL.class).validatePostal(location);
}
}
return null;
}
示例3: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type) throws Exception
{
if (type == ModelValidator.TYPE_BEFORE_NEW || type == ModelValidator.TYPE_BEFORE_CHANGE)
{
if (type == ModelValidator.TYPE_BEFORE_NEW
|| po.is_ValueChanged(I_C_Sponsor_CondLine.COLUMNNAME_C_BPartner_ID)
|| po.is_ValueChanged(I_C_Sponsor_CondLine.COLUMNNAME_C_AdvCommissionCondition_ID))
{
final I_C_Sponsor_CondLine condLine = InterfaceWrapperHelper.create(po, I_C_Sponsor_CondLine.class);
if (condLine.getC_BPartner_ID() > 0)
{
if (condLine.getC_AdvCommissionCondition_ID() <= 0)
{
throw new FillMandatoryException(I_C_Sponsor_CondLine.COLUMNNAME_C_AdvCommissionCondition_ID);
}
}
else
{
condLine.setC_AdvCommissionCondition_ID(0);
}
}
}
return null;
}
示例4: isSourceChanged
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public boolean isSourceChanged(MViewMetadata mdata, PO sourcePO, int changeType)
{
final String sourceTableName = sourcePO.get_TableName();
final Set<String> sourceColumns = mdata.getSourceColumns(sourceTableName);
if (sourceColumns == null || sourceColumns.isEmpty())
return false;
if (changeType == ModelValidator.TYPE_AFTER_NEW || changeType == ModelValidator.TYPE_AFTER_DELETE)
{
return true;
}
for (String sourceColumn : sourceColumns)
{
if (sourcePO.is_ValueChanged(sourceColumn))
{
return true;
}
}
return false;
}
示例5: 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();
}
示例6: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type) throws Exception
{
if (type == TYPE_BEFORE_NEW || type == TYPE_BEFORE_CHANGE)
{
if (po.is_ValueChanged(I_C_Invoice_Candidate_Agg.COLUMNNAME_Classname))
{
final I_C_Invoice_Candidate_Agg icAgg = InterfaceWrapperHelper.create(po, I_C_Invoice_Candidate_Agg.class);
Services.get(IAggregationBL.class).evalClassName(icAgg);
}
// Note: we invalidate *every* candidate, so there is no need to use the different IInvoiceCandidateHandler implementations.
final IInvoiceCandDAO invoiceCandDB = Services.get(IInvoiceCandDAO.class);
invoiceCandDB.invalidateAllCands(po.getCtx(), po.get_TrxName());
}
return null;
}
示例7: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, int type) throws Exception
{
if (po instanceof MInvoiceLine)
{
invoiceLineChanged(po.getCtx(), (MInvoiceLine)po, type, po.get_TrxName());
}
else if (po instanceof MOrder)
{
if (ModelValidator.TYPE_BEFORE_CHANGE == type)
{
// find out if we have a prepay order that enters the status "waiting payment"
final MOrder order = (MOrder)po;
if (po.is_ValueChanged(I_C_Order.COLUMNNAME_DocStatus) && IDocument.STATUS_WaitingPayment.equals(order.getDocStatus()))
{
Services.get(IFreightCostBL.class).evalAddFreightCostLine(order);
}
}
}
return null;
}
示例8: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(PO po, int type) throws Exception
{
if (type == TYPE_AFTER_NEW || type == TYPE_AFTER_CHANGE)
{
if (isDocument())
{
if (!acceptDocument(po))
{
return null;
}
if (po.is_ValueChanged(IDocument.DocStatus) && Services.get(IDocumentBL.class).isDocumentReversedOrVoided(po))
{
voidDocOutbound(po);
}
}
if (isJustProcessed(po, type))
{
createDocOutbound(po);
}
}
return null;
}
示例9: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type) throws Exception
{
if (type != ModelValidator.TYPE_BEFORE_CHANGE && type != ModelValidator.TYPE_BEFORE_NEW)
{
return null;
}
final MCAdvComDoc comDoc = (MCAdvComDoc)po;
if (po.is_ValueChanged(I_C_AdvComDoc.COLUMNNAME_DateFact_Override))
{
if (comDoc.getDateFact_Override() != null)
{
final PO referencedDoc = comDoc.retrievePO();
final Timestamp referencedDocDate = Services.get(ICommissionFactCandBL.class).retrieveDateDocOfPO(referencedDoc);
if (referencedDocDate.after(comDoc.getDateFact_Override()))
{
return Msg.translate(po.getCtx(), ComDocValidator.MSG_ADV_COM_DATE_FACT_BEFORE_DATE_DOC);
}
}
}
if (po.is_ValueChanged(I_C_AdvComDoc.COLUMNNAME_DocStatus))
{
if (X_C_AdvComDoc.DOCSTATUS_Fertiggestellt.equals(comDoc.getDocStatus()))
{
comDoc.setIsProcessedByComSystem(false);
}
}
return null;
}
示例10: isPOValueChanged
import org.compiere.model.PO; //导入方法依赖的package包/类
private static final boolean isPOValueChanged(final PO po, final String columnName)
{
final int idx = po.get_ColumnIndex(columnName);
if (idx < 0)
{
log.warn("Column " + columnName + " not found for " + po + ". Considering it as not changed");
return false;
}
final boolean changed = po.is_ValueChanged(idx);
return changed;
}
示例11: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type) throws Exception
{
if (type != ModelValidator.TYPE_BEFORE_CHANGE && type != ModelValidator.TYPE_BEFORE_NEW)
{
return null;
}
if (!po.is_ValueChanged(I_M_ProductPrice.COLUMNNAME_UseScalePrice))
{
return null;
}
final I_M_ProductPrice productPrice = InterfaceWrapperHelper.create(po, I_M_ProductPrice.class);
if (!productPrice.isUseScalePrice())
{
return null;
}
final IProductPA productPA = Services.get(IProductPA.class);
// if the scalePrice doesn't exist yet, create a new one
final I_M_ProductScalePrice productScalePrice =
InterfaceWrapperHelper.create(productPA.retrieveOrCreateScalePrices(po.get_ID(), BigDecimal.ONE, true, po.get_TrxName()),
I_M_ProductScalePrice.class);
// copy the price from the productPrice
productScalePrice.setCommissionPoints(productPrice.getCommissionPoints());
InterfaceWrapperHelper.save(productScalePrice);
return null;
}
示例12: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type)
{
final I_AD_POProcessor processorDef = InterfaceWrapperHelper.create(po, I_AD_POProcessor.class);
if (type == TYPE_BEFORE_NEW || type == TYPE_BEFORE_CHANGE)
{
if (po.is_ValueChanged(I_AD_POProcessor.COLUMNNAME_IsActive))
{
if (processorDef.isActive())
{
register(processorDef);
}
else
{
unregister(processorDef, false);
}
}
if (po.is_ValueChanged(I_AD_POProcessor.COLUMNNAME_Classname))
{
unregister(processorDef, true);
register(processorDef);
}
if (po.is_ValueChanged(I_AD_POProcessor.COLUMNNAME_IsProcessDirectly))
{
setProcessDirectly(processorDef);
}
}
if (type == TYPE_BEFORE_DELETE)
{
unregister(processorDef, false);
}
return null;
}
示例13: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, final int type) throws Exception
{
if (type == ModelValidator.TYPE_AFTER_CHANGE || type == ModelValidator.TYPE_AFTER_NEW)
{
// If the Price List is Changed (may be because of a PricingSystem change) the prices in the order
// lines need to be updated.
if (po.is_ValueChanged(org.compiere.model.I_C_Order.COLUMNNAME_M_PriceList_ID))
{
final MOrder mOrder = (MOrder)po;
// Set Commission points in every order line
for (final MOrderLine ol : mOrder.getLines())
{
if (!MFreightCost.retriveFor(po.getCtx(), ol.getM_Product_ID(), po.get_TrxName()).isEmpty())
{
continue;
}
final I_C_OrderLine oline = InterfaceWrapperHelper.create(ol, I_C_OrderLine.class);
final IOrderLineBL olinebl = Services.get(IOrderLineBL.class);
// Put order line on the ignore list to avoid the updateDiscounts method
// from resetting the commission points in the order line modelValidator.
olinebl.ignore(ol.get_ID());
Services.get(IInstanceTriggerBL.class).setCommissionPoints(po.getCtx(), oline, false, po.get_TrxName());
Services.get(IInstanceTriggerBL.class).setCommissionPointsSum(po.getCtx(), oline, false, po.get_TrxName());
ol.saveEx();
olinebl.unignore(ol.get_ID());
}
Services.get(IOrderLineBL.class).updateDiscounts(po.getCtx(), mOrder, true, po.get_TrxName());
}
}
return null;
}
示例14: modelChange
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public String modelChange(final PO po, int type)
{
if (type != TYPE_BEFORE_CHANGE && type != TYPE_BEFORE_NEW)
{
return null;
}
if (!po.is_ValueChanged(I_C_OrderLine.COLUMNNAME_QtyReserved))
{
return null;
}
if (po instanceof MStorage)
{
final MStorage st = (MStorage)po;
if (st.getQtyReserved().signum() < 0)
{
st.setQtyReserved(BigDecimal.ZERO);
// no need for the warning & stacktrace for now.
// final AdempiereException ex = new AdempiereException("@" + C_OrderLine.ERR_NEGATIVE_QTY_RESERVED + "@. Setting QtyReserved to ZERO."
// + "\nStorage: " + st);
// logger.warn(ex.getLocalizedMessage(), ex);
logger.info(Services.get(IMsgBL.class).getMsg(po.getCtx(), "@" + C_OrderLine.ERR_NEGATIVE_QTY_RESERVED + "@. Setting QtyReserved to ZERO." + "\nStorage: " + st));
return null;
}
}
return null;
}
示例15: processMetadataChanges
import org.compiere.model.PO; //导入方法依赖的package包/类
private void processMetadataChanges(PO po, int type)
{
final I_AD_Table_MView mview = InterfaceWrapperHelper.create(po, I_AD_Table_MView.class);
if (TYPE_AFTER_NEW == type
|| (TYPE_AFTER_CHANGE == type && po.is_ValueChanged(I_AD_Table_MView.COLUMNNAME_IsValid) && mview.isValid()))
{
addMView(mview, false);
}
}