Commit c76985d2 authored by cpatil's avatar cpatil

adding for mfg_date also


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91876 ce508802-f39f-4f6c-b175-0d175dae99d5
parent efbab775
...@@ -2832,6 +2832,120 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -2832,6 +2832,120 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
valueXmlString.append("<discount>").append("<![CDATA[" + mdisc + "]]>").append("</discount>"); valueXmlString.append("<discount>").append("<![CDATA[" + mdisc + "]]>").append("</discount>");
} }
//dw_detedit[ii_currformno].setitem(dw_detedit[ii_currformno].getrow(),"discount",mdisc); //dw_detedit[ii_currformno].setitem(dw_detedit[ii_currformno].getrow(),"discount",mdisc);
// added by cpatil on 3-SEP-12 for status start
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 );
if(lotNo != null && lotSl != null )
{
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( dtStr!= null && expDateStr != null) //mmfgDate
{
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
}//end of mfg_date. }//end of mfg_date.
else if (currentColumn.trim().equals( "status" ) ) else if (currentColumn.trim().equals( "status" ) )
{ {
...@@ -3332,7 +3446,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3332,7 +3446,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
lcDiscount = Double.parseDouble( lcDiscountStr == null || lcDiscountStr.trim().length() == 0 ? "0" : lcDiscountStr.trim() ); lcDiscount = Double.parseDouble( lcDiscountStr == null || lcDiscountStr.trim().length() == 0 ? "0" : lcDiscountStr.trim() );
valueXmlString.append("<discount>").append("<![CDATA["+ mdisc +"]]>").append("</discount>"); valueXmlString.append("<discount>").append("<![CDATA["+ mdisc +"]]>").append("</discount>");
//valueXmlString.append("<exp_date>").append("<![CDATA["+ ldExpDateStr +"]]>").append("</exp_date>"); valueXmlString.append("<exp_date>").append("<![CDATA["+ ldExpDateStr +"]]>").append("</exp_date>");
System.out.println("@@@@@ expiry date item change code end .... "); System.out.println("@@@@@ expiry date item change code end .... ");
// cpatil end // cpatil end
...@@ -3342,7 +3456,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3342,7 +3456,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
String expDateStr = genericUtility.getColumnValue( "exp_date", dom ); String expDateStr = genericUtility.getColumnValue( "exp_date", dom );
lotNo = genericUtility.getColumnValue( "lot_no", dom ); lotNo = genericUtility.getColumnValue( "lot_no", dom );
lotSl = genericUtility.getColumnValue( "lot_sl", dom ); lotSl = genericUtility.getColumnValue( "lot_sl", dom );
if( lotNo != null && lotSl != null )
{
sqlStr = " select count(*) from stock where lot_no = ? and lot_sl= ? " ; sqlStr = " select count(*) from stock where lot_no = ? and lot_sl= ? " ;
pstmt = conn.prepareStatement( sqlStr ); pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, lotNo ); pstmt.setString( 1, lotNo );
...@@ -3436,7 +3551,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3436,7 +3551,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
} }
} }
} }
}
// added by cpatil on 3-SEP-12 End // added by cpatil on 3-SEP-12 End
...@@ -4667,7 +4782,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -4667,7 +4782,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
if( pstmt != null ) if( pstmt != null )
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("@@@@@ mdateStr out :["+mdateStr+"]["+mdateStr.length()); System.out.println("@@@@@ mdateStr out : ["+mdateStr+"]");
if( lsTrackShelfLife != null && "Y".equalsIgnoreCase( lsTrackShelfLife.trim() ) ) if( lsTrackShelfLife != null && "Y".equalsIgnoreCase( lsTrackShelfLife.trim() ) )
{ {
if( mdateStr == null || mdateStr.trim().length() == 0 ) if( mdateStr == null || mdateStr.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