Commit 817500d8 authored by rtiwari's avatar rtiwari

UPDATED


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95730 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 227372d5
...@@ -69,7 +69,7 @@ public class StockUpdate ...@@ -69,7 +69,7 @@ public class StockUpdate
String acctCodeDr = "",cctrCodeDr = "", sqlState ="", errorCode = ""; String acctCodeDr = "",cctrCodeDr = "", sqlState ="", errorCode = "";
Timestamp mtoday = null; Timestamp mtoday = null;
Timestamp tempTestDate = null; Timestamp tempTestDate = null;
double qtyPerArtStk = 0d,qtyStk=0d;
try try
{ {
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
...@@ -77,6 +77,34 @@ public class StockUpdate ...@@ -77,6 +77,34 @@ public class StockUpdate
puplateCommonParameters(updateStockMap); puplateCommonParameters(updateStockMap);
//ADDED BY RITESH ON 31/07/14 START
sql = "select quantity , qty_per_art "
+ "from stock "
+ "where item_code = ? "
+ "and site_code = ? "
+ "and loc_code = ? "
+ "and lot_no = ? "
+ "and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode);
pstmt.setString(3,locationCode);
pstmt.setString(4,lotNo);
pstmt.setString(5,lotSl);
rs = pstmt.executeQuery();
if ( rs.next() )
{
qtyStk= rs.getDouble("quantity");
qtyPerArtStk= rs.getDouble("qty_per_art");
}
if((int) (qtyStk/qtyPerArtStk) == 0)
{
noArt = 1;
}
System.out.println(" no_art accepted :: "+noArt);
//ADDEDBY RITESH ON 31/07/14 END
tempTestDate = Timestamp.valueOf("1900-01-01 00:00:00"); tempTestDate = Timestamp.valueOf("1900-01-01 00:00:00");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"); termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
...@@ -987,7 +1015,7 @@ public class StockUpdate ...@@ -987,7 +1015,7 @@ public class StockUpdate
+"and site_code = '"+this.siteCode +"'" +"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'" +"and loc_code = '"+this.locationCode +"'"
+"and lot_no = '"+this.lotNo+"'" +"and lot_no = '"+this.lotNo+"'"
+"and lot_sl = '"+this.lotSl+"' and no_art<=0 and quantity > 0 "; // change by ritesh on 15/07/14 +"and lot_sl = '"+this.lotSl+"' and no_art<=0 ";
System.out.println("sql---"+sql); System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
...@@ -999,7 +1027,7 @@ public class StockUpdate ...@@ -999,7 +1027,7 @@ public class StockUpdate
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
System.out.println("countnoArt["+countnoArt+"]"); System.out.println("countnoArt::["+countnoArt+"]");
if(countnoArt>0) if(countnoArt>0)
{ {
sql="update stock set no_art=1 " + sql="update stock set no_art=1 " +
...@@ -1007,7 +1035,7 @@ public class StockUpdate ...@@ -1007,7 +1035,7 @@ public class StockUpdate
+"and site_code = '"+this.siteCode +"'" +"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'" +"and loc_code = '"+this.locationCode +"'"
+"and lot_no = '"+this.lotNo+"'" +"and lot_no = '"+this.lotNo+"'"
+"and lot_sl = '"+this.lotSl+"' and no_art <= 0"; +"and lot_sl = '"+this.lotSl+"' and no_art <= 0 and quantity > 0";
System.out.println("sql---"+sql); System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.executeUpdate(); pstmt.executeUpdate();
...@@ -1751,19 +1779,19 @@ public class StockUpdate ...@@ -1751,19 +1779,19 @@ public class StockUpdate
if(updateStockMap.get("no_art")!=null) if(updateStockMap.get("no_art")!=null)
{ {
this.noArt = Double.parseDouble(updateStockMap.get("no_art").toString()); this.noArt = Double.parseDouble(updateStockMap.get("no_art").toString());
double partialArt= noArt; // ADDED BY RITESH ON 15/07/14 START // double partialArt= noArt; // ADDED BY RITESH ON 15/07/14 START
if(partialArt == 0) // if(partialArt == 0)
{ // {
partialArt = 1; // partialArt = 1;
}else // }else
{ // {
partialArt = 0; // partialArt = 0;
} // }
if( "XFRX".equalsIgnoreCase(itemSer)) //// if( "XFRX".equalsIgnoreCase(itemSer))
{ //// {
noArt = noArt + partialArt; // noArt = noArt + partialArt;
} // // }
System.out.println("partialArt ::["+partialArt+"] noArt::["+noArt+"]"); // System.out.println("partialArt ::["+partialArt+"] noArt::["+noArt+"]"+"itemSer::["+itemSer+"]");
} // ADDED BY RITESH ON 15/07/14 END } // ADDED BY RITESH ON 15/07/14 END
if(updateStockMap.get("last_phyc_date")!=null) if(updateStockMap.get("last_phyc_date")!=null)
{ {
......
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