if (xCost != null)
retValue = xCost.getCurrentCostPrice();
}
if (retValue == null)
{
MProduct product = MProduct.get(getCtx(), cost.getM_Product_ID());
MAcctSchema as = MAcctSchema.get(getCtx(), cost.getC_AcctSchema_ID());
retValue = MCost.getLastInvoicePrice(product,
cost.getM_AttributeSetInstance_ID(), cost.getAD_Org_ID(), as.getC_Currency_ID());
}
}
// Last PO Price
else if (to.equals(TO_LastPOPrice))
{
MCostElement ce = getCostElement(TO_LastPOPrice);
if (ce != null)
{
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID());
if (xCost != null)
retValue = xCost.getCurrentCostPrice();
}
if (retValue == null)
{
MProduct product = MProduct.get(getCtx(), cost.getM_Product_ID());
MAcctSchema as = MAcctSchema.get(getCtx(), cost.getC_AcctSchema_ID());
retValue = MCost.getLastPOPrice(product,
cost.getM_AttributeSetInstance_ID(), cost.getAD_Org_ID(), as.getC_Currency_ID());
}
}