Commit 9a1a5cd8 authored by msharma's avatar msharma

no_art updation logic updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96934 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f8bc847f
......@@ -85,6 +85,35 @@ public class StockUpdate
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)
{
this.noArt = 1;
}
}
System.out.println(" no_art accepted 16092014:: "+this.noArt);
//ADDEDBY RITESH ON 31/07/14 END
tempTestDate = Timestamp.valueOf("1900-01-01 00:00:00");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
......@@ -1098,34 +1127,52 @@ public class StockUpdate
pstmt.close();
rs.close();
//Added by Manoj dtd 25/06/2014 to update no_art as 1 if no_art<=0
double countnoArt=0;
sql="select count(1) from stock " +
//Added by Manoj dtd 19/08/2014 to update no_art as 1 if no_art<0
double stkQty=0,noArticle=0;
sql="select quantity,no_art from stock " +
" where item_code = '"+this.itemCode+"'"
+"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'"
+"and lot_no = '"+this.lotNo+"'"
+"and lot_sl = '"+this.lotSl+"' and no_art<=0 and quantity > 0 ";
+"and lot_sl = '"+this.lotSl+"' ";
System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
if(rs.next())
{
countnoArt=rs.getDouble(1);
//countnoArt=rs.getDouble(1);
stkQty=rs.getDouble(1);
noArticle=rs.getDouble(2);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("countnoArt["+countnoArt+"]");
if(countnoArt>0)
System.out.println("stkQty::["+stkQty+"]");
System.out.println("noArticle::["+noArticle+"]");
if(stkQty>0 && noArticle<0)
{
sql="update stock set no_art=1 " +
" where item_code = '"+this.itemCode+"'"
+"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'"
+"and lot_no = '"+this.lotNo+"'"
+"and lot_sl = '"+this.lotSl+"' and no_art=0";
+"and lot_sl = '"+this.lotSl+"' ";
System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql);
pstmt.executeUpdate();
pstmt.close();
pstmt=null;
}
//Added by Manoj dtd 29/10/2014 to set no_art=0 if stock =0
if(stkQty==0 && noArticle!=0)
{
sql="update stock set no_art=0 " +
" where item_code = '"+this.itemCode+"'"
+"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'"
+"and lot_no = '"+this.lotNo+"'"
+"and lot_sl = '"+this.lotSl+"' ";
System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql);
pstmt.executeUpdate();
......
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