[ 2007264 ] Adding 2 parameter Org, Resource, Warehouse Create MRP

http://sourceforge.net/tracker/index.php?func=detail&aid=2007264&group_id=176962&atid=879335
Now the process execute direct insert and improve the performance, this is very useful when start implementation.
This commit is contained in:
vpj-cd 2008-07-01 05:07:22 +00:00
parent c41fa360c0
commit 86553f3279
3 changed files with 272 additions and 143 deletions

View File

@ -18,6 +18,7 @@ package org.eevolution.process;
import java.util.logging.*; import java.util.logging.*;
import java.math.BigDecimal;
import java.sql.*; import java.sql.*;
@ -34,19 +35,15 @@ import org.eevolution.model.MPPOrder;
/** /**
* MRPUpdate * MRPUpdate
* *
* @author Victor P<EFBFBD>rez, e-Evolution, S.C. * @author Victor Perez, e-Evolution, S.C.
* @version $Id: CreateCost.java,v 1.1 2004/06/22 05:24:03 vpj-cd Exp $
*/ */
public class MRPUpdate extends SvrProcess public class MRPUpdate extends SvrProcess
{ {
/** */ private int m_AD_Client_ID = 0;
/** */ private int p_AD_Org_ID = 0;
/*private int p_AD_Org_ID = 0; private int p_S_Resource_ID = 0 ;
//private int p_M_Warehouse_ID = 0; private int p_M_Warehouse_ID= 0;
private int p_S_Resource_ID = 0 ; private int Planner_ID= 0;
//
private String p_Version = "1";*/
private int AD_Client_ID = 0;
/** /**
@ -54,9 +51,32 @@ public class MRPUpdate extends SvrProcess
*/ */
protected void prepare() protected void prepare()
{ {
AD_Client_ID = getAD_Client_ID(); m_AD_Client_ID = Integer.parseInt(Env.getContext(getCtx(), "#AD_Client_ID"));
Planner_ID = Integer.parseInt(Env.getContext(getCtx(), "#AD_User_ID"));
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
if (para[i].getParameter() == null)
;
else if (name.equals("AD_Org_ID"))
{
p_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue();
}
else if (name.equals("S_Resource_ID"))
{
p_S_Resource_ID = ((BigDecimal)para[i].getParameter()).intValue();
}
else if (name.equals("M_Warehouse_ID"))
{
p_M_Warehouse_ID = ((BigDecimal)para[i].getParameter()).intValue();
}
else
log.log(Level.SEVERE,"prepare - Unknown Parameter: " + name);
}
} // prepare } // prepare
@ -64,34 +84,54 @@ public class MRPUpdate extends SvrProcess
protected String doIt() throws Exception protected String doIt() throws Exception
{ {
deleteMRP(); if(p_M_Warehouse_ID==0)
update(); {
return ""; MWarehouse[] ws = MWarehouse.getForOrg(getCtx(), p_AD_Org_ID);
for(MWarehouse w : ws)
{
deleteRecord(m_AD_Client_ID,p_AD_Org_ID,p_S_Resource_ID,w.getM_Warehouse_ID());
createRecord(m_AD_Client_ID,p_AD_Org_ID,p_S_Resource_ID,w.getM_Warehouse_ID());
}
}
else
{
deleteRecord(m_AD_Client_ID,p_AD_Org_ID,p_S_Resource_ID,p_M_Warehouse_ID);
createRecord(m_AD_Client_ID,p_AD_Org_ID,p_S_Resource_ID,p_M_Warehouse_ID);
}
return Msg.getMsg(getCtx(), "ProcessOK");
} }
public boolean deleteMRP() public boolean deleteRecord(int AD_Client_ID,int AD_Org_ID, int S_Resource_ID, int M_Warehouse_ID)
{ {
Trx trx = Trx.get("MRP Delete", true); Trx trx = Trx.get("MRP Delete", true);
String where = "";
String sql = "DELETE FROM PP_MRP WHERE TypeMRP = 'MOP' AND AD_Client_ID=" + AD_Client_ID; if (AD_Org_ID > 0 )
where = " AND AD_Org_ID=" + AD_Org_ID;
if (M_Warehouse_ID > 0 )
where = " AND M_Warehouse_ID=" + M_Warehouse_ID;
String sql = "DELETE FROM PP_MRP WHERE TypeMRP = 'MOP' AND AD_Client_ID=" + m_AD_Client_ID + where;
DB.executeUpdate(sql, trx.getTrxName());
sql = "DELETE FROM PP_MRP mrp WHERE mrp.TypeMRP = 'FCT' AND mrp.AD_Client_ID = " + m_AD_Client_ID+ where;
DB.executeUpdate(sql,trx.getTrxName());
sql = "DELETE FROM PP_MRP mrp WHERE mrp.TypeMRP = 'POR' AND mrp.AD_Client_ID = " + m_AD_Client_ID + where;
DB.executeUpdate(sql,trx.getTrxName());
if (AD_Org_ID > 0 )
sql = "DELETE FROM AD_Note n WHERE AD_Table_ID = " + MPPMRP.Table_ID + " AND AD_Client_ID = " + m_AD_Client_ID + " AND AD_Org_ID=" + AD_Org_ID;
else
sql = "DELETE FROM AD_Note n WHERE AD_Table_ID = " + MPPMRP.Table_ID + " AND AD_Client_ID = " + m_AD_Client_ID;
DB.executeUpdate(sql, trx.getTrxName()); DB.executeUpdate(sql, trx.getTrxName());
sql = "DELETE FROM PP_MRP mrp WHERE mrp.TypeMRP = 'FCT' AND mrp.AD_Client_ID = " + AD_Client_ID; if(S_Resource_ID> 0)
sql = "SELECT o.PP_Order_ID FROM PP_Order o WHERE o.DocStatus = 'DR' AND o.AD_Client_ID = " + m_AD_Client_ID + " AND S_Resource_ID=" + S_Resource_ID + where;
DB.executeUpdate(sql,trx.getTrxName()); else
sql = "SELECT o.PP_Order_ID FROM PP_Order o WHERE o.DocStatus = 'DR' AND o.AD_Client_ID = " + m_AD_Client_ID + where;
//sql = "DELETE FROM PP_MRP mrp WHERE mrp.TypeMRP = 'POR' AND EXISTS(SELECT M_Requisition_ID FROM M_Requisition r WHERE r.M_Requisition_ID = mrp.M_Requisition_ID AND (r.DocStatus='DR' AND r.DocStatus='CL')) AND mrp.AD_Client_ID = " + AD_Client_ID;
sql = "DELETE FROM PP_MRP mrp WHERE mrp.TypeMRP = 'POR' AND mrp.AD_Client_ID = " + AD_Client_ID;
DB.executeUpdate(sql,trx.getTrxName());
sql = "DELETE FROM AD_Note n WHERE AD_Table_ID = " + MPPMRP.Table_ID + " AND AD_Client_ID = " + AD_Client_ID;
DB.executeUpdate(sql, trx.getTrxName());
sql = "SELECT o.PP_Order_ID FROM PP_Order o WHERE o.DocStatus = 'DR' AND o.AD_Client_ID = " + AD_Client_ID;
try try
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
@ -103,8 +143,8 @@ public class MRPUpdate extends SvrProcess
MPPOrder order = new MPPOrder(getCtx(), rs.getInt(1), trx.getTrxName()); MPPOrder order = new MPPOrder(getCtx(), rs.getInt(1), trx.getTrxName());
order.delete(true); order.delete(true);
} }
rs.close(); DB.close(rs);
pstmt.close(); DB.close(pstmt);
} }
catch (Exception e) catch (Exception e)
@ -115,7 +155,7 @@ public class MRPUpdate extends SvrProcess
try try
{ {
sql = "SELECT r.M_Requisition_ID FROM M_Requisition r WHERE r.DocStatus = 'DR' AND r.AD_Client_ID = " + AD_Client_ID; sql = "SELECT r.M_Requisition_ID FROM M_Requisition r WHERE r.DocStatus = 'DR' AND r.AD_Client_ID = " + m_AD_Client_ID+ where;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
pstmt = DB.prepareStatement (sql,trx.getTrxName()); pstmt = DB.prepareStatement (sql,trx.getTrxName());
@ -134,8 +174,8 @@ public class MRPUpdate extends SvrProcess
r.delete(true); r.delete(true);
} }
rs.close(); DB.close(rs);
pstmt.close(); DB.close(pstmt);
} }
catch (Exception e) catch (Exception e)
@ -151,113 +191,132 @@ public class MRPUpdate extends SvrProcess
public boolean update() public boolean createRecord(int AD_Client_ID,int AD_Org_ID, int S_Resource_ID, int M_Warehouse_ID)
{ {
// Get Forcast String sql = "INSERT INTO pp_mrp("
String sql = "SELECT fl.M_FORECASTLINE_ID FROM M_FORECASTLINE fl WHERE fl.Qty > 0 AND fl.AD_Client_ID = " + AD_Client_ID; +"ad_org_id,created, createdby , dateordered,"
PreparedStatement pstmt = null; +"datepromised, datestart, datestartschedule, description,"
+"docstatus, isactive , "
try +"m_forecastline_id, m_forecast_id,"
{ +"pp_order_id,pp_order_bomline_id,"
pstmt = DB.prepareStatement (sql,get_TrxName()); +"c_order_id,c_orderline_id,"
//pstmt.setInt(1, p_M_Warehouse_ID); +"m_requisition_id,m_requisitionline_id,"
+"m_product_id, m_warehouse_id, "
ResultSet rs = pstmt.executeQuery(); +"pp_mrp_id, planner_id, "
while (rs.next()) +"qty, type, typemrp, updated, updatedby, value, "
{ +"ad_client_id )";
Trx trx = Trx.get("MRP Forecast", true); //Insert from M_ForecastLine
MForecastLine fl = new MForecastLine(Env.getCtx(),rs.getInt(1),get_TrxName()); String sql_insert = " SELECT t.ad_org_id,"
MPPMRP.M_ForecastLine(fl,false); +"t.created, t.createdby , t.datepromised,"
trx.commit(); +"t.datepromised, t.datepromised, t.datepromised, f.Name,"
} +"'IP', t.isactive , "
rs.close(); +"t.m_forecastline_id, t.m_forecast_id, "
pstmt.close(); + "null, null,"
} + "null, null,"
catch (Exception e) + "null, null,"
{ +"t.m_product_id, t.m_warehouse_id,"
log.log(Level.SEVERE,"doIt - " + sql, e); +"nextval('pp_mrp_id') , null,"
} +"t.qty, 'D', 'FCT', t.updated, t.updatedby, f.Name,"
+"t.ad_client_id "
//Get scheduled work order receipts +"FROM M_ForecastLine t INNER JOIN M_Forecast f ON (f.M_Forecast_ID=t.M_Forecast_ID) WHERE t.AD_Client_ID="+ AD_Client_ID;
sql = "SELECT * FROM PP_Order o WHERE (o.QtyOrdered - o.QtyDelivered) <> 0 AND o.DocStatus IN ('IP','CO') AND o.AD_Client_ID = " + AD_Client_ID;
try String where = "";
{
pstmt = DB.prepareStatement (sql,get_TrxName()); if (AD_Org_ID > 0 )
//pstmt.setInt(1, p_M_Warehouse_ID); where = " AND t.AD_Org_ID=" + AD_Org_ID;
ResultSet rs = pstmt.executeQuery (); if (M_Warehouse_ID > 0 )
while (rs.next()) where += " AND t.M_Warehouse_ID=" + M_Warehouse_ID;
{
Trx trx = Trx.get("MRP MO", true); Trx trx = Trx.get("MRP Forecast", true);
MPPOrder o = new MPPOrder(Env.getCtx(),rs,get_TrxName()); DB.executeUpdate(sql + sql_insert + where , trx.getTrxName());
MPPMRP.PP_Order(o); trx.commit();
trx.commit();
} //Insert from PP_Order
rs.close(); sql_insert = " SELECT t.ad_org_id,"
pstmt.close(); +"t.created, t.createdby , t.datepromised,"
+"t.datepromised, t.datepromised, t.datepromised, t.DocumentNo,"
} +"t.DocStatus, t.isactive , "
catch (Exception e) +" null, null, "
{ +"t.pp_order_id, -1,"
log.log(Level.SEVERE ,"doIt - " + sql, e); +" null, null, "
} +" null, null, "
+"t.m_product_id, t.m_warehouse_id,"
//Get sales order requirements and Get scheduled purchase order receipts +"nextval('pp_mrp_id') , null,"
sql = "SELECT ol.C_OrderLine_ID FROM C_OrderLine ol INNER JOIN C_Order o ON (o.C_Order_ID = ol.C_Order_ID) WHERE (ol.QtyOrdered - ol.QtyDelivered) <> 0 AND o.DocStatus IN ('IP','CO') AND ol.AD_Client_ID = " + AD_Client_ID; +"t.QtyOrdered-t.QtyDelivered, 'S', 'MOP', t.updated, t.updatedby, t.DocumentNo,"
pstmt = null; +"t.ad_client_id ";
if(S_Resource_ID > 0)
try sql_insert += "FROM PP_Order t WHERE (t.QtyOrdered - t.QtyDelivered) <> 0 AND t.DocStatus IN ('IP','CO') AND t.AD_Client_ID = " + m_AD_Client_ID + " AND S_Resource_ID=" + S_Resource_ID ;
{ else
pstmt = DB.prepareStatement (sql,get_TrxName()); sql_insert += "FROM PP_Order t WHERE (t.QtyOrdered - t.QtyDelivered) <> 0 AND t.DocStatus IN ('IP','CO') AND t.AD_Client_ID = " + m_AD_Client_ID ;
//pstmt.setInt(1, p_M_Warehouse_ID);
trx = Trx.get("MRP MO", true);
ResultSet rs = pstmt.executeQuery(); DB.executeUpdate(sql + sql_insert + where , trx.getTrxName());
while (rs.next()) trx.commit();
{
Trx trx = Trx.get("MRP OrderLine", true); //Insert from PP_Order_BOMLine
MOrderLine ol = new MOrderLine(Env.getCtx(),rs.getInt(1),get_TrxName()); sql_insert = " SELECT t.ad_org_id,"
MPPMRP.C_OrderLine(ol,false); +"t.created, t.createdby , o.datepromised,"
trx.commit(); +"o.datepromised, o.datepromised, o.datepromised, o.DocumentNo,"
} +"o.DocStatus, o.isactive , "
rs.close(); +" null, null, "
pstmt.close(); +"t.pp_order_id, t.pp_order_bomline_id,"
//return true; +" null, null, "
} +" null, null, "
catch (Exception e) +"t.m_product_id, t.m_warehouse_id,"
{ +"nextval('pp_mrp_id') , null,"
log.log(Level.SEVERE,"doIt - " + sql, e); +"t.QtyRequiered-t.QtyDelivered, 'D', 'MOP', t.updated, t.updatedby, o.DocumentNo,"
//return false; +"t.ad_client_id ";
}
if(S_Resource_ID > 0)
//Get sales order requirements and Get scheduled purchase order receipts sql_insert += "FROM PP_Order_BOMLine t INNER JOIN PP_Order o ON (o.pp_order_id=t.pp_order_id) WHERE (t.QtyRequiered-t.QtyDelivered) <> 0 AND o.DocStatus IN ('DR','IP','CO') AND t.AD_Client_ID = " + m_AD_Client_ID + " AND S_Resource_ID=" + S_Resource_ID ;
sql = "SELECT rl.M_RequisitionLine_ID FROM M_RequisitionLine rl INNER JOIN M_Requisition r ON (r.M_Requisition_ID = rl.M_Requisition_ID) WHERE rl.Qty > 0 AND r.DocStatus <>'CL' AND rl.AD_Client_ID = " + AD_Client_ID; else
pstmt = null; sql_insert += "FROM PP_Order_BOMLine t INNER JOIN PP_Order o ON (o.pp_order_id=t.pp_order_id) WHERE (t.QtyRequiered-t.QtyDelivered) <> 0 AND o.DocStatus IN ('DR','IP','CO') AND t.AD_Client_ID = " + m_AD_Client_ID;
try trx = Trx.get("MRP MO Line", true);
{ DB.executeUpdate(sql + sql_insert + where , trx.getTrxName());
pstmt = DB.prepareStatement (sql, get_TrxName()); trx.commit();
//pstmt.setInt(1, p_M_Warehouse_ID);
// Insert from C_OrderLine
ResultSet rs = pstmt.executeQuery(); sql_insert = " SELECT t.ad_org_id,"
while (rs.next()) +"t.created, t.createdby , t.datepromised,"
{ +"t.datepromised, t.datepromised, t.datepromised, o.DocumentNo,"
Trx trx = Trx.get("MRP OrderLine", true); +"o.DocStatus, o.isactive , "
MRequisitionLine rl = new MRequisitionLine(Env.getCtx(),rs.getInt(1),get_TrxName()); +" null, null, "
MPPMRP.M_RequisitionLine(rl,false); +" null, null, "
trx.commit(); +" t.c_order_id, t.c_orderline_id, "
} +" null, null, "
rs.close(); +"t.m_product_id, t.m_warehouse_id,"
pstmt.close(); +"nextval('pp_mrp_id') , null,"
return true; +"t.QtyOrdered-t.QtyDelivered, 'D', 'MOP', t.updated, t.updatedby, o.DocumentNo,"
} +"t.ad_client_id "
catch (Exception e) +"FROM C_OrderLine t INNER JOIN C_Order o ON (o.c_order_id=t.c_order_id) WHERE (t.QtyOrdered - t.QtyDelivered) <> 0 AND o.DocStatus IN ('IP','CO') AND t.AD_Client_ID = " + m_AD_Client_ID;
{
log.log(Level.SEVERE,"doIt - " + sql, e); trx = Trx.get("Sales Order Line", true);
return false; DB.executeUpdate(sql + sql_insert + where , trx.getTrxName());
} trx.commit();
} // Insert from M_RequisitionLine
sql_insert = " SELECT rl.ad_org_id,"
+"rl.created, rl.createdby , t.daterequired,"
+" t.daterequired, t.daterequired, t.daterequired, t.DocumentNo,"
+"t.DocStatus, t.isactive , "
+" null, null, "
+" null, null, "
+" null, null, "
+"rl.m_requisition_id, rl.m_requisitionline_id, "
+"rl.m_product_id, t.m_warehouse_id,"
+"nextval('pp_mrp_id') , null,"
+"rl.Qty, 'S', 'POR', rl.updated, rl.updatedby, t.DocumentNo,"
+"rl.ad_client_id "
+"FROM M_RequisitionLine rl INNER JOIN M_Requisition t ON (rl.m_requisition_id=t.m_requisition_id) WHERE rl.Qty > 0 AND t.DocStatus IN ('CL') AND t.AD_Client_ID = " + m_AD_Client_ID;
trx = Trx.get("Requisition Line", true);
DB.executeUpdate(sql + sql_insert + where , trx.getTrxName());
trx.commit();
return true;
}
} }

