parent
f1c81b17b9
commit
0e6b5c6201
|
@ -16,16 +16,23 @@
|
|||
|
||||
package org.eevolution.process;
|
||||
|
||||
import java.util.logging.*;
|
||||
import java.math.*;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
||||
import org.compiere.model.*;
|
||||
import org.compiere.wf.*;
|
||||
import org.compiere.util.*;
|
||||
import org.compiere.process.*;
|
||||
import org.compiere.model.MCost;
|
||||
import org.compiere.model.MCostElement;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.MResource;
|
||||
import org.compiere.model.MUOM;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.wf.MWFNode;
|
||||
import org.compiere.wf.MWorkflow;
|
||||
import org.eevolution.model.MPPProductPlanning;
|
||||
|
||||
/**
|
||||
|
@ -87,16 +94,18 @@ public class RollupWorkflow extends SvrProcess
|
|||
List<Object> params = new ArrayList<Object>();
|
||||
params.add(getAD_Client_ID());
|
||||
if (p_M_Product_ID > 0) {
|
||||
whereClause.append(" AND p.M_Product_ID=?");
|
||||
whereClause.append(" AND M_Product_ID=?");
|
||||
params.add(p_M_Product_ID);
|
||||
}
|
||||
if (p_M_Product_Category_ID > 0){
|
||||
whereClause.append(" AND p.M_Product_Category_ID=?");
|
||||
params.add(p_M_Product_ID);
|
||||
whereClause.append(" AND M_Product_Category_ID=?");
|
||||
params.add(p_M_Product_Category_ID);
|
||||
}
|
||||
|
||||
List<MProduct> products = new Query(getCtx(),MProduct.Table_Name, whereClause.toString(), get_TrxName())
|
||||
.setOrderBy(MProduct.COLUMNNAME_LowLevel).setParameters(params).list();
|
||||
.setOrderBy(MProduct.COLUMNNAME_LowLevel)
|
||||
.setParameters(params)
|
||||
.list();
|
||||
|
||||
for (MProduct product : products)
|
||||
{
|
||||
|
@ -144,13 +153,11 @@ public class RollupWorkflow extends SvrProcess
|
|||
AD_Workflow_ID = pp.getAD_Workflow_ID();
|
||||
else
|
||||
AD_Workflow_ID = MWorkflow.getWorkflowSearchKey(getCtx(), product);
|
||||
|
||||
if(AD_Workflow_ID <= 0)
|
||||
return Env.ZERO;
|
||||
|
||||
MWorkflow Workflow = new MWorkflow(getCtx(),AD_Workflow_ID,get_TrxName());
|
||||
MWFNode[] nodes = Workflow.getNodes(false,getAD_Client_ID());
|
||||
|
||||
for (MWFNode node : nodes)
|
||||
{
|
||||
BigDecimal rate = getRate(CostElementType, node.getS_Resource_ID(), AD_Org_ID , C_AcctSchema_ID , M_CostType_ID);
|
||||
|
@ -160,7 +167,6 @@ public class RollupWorkflow extends SvrProcess
|
|||
MUOM uom = MUOM.get(getCtx(), C_UOM_ID);
|
||||
if (uom.isHour())
|
||||
{
|
||||
|
||||
BigDecimal time = new BigDecimal(seconds);
|
||||
cost = cost.add(time.multiply(rate).divide(new BigDecimal(3600),BigDecimal.ROUND_HALF_UP,12));
|
||||
log.info("Yes isHour" + seconds);
|
||||
|
|
Loading…
Reference in New Issue