Fix [ 1983672 ] Manufacturing: Don't use PO set/get methods

Solving get_Value part
Pending some reported in tracker
This commit is contained in:
Carlos Ruiz 2008-06-03 17:28:13 +00:00
parent 098cd34531
commit 69c5821477
12 changed files with 34 additions and 34 deletions

View File

@ -207,7 +207,7 @@ public class ColumnElementHandler extends AbstractElementHandler {
if (!recreateColumn) {
String oldDefault = (String) m_Column
.get_ValueOld("DefaultValue");
String newDefault = (String) m_Column.get_Value("DefaultValue");
String newDefault = m_Column.getDefaultValue();
if (oldDefault != null && oldDefault.length() == 0)
oldDefault = null;
if (newDefault != null && newDefault.length() == 0)

View File

@ -84,7 +84,7 @@ public class CreateGLAsset extends SvrProcess
pstmt = null;
pstmt = DB.prepareStatement(sql,get_TrxName());
if(asset.getA_Asset_ID()==0) {
Number groupId = (Number)JVLine.get_Value(I_CustomColumn.A_Asset_Group_ID);
Number groupId = (Number)JVLine.getA_Asset_Group_ID();
pstmt.setInt(1, groupId != null ? groupId.intValue() : 0);
} else
pstmt.setInt(1, asset.getA_Asset_Group_ID());

View File

@ -102,7 +102,7 @@ public class CreateInvoicedAsset extends SvrProcess
PreparedStatement pstmt1 = null;
pstmt1 = DB.prepareStatement(sqla,get_TrxName());
if(asset.getA_Asset_ID()==0) {
Number groupId = (Number)InvoiceLine.get_Value(I_CustomColumn.A_Asset_Group_ID);
Number groupId = (Number)InvoiceLine.getA_Asset_Group_ID();
pstmt1.setInt(1, groupId != null ? groupId.intValue() : 0);
} else
pstmt1.setInt(1, asset.getA_Asset_Group_ID());

View File

@ -58,7 +58,7 @@ public class MAlertRecipient extends X_AD_AlertRecipient
*/
public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value("AD_User_ID");
Integer ii = super.getAD_User_ID();
if (ii == null)
return -1;
return ii.intValue();
@ -71,7 +71,7 @@ public class MAlertRecipient extends X_AD_AlertRecipient
*/
public int getAD_Role_ID ()
{
Integer ii = (Integer)get_Value("AD_Role_ID");
Integer ii = super.getAD_Role_ID();
if (ii == null)
return -1;
return ii.intValue();

View File

@ -94,11 +94,11 @@ public class MPInstancePara extends X_AD_PInstance_Para
if (getP_String_To() != null)
sb.append(" - ").append(getP_String_To());
}
BigDecimal bd = (BigDecimal)get_Value("P_Number");
BigDecimal bd = getP_Number();
if (bd != null)
{
sb.append("(n)=").append(bd);
BigDecimal bd2 = (BigDecimal)get_Value("P_Number_To");
BigDecimal bd2 = getP_Number_To();
if (bd2 != null)
sb.append(" - ").append(bd2);
}

View File

@ -72,7 +72,7 @@ public class MXIFAJournal extends X_I_FAJournal {
* Get Currency Type. Currency Conversion Rate Type
*/
public int getC_ConversionType_ID() {
Integer ii = (Integer) get_Value("C_ConversionType_ID");
Integer ii = getC_ConversionType_ID();
if (ii == null)
return 0;
return ii.intValue();

View File

@ -56,7 +56,7 @@ public class MPrintFont extends X_AD_PrintFont
{
if (m_cacheFont != null)
return m_cacheFont;
String code = (String)get_Value("Code");
String code = getCode();
if (code == null || code.equals("."))
m_cacheFont = new Font (null);
try

View File

@ -221,9 +221,9 @@ public class CommissionCalc extends SvrProcess
sql.append(" AND l.M_Product_ID IN "
+ "(SELECT M_Product_ID FROM M_Product WHERE M_Product_Category_ID=").append(lines[i].getM_Product_Category_ID()).append(")");
// Payment Rule
if (lines[i].get_Value("PaymentRule") != null)
if (lines[i].getPaymentRule() != null)
sql.append(" AND h.PaymentRule IN "
+ "(SELECT AD_Ref_List_ID FROM AD_Ref_List WHERE AD_Reference_ID=195 and value = '").append((String)lines[i].get_Value("PaymentRule")).append("')");
+ "(SELECT AD_Ref_List_ID FROM AD_Ref_List WHERE AD_Reference_ID=195 and value = '").append(lines[i].getPaymentRule()).append("')");
// Grouping
if (!m_com.isListDetails())
sql.append(" GROUP BY h.C_Currency_ID");

View File

@ -183,7 +183,7 @@ public class MCost extends org.compiere.model.MCost
{
boolean result = super.beforeSave(newRecord);
//setCumulatedAmt(getCumulatedAmt().add(getCurrentCostPriceLL()));
setCumulatedAmt(getCumulatedAmt().add((BigDecimal)get_Value("CurrentCostPrice")));
setCumulatedAmt(getCumulatedAmt().add(getCurrentCostPrice()));
return result;
}

View File

@ -679,7 +679,7 @@ public class MPPOrder extends X_PP_Order implements DocAction {
PP_Order_Workflow.setValue(AD_Workflow.getValue());
//PP_Order_Workflow.setQtyBatchSize(AD_Workflow.getQtyBatchSize());
PP_Order_Workflow.setWorkflowType(AD_Workflow.getWorkflowType());
PP_Order_Workflow.setQtyBatchSize((BigDecimal)AD_Workflow.get_Value("QtyBatchSize"));
PP_Order_Workflow.setQtyBatchSize(AD_Workflow.getQtyBatchSize());
PP_Order_Workflow.setName(AD_Workflow.getName());
PP_Order_Workflow.setAccessLevel(AD_Workflow.getAccessLevel());
PP_Order_Workflow.setAuthor(AD_Workflow.getAuthor());
@ -705,11 +705,11 @@ public class MPPOrder extends X_PP_Order implements DocAction {
PP_Order_Workflow.setSetupTime(AD_Workflow.getSetupTime());
PP_Order_Workflow.setMovingTime(AD_Workflow.getMovingTime());
PP_Order_Workflow.setProcessType(AD_Workflow.getProcessType()); */
PP_Order_Workflow.setS_Resource_ID((Integer)AD_Workflow.get_Value("S_Resource_ID"));
PP_Order_Workflow.setQueuingTime((Integer)AD_Workflow.get_Value("QueuingTime"));
PP_Order_Workflow.setSetupTime((Integer)AD_Workflow.get_Value("SetupTime"));
PP_Order_Workflow.setMovingTime((Integer)AD_Workflow.get_Value("MovingTime"));
PP_Order_Workflow.setProcessType((String)AD_Workflow.get_Value("ProcessType"));
PP_Order_Workflow.setS_Resource_ID(AD_Workflow.getS_Resource_ID());
PP_Order_Workflow.setQueuingTime(AD_Workflow.getQueuingTime());
PP_Order_Workflow.setSetupTime(AD_Workflow.getSetupTime());
PP_Order_Workflow.setMovingTime(AD_Workflow.getMovingTime());
PP_Order_Workflow.setProcessType(AD_Workflow.getProcessType());
// 4Layers
@ -726,18 +726,18 @@ public class MPPOrder extends X_PP_Order implements DocAction {
boolean ValidFromNode = true;
boolean ValidToNode = true;
//if (AD_WF_Node[g].getValidFrom() != null )
if ((Timestamp) AD_WF_Node[g].get_Value("ValidFrom")!= null )
if (AD_WF_Node[g].getValidFrom() != null)
{
//ValidFromNode = getDateStartSchedule().compareTo(AD_WF_Node[g].getValidFrom()) >= 0 ? true : false;
ValidFromNode = getDateStartSchedule().compareTo((Timestamp) AD_WF_Node[g].get_Value("ValidFrom")) >= 0 ? true : false;
ValidFromNode = getDateStartSchedule().compareTo(AD_WF_Node[g].getValidFrom()) >= 0 ? true : false;
}
//if (AD_WF_Node[g].getValidTo() != null )
if ((Timestamp)AD_WF_Node[g].get_Value("ValidTo") != null )
if (AD_WF_Node[g].getValidTo() != null )
{
//ValidToNode = getDateStartSchedule().compareTo(AD_WF_Node[g].getValidTo()) <= 0 ? true : false;
ValidToNode = getDateStartSchedule().compareTo((Timestamp)AD_WF_Node[g].get_Value("ValidTo")) <= 0 ? true : false;
ValidToNode = getDateStartSchedule().compareTo(AD_WF_Node[g].getValidTo()) <= 0 ? true : false;
}
if (ValidFromNode && ValidToNode)
@ -761,23 +761,23 @@ public class MPPOrder extends X_PP_Order implements DocAction {
PP_Order_Node.setSubflowExecution (AD_WF_Node[g].getSubflowExecution());
PP_Order_Node.setValue(AD_WF_Node[g].getValue());
//PP_Order_Node.setS_Resource_ID(AD_WF_Node[g].getS_Resource_ID());
PP_Order_Node.setS_Resource_ID(((Integer)AD_WF_Node[g].get_Value("S_Resource_ID")).intValue());
PP_Order_Node.setS_Resource_ID(AD_WF_Node[g].getS_Resource_ID());
//PP_Order_Node.setSetupTime(AD_WF_Node[g].getSetupTime());
PP_Order_Node.setSetupTime(((Integer)AD_WF_Node[g].get_Value("SetupTime")).intValue());
PP_Order_Node.setSetupTime(AD_WF_Node[g].getSetupTime());
//PP_Order_Node.setSetupTimeRequiered(AD_WF_Node[g].getSetupTime());
PP_Order_Node.setSetupTimeRequiered(((Integer)AD_WF_Node[g].get_Value("SetupTime")).intValue());
PP_Order_Node.setSetupTimeRequiered(AD_WF_Node[g].getSetupTime());
BigDecimal time = new BigDecimal(AD_WF_Node[g].getDuration()).multiply(getQtyOrdered());
PP_Order_Node.setDurationRequiered(time.intValue());
//PP_Order_Node.setMovingTime(AD_WF_Node[g].getMovingTime());
PP_Order_Node.setMovingTime(((Integer)AD_WF_Node[g].get_Value("MovingTime")).intValue());
PP_Order_Node.setMovingTime(AD_WF_Node[g].getMovingTime());
PP_Order_Node.setWaitingTime(AD_WF_Node[g].getWaitingTime());
PP_Order_Node.setWorkingTime(AD_WF_Node[g].getWorkingTime());;
//PP_Order_Node.setQueuingTime(AD_WF_Node[g].getQueuingTime());
PP_Order_Node.setQueuingTime(((Integer)AD_WF_Node[g].get_Value("QueuingTime")).intValue());
PP_Order_Node.setQueuingTime(AD_WF_Node[g].getQueuingTime());
PP_Order_Node.setXPosition(AD_WF_Node[g].getXPosition()); //e-evolution generatemodel
PP_Order_Node.setYPosition(AD_WF_Node[g].getYPosition()); //e-evolution generatemodel
//PP_Order_Node.setS_Resource_ID(AD_WF_Node[g].getS_Resource_ID());
PP_Order_Node.setS_Resource_ID(((Integer)AD_WF_Node[g].get_Value("S_Resource_ID")).intValue());
PP_Order_Node.setS_Resource_ID(AD_WF_Node[g].getS_Resource_ID());
PP_Order_Node.setDocAction(AD_WF_Node[g].getDocAction());
PP_Order_Node.save(get_TrxName());
@ -1396,7 +1396,7 @@ public class MPPOrder extends X_PP_Order implements DocAction {
PP_Order_Cost.setCumulatedAmt(cost[j].getCumulatedAmt());
PP_Order_Cost.setCumulatedQty(cost[j].getCumulatedQty());
//PP_Order_Cost.setCurrentCostPriceLL(cost[j].getCurrentCostPriceLL());
PP_Order_Cost.setCurrentCostPriceLL((BigDecimal)cost[j].get_Value("CurrentCostPriceLL"));
PP_Order_Cost.setCurrentCostPriceLL((BigDecimal)cost[j].get_Value("CurrentCostPriceLL")); // column doesn't exist !!!
PP_Order_Cost.setCurrentCostPrice(cost[j].getCurrentCostPrice());
PP_Order_Cost.setM_Product_ID(getM_Product_ID());
PP_Order_Cost.setM_AttributeSetInstance_ID(cost[j].getM_AttributeSetInstance_ID());

View File

@ -200,11 +200,11 @@ public class RollupWorkflow extends SvrProcess
{
MWFNode node = (MWFNode) nodes[i];
//BigDecimal rate = getRate(CostElementType , node.getS_Resource_ID() , AD_Org_ID , C_AcctSchema_ID , M_CostType_ID);
BigDecimal rate = getRate(CostElementType , ((Integer)node.get_Value("S_Resource_ID")).intValue() , AD_Org_ID , C_AcctSchema_ID , M_CostType_ID);
BigDecimal rate = getRate(CostElementType, node.getS_Resource_ID(), AD_Org_ID , C_AcctSchema_ID , M_CostType_ID);
String sql = "SELECT CASE WHEN ow.DurationUnit = 's' THEN 1 * ( (onode.SetupTime/ow.QtyBatchSize) + onode.Duration ) WHEN ow.DurationUnit = 'm' THEN 60 * ( (onode.SetupTime/ow.QtyBatchSize) + onode.Duration) WHEN ow.DurationUnit = 'h' THEN 3600 * ( (onode.SetupTime/ow.QtyBatchSize) + onode.Duration) WHEN ow.DurationUnit = 'Y' THEN 31536000 * ( (onode.SetupTime/ow.QtyBatchSize) + onode.Duration) WHEN ow.DurationUnit = 'M' THEN 2592000 * ( (onode.SetupTime/ow.QtyBatchSize) + onode.Duration ) WHEN ow.DurationUnit = 'D' THEN 86400 * ((onode.SetupTime/ow.QtyBatchSize) + onode.Duration) END AS load FROM AD_WF_Node onode INNER JOIN AD_Workflow ow ON (ow.AD_Workflow_ID = onode.AD_Workflow_ID) WHERE onode.AD_WF_Node_ID = ? AND onode.AD_Client_ID = ?" ;
int seconds = DB.getSQLValue(null,sql,node.getAD_WF_Node_ID(),node.getAD_Client_ID());
//int C_UOM_ID = DB.getSQLValue(null,"SELECT C_UOM_ID FROM M_Product WHERE S_Resource_ID = ? " , node.getS_Resource_ID());
int C_UOM_ID = DB.getSQLValue(null,"SELECT C_UOM_ID FROM M_Product WHERE S_Resource_ID = ? " , ((Integer)node.get_Value("S_Resource_ID")).intValue());
int C_UOM_ID = DB.getSQLValue(null,"SELECT C_UOM_ID FROM M_Product WHERE S_Resource_ID = ? " , node.getS_Resource_ID());
MUOM oum = new MUOM(getCtx(),C_UOM_ID,null);
if (oum.isHour())
{

View File

@ -86,12 +86,12 @@ public abstract class CRPDatasetFactory extends CRPReasoner implements CRPModel
MResourceType t = new MResourceType(Env.getCtx(), r.getS_ResourceType_ID(), null);
//BigDecimal utilization = r.getPercentUtilization();
BigDecimal utilization = (BigDecimal) r.get_Value("PercentUtilization");
BigDecimal utilization = r.getPercentUtilization();
BigDecimal dailyCapacity = null;
if(BigDecimal.ZERO.compareTo(utilization) < 0) {
//dailyCapacity = r.getDailyCapacity().divide(utilization.divide(new BigDecimal(100)), 8, BigDecimal.ROUND_HALF_DOWN);
dailyCapacity = ((BigDecimal)r.get_Value("DailyCapacity")).divide(utilization.divide(new BigDecimal(100)), 8, BigDecimal.ROUND_HALF_DOWN);
dailyCapacity = (r.getDailyCapacity()).divide(utilization.divide(new BigDecimal(100)), 8, BigDecimal.ROUND_HALF_DOWN);
}
else {
@ -275,7 +275,7 @@ public abstract class CRPDatasetFactory extends CRPReasoner implements CRPModel
protected BigDecimal getMaxRange(MResource r) {
//return r.getDailyCapacity().divide(r.getPercentUtilization().divide(new BigDecimal(100)));
return ((BigDecimal)r.get_Value("DailyCapacity")).divide(((BigDecimal)r.get_Value("PercentUtilization")).divide(new BigDecimal(100)));
return (r.getDailyCapacity()).divide((r.getPercentUtilization()).divide(new BigDecimal(100)));
}