Libero fixed to work with Postgre.

Fixed deletion of records.
This commit is contained in:
trifonnt 2008-08-13 15:28:32 +00:00
parent 437927389e
commit d51e50402e
2 changed files with 11 additions and 7 deletions

View File

@ -309,7 +309,9 @@ public class MPPMRP extends X_PP_MRP
X_PP_Product_BOM bom = new X_PP_Product_BOM(Env.getCtx(),PP_Product_BOM_ID, trxName);
if (bom.getBOMType().equals(bom.BOMTYPE_Make_To_Order))
{
int S_Resource_ID = DB.getSQLValue(trxName,"SELECT S_Resource_ID FROM S_Resource r WHERE r.ManufacturingResourceType = 'PT' AND r.IsManufacturingResource = 'Y' AND r.AD_Client_ID = ? AND r.M_Warehouse_ID = ? AND ROWNUM = 1", ol.getAD_Client_ID(),ol.getM_Warehouse_ID());
int S_Resource_ID = DB.getSQLValue(trxName,"SELECT S_Resource_ID FROM S_Resource r WHERE r.ManufacturingResourceType = 'PT' AND r.IsManufacturingResource = 'Y' AND r.AD_Client_ID = ? AND r.M_Warehouse_ID = ? "
//+ "AND ROWNUM = 1"
, ol.getAD_Client_ID(),ol.getM_Warehouse_ID());
int AD_Workflow_ID = DB.getSQLValue(trxName,"SELECT AD_Workflow_ID FROM AD_Workflow wf WHERE wf.AD_Client_ID = ? AND wf.Value = ? ", ol.getAD_Client_ID(),product.getValue());
if (S_Resource_ID != -1 && AD_Workflow_ID != -1)
{

View File

@ -799,17 +799,19 @@ public class MPPOrder extends X_PP_Order implements DocAction {
// Reset workflow start node
DB.executeUpdate("UPDATE PP_Order_Workflow SET PP_Order_Node_ID=NULL WHERE PP_Order_ID=" + get_ID() + " AND AD_Client_ID=" + getAD_Client_ID(), get_TrxName());
//
ids = PO.getAllIDs("PP_Order_Node", "PP_Order_ID=" + get_ID() + " AND AD_Client_ID=" + getAD_Client_ID(), get_TrxName());
for (int i = 0; i < ids.length; i++) {
po = new MPPOrderNode(getCtx(), ids[i], get_TrxName());
po.deleteEx(true);
}
//
ids = PO.getAllIDs("PP_Order_NodeNext", "PP_Order_ID=" + get_ID() + " AND AD_Client_ID=" + getAD_Client_ID(), get_TrxName());
for (int i = 0; i < ids.length; i++) {
po = new MPPOrderNodeNext(getCtx(), ids[i], get_TrxName());
po.deleteEx(true);
}
//
ids = PO.getAllIDs("PP_Order_Node", "PP_Order_ID=" + get_ID() + " AND AD_Client_ID=" + getAD_Client_ID(), get_TrxName());
for (int i = 0; i < ids.length; i++) {
po = new MPPOrderNode(getCtx(), ids[i], get_TrxName());
po.deleteEx(true);
}
//
ids = PO.getAllIDs("PP_Order_Node_Product", "PP_Order_ID=" + get_ID() + " AND AD_Client_ID=" + getAD_Client_ID(), get_TrxName());
for (int i = 0; i < ids.length; i++) {