Commit 7c2cc8f0 authored by dpawar's avatar dpawar

added two sql for total login site code stock (MF3GSUN023)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94117 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2c9829b1
......@@ -5,6 +5,7 @@ import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.mfg.MfgCommon;
import ibase.utility.CommonConstants;
import ibase.utility.UserInfoBean;
// import ibase.webitm.ejb.mfg.adv.WOStock.woStockDtlParams;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -22,6 +23,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.text.DecimalFormat;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
......@@ -30,6 +32,7 @@ import javax.xml.transform.dom.DOMSource;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
......@@ -2808,6 +2811,64 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
rs1.close();
rs1 = null;
//Added by Dadaso pawar on 07/01/14 [MF3GSUN023] [Start]
WoStockBean WoStockBeanObj=new WoStockBean();
UserInfoBean userInfoL=WoStockBeanObj.getUserInfo();
String siteCodeL=userInfoL.getSiteCode();
siteCodeL=siteCodeL== null ? "" :siteCodeL.trim();
System.out.println("Site code----->>>["+siteCodeL+"]");
StringBuffer sbNew = new StringBuffer();
sbNew.append("select nvl(sum(a.quantity - a.alloc_qty),0), nvl(sum(a.alloc_qty),0) from stock a, invstat b "
+" where a.inv_stat = b.inv_stat and a.item_code = ? and a.site_code in (select site_code from site where geo_loc in ( select geo_loc from site where site_code = ? )) and b.available = 'Y' and b.stat_type <> 'S' and b.plan_prod = 'Y' and (a.quantity - nvl(a.alloc_qty,0)) > 0 " );
if(trackShelfLife != null && trackShelfLife.equalsIgnoreCase("Y"))
{
sbNew.append("and ( a.exp_date is null or a.exp_date >?)");
}
pstmt = conn.prepareStatement(sbNew.toString());
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCodeL);
if(trackShelfLife != null && trackShelfLife.equalsIgnoreCase("Y"))
{
pstmt.setTimestamp(3,currDate);
}
rs1 = pstmt.executeQuery();
while(rs1.next())
{
thisBean.stkQtyL = rs1.getDouble(1);
thisBean.allockQtyL = rs1.getString(2);
}
rs1.close();
rs1 = null;
////
String sql1="select nvl(sum(a.quantity - a.alloc_qty),0), nvl(sum(a.alloc_qty),0) from stock a,"
+ "invstat b where a.inv_stat = b.inv_stat and a.item_code = ? and a.site_code in "
+ "(select site_code from site where geo_loc in ( select geo_loc from site where site_code = ? ))"
+ "and b.available = 'N' and b.stat_type <> 'S' and (a.quantity - nvl(a.alloc_qty,0)) > 0 " ;
if(trackShelfLife.equalsIgnoreCase("Y"))
{
sql1=sql1 +" and ( a.exp_date is null or a.exp_date >?)";
}
pstmt=conn.prepareStatement(sql1);
pstmt.setString(1, itemCode);
pstmt.setString(2,siteCodeL);
if(trackShelfLife.equalsIgnoreCase("Y"))
{
pstmt.setTimestamp(3,currDate);
}
rs1 = pstmt.executeQuery();
while(rs1.next())
{
thisBean.nonStkQtyL = rs1.getDouble(1);
thisBean.allockQtyL = rs1.getString(2);
}
rs1.close();
rs1 = null;
//Added by Dadaso pawar on 07/01/14 [MF3GSUN023] [End]
stkWoList.add(thisBean);
}
pstmt1.close();
......@@ -2856,6 +2917,10 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
String descr = null;
double stkQty = 0.0;
double nonStkQty = 0.0;
//Added by Dadaso pawar on 07/01/14 [MF3GSUN023] [Start]
String allockQtyL=null;
double nonStkQtyL=0.0,stkQtyL=0.0;
//Added by Dadaso pawar on 07/01/14 [MF3GSUN023] [End]
Timestamp currDate =null;
double qtyPer = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment