Commit 770f3086 authored by cpatil's avatar cpatil

adding itemchage for status on exp_date


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91874 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 687cd368
...@@ -172,7 +172,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -172,7 +172,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
double minRate= 0 ,lcDiscount=0 ; double minRate= 0 ,lcDiscount=0 ;
String lineNoInvStr ="",mtranDateStr=""; String lineNoInvStr ="",mtranDateStr="";
String sRate = "0",lsDespId="",lsDespLineNo="",lsIinvoiceId=""; String sRate = "0",lsDespId="",lsDespLineNo="",lsIinvoiceId="";
int lineNoInv=0; int lineNoInv=0,cnt5=0;
double qtyStdUom=0,rate =0,fact=0; double qtyStdUom=0,rate =0,fact=0;
String locCode ="",taxChapHdr="",taxClassHdr="",taxEnvHdr=""; String locCode ="",taxChapHdr="",taxClassHdr="",taxEnvHdr="";
String lineNoTrace="",qtyStr="",unitStd=""; String lineNoTrace="",qtyStr="",unitStd="";
...@@ -3336,6 +3336,110 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3336,6 +3336,110 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
System.out.println("@@@@@ expiry date item change code end .... "); System.out.println("@@@@@ expiry date item change code end .... ");
// cpatil end // cpatil end
// added by cpatil on 3-SEP-12 for status start
System.out.println("@@@@@ expiry date item change code status end .... ");
mitemCode = genericUtility.getColumnValue( "item_code", dom );
String expDateStr = genericUtility.getColumnValue( "exp_date", dom );
lotNo = genericUtility.getColumnValue( "lot_no", dom );
lotSl = genericUtility.getColumnValue( "lot_sl", dom );
sqlStr = " select count(*) from stock where lot_no = ? and lot_sl= ? " ;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, lotNo );
pstmt.setString( 2, lotSl );
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt5 = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt5 == 0)
{
if(expDateStr != null)
{
expDate = Timestamp.valueOf(genericUtility.getValidDateString(expDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if( expDateStr != null )
{
if(expDate.after(ldtLrdate))
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"S"+"]]>").append("</status>");
}
else
{
sqlStr = " select ( case when shelf_life is null then 0 else shelf_life end ) mshlife "
+ " from item_lot_packsize where item_code = ? " ;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mitemCode );
rs = pstmt.executeQuery();
mshlife = 0;
if( rs.next() )
{
mshlife = rs.getDouble( "mshlife" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( mshlife == 0 )
{
mshlife = 0;
sqlStr = " select loc_code, shelf_life mshlife from item where item_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mitemCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mlocCode = rs.getString ("loc_code");
mshlife = rs.getDouble( "mshlife" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
System.out.println("@@@@@ :mshlife:["+mshlife+"]:::mlocCode:["+mlocCode+"]");
if( mshlife == 0 )
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"E"+"]]>").append("</status>");
}
else
{
if( "NEXP".equalsIgnoreCase(mlocCode.trim()) )
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"N"+"]]>").append("</status>");
}
else if( "HOLD".equalsIgnoreCase(mlocCode.trim()) )
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"H"+"]]>").append("</status>");
}
else if( "DMGD".equalsIgnoreCase(mlocCode.trim()) )
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"D"+"]]>").append("</status>");
}
else if( "EXP".equalsIgnoreCase(mlocCode.trim()) )
{
valueXmlString.append("<status protect =\"1\">").append("<![CDATA["+"E"+"]]>").append("</status>");
}
}
}
}
}
// added by cpatil on 3-SEP-12 End
} }
//ended By Mahesh Patidar //ended By Mahesh Patidar
else if (currentColumn.trim().equals( "stk_opt" ) ) else if (currentColumn.trim().equals( "stk_opt" ) )
......
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