Commit 07fb673a authored by rbhogale's avatar rbhogale

Changed by Rohan on 18-04-13 for add validation of expired stock


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92966 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8fc8a04c
......@@ -12,7 +12,6 @@ import java.rmi.RemoteException;
import java.sql.*;
import java.text.*;
import java.util.*;
import java.util.Date;
import javax.ejb.*;
import javax.naming.InitialContext;
......@@ -124,6 +123,15 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
String casePickInvstat = "";
String invStat = "";
/*Added By Dipak On 4 June 2012 End*/
//Changed by Rohan on 18-03-13 for define variable.start
int locCount = 0;
String locInvList = "";
String[] locList = null;
String invStatLoc = "";
boolean isLocToValid = true;
//Changed by Rohan on 18-03-13 for define variable.end
int noOfChilds = 0;
int noOfParent = 0;
int count = 0;
......@@ -423,6 +431,64 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
lotNo = genericUtility.getColumnValue("lot_no__fr", allDom, "3" );
lpnNo = genericUtility.getColumnValue("lot_sl__fr", allDom, "3" );
//Changed by Rohan on 16-04-13 For Stock Transfer ,Expired stock can not be transfer from location configured in Disparm.start
locCode = genericUtility.getColumnValue("loc_code", allDom, "2" );
sql ="SELECT COUNT(*) AS LOCCOUNT FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? " +
" AND LOT_NO = ? AND LOT_SL = ? AND EXP_DATE <= fn_sysdate()";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, siteCode );
pstmt.setString( 3, locCode );
pstmt.setString( 4, lotNo );
pstmt.setString( 5, lpnNo );
rs = pstmt.executeQuery();
if( rs.next() )
{
locCount = rs.getInt("LOCCOUNT");
}
pstmt.close();
rs.close();
pstmt = null;
rs =null;
if(locCount > 0)
{
locInvList = distCommon.getDisparams("999999","NOT_TRANF_INV_STAT",conn);
System.out.println("locInvList>>>>>>"+locInvList);
if((!"".equalsIgnoreCase(locInvList.trim()) || locInvList != null) && locInvList.trim().length() > 0 )
{
locList = locInvList.split(",");
sql = "SELECT INV_STAT FROM LOCATION WHERE LOC_CODE = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, locCodeTo );
rs = pstmt.executeQuery();
if( rs.next() )
{
invStatLoc = rs.getString("INV_STAT");
}
for(int i =0; i < locList.length ; i++)
{
System.out.println("Comparing values"+invStatLoc+"locList[i]"+locList[i]);
if(invStatLoc.trim().equalsIgnoreCase(locList[i].trim()))
{
errList.add( "VTLOCNTVAL" );
errFields.add( childNodeName.toLowerCase());
isLocToValid = false;
break;
}
}
}
}
System.out.println("isLocToValid["+isLocToValid+"]");
if(isLocToValid)
{
//Changed by Rohan on 16-04-13 For Stock Transfer ,Expired stock can not be transfer from location configured in Disparm.end
sql = "SELECT SINGLE_LOT_SL, ITEM_LOT_OPT, INV_STAT FROM LOCATION WHERE LOC_CODE = ?";//Changes are done by Dipak On 4 June 2012
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, locCodeTo );
......@@ -588,6 +654,8 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
}
}//end of itemLotOpt == "1"
}//else of singleLotSl =="Y"
//Changed by Rohan on 16-04-13 For Stock Transfer ,Expired stock can not be transfer from location configured in Disparm
}
}//End of case "loc_code__to"
else if( "lot_sl__to".equalsIgnoreCase( childNodeName ) )//Case added by gulzar on 21/12/11
{
......
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