Integrate phib's change from trunk revision 5447

BF[ 1688862 ] Replenish report fails unless all replenish records active
This commit is contained in:
Carlos Ruiz 2008-07-29 07:48:52 +00:00
parent 72c88dcb3e
commit 5303895f63
1 changed files with 31 additions and 9 deletions

View File

@ -17,14 +17,35 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.process; package org.compiere.process;
import java.sql.*; import java.math.BigDecimal;
import java.util.*; import java.sql.PreparedStatement;
import java.math.*; import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.logging.Level;
import org.compiere.model.*; import org.compiere.model.MBPartner;
import org.eevolution.model.*; import org.compiere.model.MClient;
import java.util.logging.*; import org.compiere.model.MDocType;
import org.compiere.util.*; import org.compiere.model.MMovement;
import org.compiere.model.MMovementLine;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.model.MOrg;
import org.compiere.model.MProduct;
import org.compiere.model.MRequisition;
import org.compiere.model.MRequisitionLine;
import org.compiere.model.MStorage;
import org.compiere.model.MWarehouse;
import org.compiere.model.X_T_Replenish;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.ReplenishInterface;
import org.eevolution.model.MDDOrder;
import org.eevolution.model.MDDOrderLine;
/** /**
* Replenishment Report * Replenishment Report
@ -73,7 +94,7 @@ public class ReplenishReport extends SvrProcess
} // prepare } // prepare
/** /**
* Perrform process. * Perform process.
* @return Message * @return Message
* @throws Exception if not successful * @throws Exception if not successful
*/ */
@ -244,7 +265,8 @@ public class ReplenishReport extends SvrProcess
+ "WHERE (EXISTS (SELECT * FROM M_Product p " + "WHERE (EXISTS (SELECT * FROM M_Product p "
+ "WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')" + "WHERE p.M_Product_ID=r.M_Product_ID AND p.IsActive='N')"
+ " OR EXISTS (SELECT * FROM M_Replenish rr " + " OR EXISTS (SELECT * FROM M_Replenish rr "
+ " WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'))" + " WHERE rr.M_Product_ID=r.M_Product_ID AND rr.IsActive='N'"
+ " AND rr.M_Warehouse_ID=" + p_M_Warehouse_ID + " ))"
+ " AND AD_PInstance_ID=" + getAD_PInstance_ID(); + " AND AD_PInstance_ID=" + getAD_PInstance_ID();
no = DB.executeUpdate(sql, get_TrxName()); no = DB.executeUpdate(sql, get_TrxName());
if (no != 0) if (no != 0)