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; package ibase.webitm.ejb.dis;
import java.sql.*; import java.sql.*;
import java.sql.Date;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.io.File; import java.io.File;
...@@ -1008,34 +1007,37 @@ public class StockUpdate ...@@ -1008,34 +1007,37 @@ public class StockUpdate
pstmt.close(); pstmt.close();
rs.close(); rs.close();
//Added by Manoj dtd 25/06/2014 to update no_art as 1 if no_art<=0 //Added by Manoj dtd 19/08/2014 to update no_art as 1 if no_art<0
double countnoArt=0; double stkQty=0,noArticle=0;
sql="select count(1) from stock " + sql="select quantity,no_art from stock " +
" where item_code = '"+this.itemCode+"'" " where item_code = '"+this.itemCode+"'"
+"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+"' ";
System.out.println("sql---"+sql); System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
countnoArt=rs.getDouble(1); //countnoArt=rs.getDouble(1);
stkQty=rs.getDouble(1);
noArticle=rs.getDouble(2);
} }
rs.close(); rs.close();
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
System.out.println("countnoArt::["+countnoArt+"]"); System.out.println("stkQty::["+stkQty+"]");
if(countnoArt>0) System.out.println("noArticle::["+noArticle+"]");
if(stkQty>0 && noArticle<0)
{ {
sql="update stock set no_art=1 " + sql="update stock set no_art=1 " +
" where item_code = '"+this.itemCode+"'" " where item_code = '"+this.itemCode+"'"
+"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"; +"and lot_sl = '"+this.lotSl+"' ";
System.out.println("sql---"+sql); System.out.println("sql---"+sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.executeUpdate(); 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