View File

@ -0,0 +1,35 @@
-- Jun 30, 2008 7:42:57 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,113,0,53014,53206,19,202,'AD_Org_ID',TO_DATE('2008-06-30 19:42:51','YYYY-MM-DD HH24:MI:SS'),0,'Organizational entity within client','EE01',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','N','N','Organization',10,TO_DATE('2008-06-30 19:42:51','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:42:57 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53206 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- Jun 30, 2008 7:44:28 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1777,0,53014,53207,19,52002,'S_Resource_ID',TO_DATE('2008-06-30 19:44:25','YYYY-MM-DD HH24:MI:SS'),0,'Resource','EE01',22,'Y','Y','Y','N','Resource',20,TO_DATE('2008-06-30 19:44:25','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:44:28 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53207 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- Jun 30, 2008 7:46:01 PM CDT
-- Improve MRP
UPDATE AD_Process_Para SET AD_Val_Rule_ID=189,Updated=TO_DATE('2008-06-30 19:46:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53133
;
-- Jun 30, 2008 7:46:15 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,459,0,53014,53208,19,189,'M_Warehouse_ID',TO_DATE('2008-06-30 19:46:13','YYYY-MM-DD HH24:MI:SS'),0,'Storage Warehouse and Service Point','EE01',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','Y','N','N','Warehouse',30,TO_DATE('2008-06-30 19:46:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:46:15 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53208 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;

View File

@ -0,0 +1,35 @@
-- Jun 30, 2008 7:42:57 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,113,0,53014,53206,19,202,'AD_Org_ID',TO_TIMESTAMP('2008-06-30 19:42:51','YYYY-MM-DD HH24:MI:SS'),0,'Organizational entity within client','EE01',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','N','N','Organization',10,TO_TIMESTAMP('2008-06-30 19:42:51','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:42:57 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53206 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- Jun 30, 2008 7:44:28 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1777,0,53014,53207,19,52002,'S_Resource_ID',TO_TIMESTAMP('2008-06-30 19:44:25','YYYY-MM-DD HH24:MI:SS'),0,'Resource','EE01',22,'Y','Y','Y','N','Resource',20,TO_TIMESTAMP('2008-06-30 19:44:25','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:44:28 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53207 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;
-- Jun 30, 2008 7:46:01 PM CDT
-- Improve MRP
UPDATE AD_Process_Para SET AD_Val_Rule_ID=189,Updated=TO_TIMESTAMP('2008-06-30 19:46:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53133
;
-- Jun 30, 2008 7:46:15 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,459,0,53014,53208,19,189,'M_Warehouse_ID',TO_TIMESTAMP('2008-06-30 19:46:13','YYYY-MM-DD HH24:MI:SS'),0,'Storage Warehouse and Service Point','EE01',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','Y','N','N','Warehouse',30,TO_TIMESTAMP('2008-06-30 19:46:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Jun 30, 2008 7:46:15 PM CDT
-- Improve MRP
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53208 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID)
;