IDEMPIERE-5662 Replenish Report - improvements (#1775)

This commit is contained in:
Carlos Ruiz 2023-04-18 09:02:05 +02:00 committed by GitHub
parent f6d89ffe26
commit 37cab23ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 239 additions and 27 deletions

View File

@ -0,0 +1,106 @@
-- IDEMPIERE-5662 Replenish Report incl. Production -> not working
SELECT register_migration_script('202304102245_IDEMPIERE-5662.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 10, 2023, 10:45:55 PM CEST
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=125
;
-- Apr 10, 2023, 10:45:55 PM CEST
UPDATE AD_Menu SET Name='Replenish Report', Description='Inventory Replenish Report', IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=196
;
-- Apr 10, 2023, 10:47:03 PM CEST
UPDATE AD_Menu SET Name='Replenish Report',Updated=TO_TIMESTAMP('2023-04-10 22:47:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53354
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=9,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=228
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=10,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53297
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53354
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=479
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=482
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=481
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=411
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53253
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=426
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=537
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=200166
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=22,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=311
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=23,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=292
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=24,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=504
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=25,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=515
;
-- Apr 10, 2023, 10:49:19 PM CEST
UPDATE AD_Process SET Name='Replenish Report (deprecated)',Updated=TO_TIMESTAMP('2023-04-10 22:49:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=125
;
-- Apr 10, 2023, 10:49:19 PM CEST
UPDATE AD_Menu SET Name='Replenish Report (deprecated)', Description='Inventory Replenish Report', IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:49:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=196
;
-- Apr 10, 2023, 10:49:47 PM CEST
UPDATE AD_Process SET Name='Replenish Report',Updated=TO_TIMESTAMP('2023-04-10 22:49:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53267
;
-- Apr 10, 2023, 10:50:36 PM CEST
UPDATE AD_Process_Para SET DefaultValue=NULL,Updated=TO_TIMESTAMP('2023-04-10 22:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53526
;
-- Apr 10, 2023, 10:51:07 PM CEST
UPDATE AD_Ref_List SET Name='Requisition',Updated=TO_TIMESTAMP('2023-04-10 22:51:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53711
;
-- Apr 10, 2023, 10:51:46 PM CEST
UPDATE AD_Ref_List SET IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:51:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53708
;
-- Apr 10, 2023, 11:36:16 PM CEST
UPDATE AD_Process_Para SET DisplayLogic='@ReplenishmentCreate@!'''' & @ReplenishmentCreate@!''PRD''', MandatoryLogic='@ReplenishmentCreate@!'''' & @ReplenishmentCreate@!''PRD''',Updated=TO_TIMESTAMP('2023-04-10 23:36:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53528
;

View File

@ -0,0 +1,103 @@
-- IDEMPIERE-5662 Replenish Report incl. Production -> not working
SELECT register_migration_script('202304102245_IDEMPIERE-5662.sql') FROM dual;
-- Apr 10, 2023, 10:45:55 PM CEST
UPDATE AD_Process SET IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=125
;
-- Apr 10, 2023, 10:45:55 PM CEST
UPDATE AD_Menu SET Name='Replenish Report', Description='Inventory Replenish Report', IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:45:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=196
;
-- Apr 10, 2023, 10:47:03 PM CEST
UPDATE AD_Menu SET Name='Replenish Report',Updated=TO_TIMESTAMP('2023-04-10 22:47:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53354
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=9,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=228
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=53296, SeqNo=10,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53297
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=13,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53354
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=14,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=479
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=15,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=482
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=16,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=481
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=17,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=411
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=18,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=53253
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=19,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=426
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=20,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=537
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=21,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=200166
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=22,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=311
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=23,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=292
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=24,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=504
;
-- Apr 10, 2023, 10:48:53 PM CEST
UPDATE AD_TreeNodeMM SET Parent_ID=183, SeqNo=25,Updated=TO_TIMESTAMP('2023-04-10 22:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tree_ID=10 AND Node_ID=515
;
-- Apr 10, 2023, 10:49:19 PM CEST
UPDATE AD_Process SET Name='Replenish Report (deprecated)',Updated=TO_TIMESTAMP('2023-04-10 22:49:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=125
;
-- Apr 10, 2023, 10:49:19 PM CEST
UPDATE AD_Menu SET Name='Replenish Report (deprecated)', Description='Inventory Replenish Report', IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:49:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=196
;
-- Apr 10, 2023, 10:49:47 PM CEST
UPDATE AD_Process SET Name='Replenish Report',Updated=TO_TIMESTAMP('2023-04-10 22:49:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53267
;
-- Apr 10, 2023, 10:50:36 PM CEST
UPDATE AD_Process_Para SET DefaultValue=NULL,Updated=TO_TIMESTAMP('2023-04-10 22:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53526
;
-- Apr 10, 2023, 10:51:07 PM CEST
UPDATE AD_Ref_List SET Name='Requisition',Updated=TO_TIMESTAMP('2023-04-10 22:51:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53711
;
-- Apr 10, 2023, 10:51:46 PM CEST
UPDATE AD_Ref_List SET IsActive='N',Updated=TO_TIMESTAMP('2023-04-10 22:51:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53708
;
-- Apr 10, 2023, 11:36:16 PM CEST
UPDATE AD_Process_Para SET DisplayLogic='@ReplenishmentCreate@!'''' & @ReplenishmentCreate@!''PRD''', MandatoryLogic='@ReplenishmentCreate@!'''' & @ReplenishmentCreate@!''PRD''',Updated=TO_TIMESTAMP('2023-04-10 23:36:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53528
;

View File

@ -60,6 +60,7 @@ import org.eevolution.model.MDDOrderLine;
* Carlos Ruiz globalqss - integrate bug fixing from Chris Farley
* [ 1619517 ] Replenish report fails when no records in m_storage
*/
@Deprecated // use ReplenishReportProduction instead
@org.adempiere.base.annotation.Process
public class ReplenishReport extends SvrProcess
{

View File

@ -70,7 +70,7 @@ public class ReplenishReportProduction extends SvrProcess
private int p_M_Warehouse_ID = 0;
/** Optional BPartner */
private int p_C_BPartner_ID = 0;
/** Create (POO)Purchse Order or (POR)Requisition or (MMM)Movements */
/** Create (POO)Purchase Order or (POR)Requisition or (MMM)Movement or (PRD)Production */
private String p_ReplenishmentCreate = null;
/** Document Type */
private int p_C_DocType_ID = 0;
@ -116,6 +116,8 @@ public class ReplenishReportProduction extends SvrProcess
{
if (log.isLoggable(Level.INFO)) log.info("M_Warehouse_ID=" + p_M_Warehouse_ID
+ ", C_BPartner_ID=" + p_C_BPartner_ID
+ ", M_Product_Category_ID=" + p_M_Product_Category_ID
+ ", IsKanban=" + isKanban
+" - ReplenishmentCreate=" + p_ReplenishmentCreate
+ ", C_DocType_ID=" + p_C_DocType_ID);
@ -136,13 +138,13 @@ public class ReplenishReportProduction extends SvrProcess
if (!p_ReplenishmentCreate.equals("PRD") && !dt.getDocBaseType().equals(p_ReplenishmentCreate) )
throw new AdempiereSystemError("@C_DocType_ID@=" + dt.getName() + " <> " + p_ReplenishmentCreate);
//
if (p_ReplenishmentCreate.equals("POO"))
if (p_ReplenishmentCreate.equals(MDocType.DOCBASETYPE_PurchaseOrder))
createPO();
else if (p_ReplenishmentCreate.equals("POR"))
else if (p_ReplenishmentCreate.equals(MDocType.DOCBASETYPE_PurchaseRequisition))
createRequisition();
else if (p_ReplenishmentCreate.equals("MMM"))
else if (p_ReplenishmentCreate.equals(MDocType.DOCBASETYPE_MaterialMovement))
createMovements();
else if (p_ReplenishmentCreate.equals("DOO"))
else if (p_ReplenishmentCreate.equals(MDocType.DOCBASETYPE_DistributionOrder))
createDO();
else if (p_ReplenishmentCreate.equals("PRD"))
createProduction();
@ -158,7 +160,7 @@ public class ReplenishReportProduction extends SvrProcess
StringBuilder sql = new StringBuilder("UPDATE M_Replenish")
.append(" SET Level_Max = Level_Min ")
.append("WHERE Level_Max < Level_Min");
int no = DB.executeUpdate(sql.toString(), get_TrxName());
int no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Corrected Max_Level=" + no);
@ -166,7 +168,7 @@ public class ReplenishReportProduction extends SvrProcess
sql = new StringBuilder("UPDATE M_Product_PO")
.append(" SET Order_Min = 1 ")
.append("WHERE Order_Min IS NULL OR Order_Min < 1");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Min=" + no);
@ -174,7 +176,7 @@ public class ReplenishReportProduction extends SvrProcess
sql = new StringBuilder("UPDATE M_Product_PO")
.append(" SET Order_Pack = 1 ")
.append("WHERE Order_Pack IS NULL OR Order_Pack < 1");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Pack=" + no);
@ -186,7 +188,7 @@ public class ReplenishReportProduction extends SvrProcess
.append("WHERE p.M_Product_ID=pp.M_Product_ID ")
.append("GROUP BY pp.M_Product_ID ")
.append("HAVING COUNT(*) = 1)");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(Y)=" + no);
@ -198,13 +200,13 @@ public class ReplenishReportProduction extends SvrProcess
.append("WHERE p.M_Product_ID=pp.M_Product_ID AND pp.IsCurrentVendor='Y' ")
.append("GROUP BY pp.M_Product_ID ")
.append("HAVING COUNT(*) > 1)");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(N)=" + no);
// Just to be sure
sql = new StringBuilder("DELETE FROM T_Replenish WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Delete Existing Temp=" + no);
} // prepareTable
@ -239,8 +241,8 @@ public class ReplenishReportProduction extends SvrProcess
if ( p_M_Product_Category_ID != 0 )
sql.append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID);
if ( isKanban != null )
sql.append(" AND p.IsKanban = '").append(isKanban).append("' ");
int no = DB.executeUpdate(sql.toString(), get_TrxName());
sql.append(" AND p.IsKanban=").append(DB.TO_STRING(isKanban));
int no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (log.isLoggable(Level.FINEST)) log.finest(sql.toString());
if (log.isLoggable(Level.FINE)) log.fine("Insert (1) #" + no);
@ -269,7 +271,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append(" AND p.M_Product_Category_ID=").append(p_M_Product_Category_ID);
if ( isKanban != null )
sql.append(" AND p.IsKanban = '").append(isKanban).append("' ");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Insert (BP) #" + no);
}
@ -283,7 +285,7 @@ public class ReplenishReportProduction extends SvrProcess
if (p_C_DocType_ID != 0)
sql.append(", C_DocType_ID=").append(p_C_DocType_ID);
sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Update #" + no);
@ -296,7 +298,7 @@ public class ReplenishReportProduction extends SvrProcess
if (p_C_DocType_ID != 0)
sql.append(", C_DocType_ID=").append(p_C_DocType_ID);
sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Update #" + no);
@ -309,17 +311,17 @@ public class ReplenishReportProduction extends SvrProcess
sql.append(" WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'");
sql.append(" AND rr.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(" ))");
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Delete Inactive=" + no);
// Ensure Data consistency
sql = new StringBuilder("UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
sql = new StringBuilder("UPDATE T_Replenish SET QtyReserved = 0 WHERE QtyReserved IS NULL");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
sql = new StringBuilder("UPDATE T_Replenish SET QtyOrdered = 0 WHERE QtyOrdered IS NULL");
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
// Set Minimum / Maximum Maintain Level
// X_M_Replenish.REPLENISHTYPE_ReorderBelowMinimumLevel
@ -329,7 +331,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append(" ELSE 0 END ");
sql.append("WHERE ReplenishType='1'");
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Update Type-1=" + no);
//
@ -338,7 +340,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append(" SET QtyToOrder = Level_Max - QtyOnHand + QtyReserved - QtyOrdered ");
sql.append("WHERE ReplenishType='2'" );
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Update Type-2=" + no);
@ -349,7 +351,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append("WHERE QtyToOrder < Order_Min");
sql.append(" AND QtyToOrder > 0" );
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Set MinOrderQty=" + no);
@ -359,7 +361,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append("WHERE MOD(QtyToOrder, Order_Pack) <> 0");
sql.append(" AND QtyToOrder > 0");
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Set OrderPackQty=" + no);
@ -369,7 +371,7 @@ public class ReplenishReportProduction extends SvrProcess
sql = new StringBuilder("UPDATE T_Replenish");
sql.append(" SET M_WarehouseSource_ID=").append(wh.getM_WarehouseSource_ID());
sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Set Source Warehouse=" + no);
}
@ -378,7 +380,7 @@ public class ReplenishReportProduction extends SvrProcess
sql.append(" SET M_WarehouseSource_ID = NULL " );
sql.append("WHERE M_Warehouse_ID=M_WarehouseSource_ID");
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Set same Source Warehouse=" + no);
@ -429,7 +431,7 @@ public class ReplenishReportProduction extends SvrProcess
sql = new StringBuilder("DELETE FROM T_Replenish ");
sql.append("WHERE QtyToOrder < 1");
sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID());
no = DB.executeUpdate(sql.toString(), get_TrxName());
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (no != 0)
if (log.isLoggable(Level.FINE)) log.fine("Delete No QtyToOrder=" + no);