Commit 71bc74e4 authored by ngadkari's avatar ngadkari

Changes in sql for exp date

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204791 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 605fe684
......@@ -1448,10 +1448,10 @@ conn = getConnection();
rs.close();
}*/
//Added by Jaffar on 02-04-19
rs.close();
/*rs.close();
rs = null;
stmt.close();
stmt = null;
stmt = null;*/
}
catch(Exception e)
{
......@@ -1496,11 +1496,32 @@ conn = getConnection();
public double getRateFromStock(Connection conn,String siteCode,String itemCode,String itemSer,String locCode,String lotNo,String lotSl){
ResultSet rs=null;
PreparedStatement pstmt=null;
String sql="";
String sql="",trackSLife="";
int count=0;
double oldRate=0;
try{
sql = "select rate from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? and item_ser = ? and exp_date >= sysdate";
// added by nandkumar gadkari on 06/08/19----------------start------------------
sql = "SELECT TRACK_SHELF_LIFE FROM ITEM WHERE ITEM_CODE= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
trackSLife = rs.getString(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
trackSLife = trackSLife == null || trackSLife.trim().length() == 0 ? "N" : trackSLife.trim();
// added by nandkumar gadkari on 06/08/19----------------end------------------
//sql = "select rate from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? and item_ser = ? and exp_date >= sysdate";
//sql commented and new added by nandkumar gadkari on 07/08/19
sql = "select rate from stock where site_code = ? and item_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? and item_ser = ? ";
if("Y".equalsIgnoreCase(trackSLife))
{
sql = sql + "and exp_date >= sysdate";
}
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode);
......
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