Commit 82672111 authored by msharma's avatar msharma

set no_art=1 if quantity>0 and not_art<0


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95964 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4d65154e
package ibase.webitm.ejb.dis;
import java.sql.*;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.File;
......@@ -1008,34 +1007,37 @@ 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 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 quantity > 0";
+"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