Commit 89bbbd8f authored by msharma's avatar msharma

set site_code__mfg,mfg_datre,exp_date,pack_code from item_lot_info table, if...

set site_code__mfg,mfg_datre,exp_date,pack_code from item_lot_info table, if no record found then system will set from stock table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105347 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bae2816d
......@@ -394,6 +394,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
HashMap infoMap = null;
String valStr = null;
String siteCode3 = null;
int cntItemLotInfo=0;
try
{
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB();
......@@ -3543,31 +3544,58 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{
lotSl = " ";
}
//Changed by Manoj dtd 14/04/2017 to set values from item_lot_info
sql = "select site_code__mfg, mfg_date, exp_date, pack_code "
+ " from item_lot_info "
+ " where item_code = ? "
+ " and lot_no = ? ";
sql = "select a.site_code__mfg, a.mfg_date, a.exp_date, a.pack_code "
+ " from stock a "
+ " where a.item_code = ? "
+ " and a.site_code = ? "
+ " and a.lot_no = ? "
+ " and a.lot_sl = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, itemCode);
pstmt.setString( 2, lotNo);
rs = pstmt.executeQuery();
if( rs.next() )
{
cntItemLotInfo++;
siteCodeMfg = rs.getString(1);
mfgDate = rs.getTimestamp(2);
expDate = rs.getTimestamp(3);
packCode = rs.getString(4);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(cntItemLotInfo==0)
{
sql = "select a.site_code__mfg, a.mfg_date, a.exp_date, a.pack_code "
+ " from stock a "
+ " where a.item_code = ? "
+ " and a.site_code = ? "
+ " and a.lot_no = ? "
+ " and a.lot_sl = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, itemCode);
pstmt.setString( 2, siteCode);
pstmt.setString( 3, lotNo);
pstmt.setString( 4, lotSl);
rs = pstmt.executeQuery();
if( rs.next() )
{
siteCodeMfg = rs.getString(1);
mfgDate = rs.getTimestamp(2);
expDate = rs.getTimestamp(3);
packCode = rs.getString(4);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, itemCode);
pstmt.setString( 2, siteCode);
pstmt.setString( 3, lotNo);
pstmt.setString( 4, lotSl);
rs = pstmt.executeQuery();
if( rs.next() )
{
siteCodeMfg = rs.getString(1);
mfgDate = rs.getTimestamp(2);
expDate = rs.getTimestamp(3);
packCode = rs.getString(4);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
cntItemLotInfo=0;
if (siteCodeMfg == null || siteCodeMfg.equals("null") || siteCodeMfg.trim().length() == 0)
{
......
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