Commit 08dab32b authored by agaikwad's avatar agaikwad

set exp date as mfg_date item_change


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104997 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ea17ad57
...@@ -3110,7 +3110,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -3110,7 +3110,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt.setString(1,lstranid); pstmt.setString(1,lstranid);
pstmt.setString(2,lspurcorder); pstmt.setString(2,lspurcorder);
pstmt.setString(3,itemcode); pstmt.setString(3,itemcode);
pstmt.setString(4,lsbatchno); pstmt.setString(4,lsbatchno.trim());
pstmt.setString(5,lslineno); pstmt.setString(5,lslineno);
pstmt.setString(6,lsrcpline); pstmt.setString(6,lsrcpline);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -3130,7 +3130,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -3130,7 +3130,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(lsbatchno!=null || lsbatchno.trim().length()>0) if(lsbatchno!=null && lsbatchno.trim().length()>0)
{ {
lslineno = " " + lslineno; lslineno = " " + lslineno;
lslineno = lslineno.substring(lslineno.length() - 3, lslineno.length()); lslineno = lslineno.substring(lslineno.length() - 3, lslineno.length());
...@@ -6536,7 +6536,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6536,7 +6536,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
valueXmlString.append("<expiry_date >").append("").append("</expiry_date>"); valueXmlString.append("<expiry_date >").append("").append("</expiry_date>");
} }
if(mfgParseDate== null || mfgParseDate.trim().length() == 0) else
{ {
System.out.println("ldtmfgdate if lsmfgset null["+ldtmfgdate+"]"); System.out.println("ldtmfgdate if lsmfgset null["+ldtmfgdate+"]");
mfgParseDate=sdf1.format(ldmfgdate); mfgParseDate=sdf1.format(ldmfgdate);
...@@ -7309,8 +7309,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7309,8 +7309,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
{ {
valueXmlString.append("<expiry_date >").append("").append("</expiry_date>"); valueXmlString.append("<expiry_date >").append("").append("</expiry_date>");
} }
else
if(mfgParseDate== null || mfgParseDate.trim().length() == 0)
{ {
System.out.println("ldtmfgdate if lsmfgset null["+ldtmfgdate+"]"); System.out.println("ldtmfgdate if lsmfgset null["+ldtmfgdate+"]");
mfgParseDate=sdf1.format(ldmfgdate); mfgParseDate=sdf1.format(ldmfgdate);
...@@ -8330,14 +8329,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8330,14 +8329,17 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
} }
else if(currentColumn.trim().equalsIgnoreCase("mfg_date")) else if(currentColumn.trim().equalsIgnoreCase("mfg_date"))
{ {
java.sql.Timestamp mmfgDate = null,expirydate=null; java.sql.Timestamp mmfgDate = null;//,expirydate=null;
Timestamp expDate11=null,expDate12=null; Timestamp expDate11=null,expDate12=null;
String dtStr2="";
String lsshelflifetype="",lsmfgset="",expDate=""; String lsshelflifetype="",lsmfgset="",expDate="";
lsitemcode = genericUtility.getColumnValue( "item_code", dom ); // dw_detedit[ii_currformno].getitemstring(1,"item_code") lsitemcode = genericUtility.getColumnValue( "item_code", dom ); // dw_detedit[ii_currformno].getitemstring(1,"item_code")
String dtStr = genericUtility.getColumnValue( "mfg_date", dom ); //dw_detedit[ii_currformno].getitemdatetime(1,"mfg_date") String dtStr = genericUtility.getColumnValue( "mfg_date", dom ); //dw_detedit[ii_currformno].getitemdatetime(1,"mfg_date")
if(dtStr != null) System.out.println("dtStr[mfg_date]["+dtStr+"]");
if(dtStr != null)
{ {
mmfgDate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mmfgDate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("Format mmfgDate[mfg_date]["+mmfgDate+"]");
} }
sql="select (case when track_shelf_life is null then 'N' else track_shelf_life end)," + sql="select (case when track_shelf_life is null then 'N' else track_shelf_life end)," +
"(case when shelf_life is null then 0 else shelf_life end )," + "(case when shelf_life is null then 0 else shelf_life end )," +
...@@ -8371,14 +8373,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8371,14 +8373,16 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
System.out.println("Now the date is :=> " + sysDate); System.out.println("Now the date is :=> " + sysDate);
valueXmlString.append("<mfg_date >").append("<![CDATA[" + sysDate + "]]>").append("</mfg_date>"); valueXmlString.append("<mfg_date >").append("<![CDATA[" + sysDate + "]]>").append("</mfg_date>");
} }
lsmfgset = disscommon.getDisparams("999999", "PRCP_MFG_EXP_DT_SET", conn); lsmfgset = disscommon.getDisparams("999999", "PRCP_MFG_EXP_DT_SET", conn);
String dtStr1 = genericUtility.getColumnValue( "expiry_date", dom ); //dw_detedit[ii_currformno].getitemdatetime(1,"mfg_date") String dtStr1 = genericUtility.getColumnValue( "expiry_date", dom ); //dw_detedit[ii_currformno].getitemdatetime(1,"mfg_date")
System.out.println("dtStr1["+dtStr1+"]");//dhiraj System.out.println("dtStr1["+dtStr1+"]");//dhiraj
if(dtStr1 != null) if(dtStr1 != null)
{ {
expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); /*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("expirydate@D["+expirydate+"]");//dhiraj System.out.println("expirydate@D["+expirydate+"]");//dhiraj
} */ dtStr2=dtStr1;
System.out.println("dtStr2["+dtStr2+"]");
}
if(!"Y".equalsIgnoreCase(lsmfgset) && !"U".equalsIgnoreCase(lsmfgset)) if(!"Y".equalsIgnoreCase(lsmfgset) && !"U".equalsIgnoreCase(lsmfgset))
{ {
//expDate=Dis calcExpiry(dtStr,lishelflife); //expDate=Dis calcExpiry(dtStr,lishelflife);
...@@ -8397,12 +8401,14 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -8397,12 +8401,14 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
System.out.println("dtStr1 Exp Date "+dtStr1); System.out.println("dtStr1 Exp Date "+dtStr1);
if(dtStr1 != null) if(dtStr1 != null)
{ {
expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); /*expirydate = Timestamp.valueOf(genericUtility.getValidDateString(dtStr1, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("expirydate@D@E["+expirydate+"]");//dhiraj System.out.println("expirydate@D@E["+expirydate.toString()+"]");//dhiraj
*/ dtStr2=dtStr1;
System.out.println("dtStr2["+dtStr2+"]");
//expirydate = CalcExpiry1(mmfgDate, lishelflife);//DHIRAJ //expirydate = CalcExpiry1(mmfgDate, lishelflife);//DHIRAJ
//System.out.println("expirydate@CalcX@E["+expirydate+"]");//dhiraj //System.out.println("expirydate@CalcX@E["+expirydate+"]");//dhiraj
} }
valueXmlString.append("<retest_date >").append("<![CDATA[" + expirydate + "]]>").append("</retest_date>"); valueXmlString.append("<retest_date >").append("<![CDATA[" + dtStr2 + "]]>").append("</retest_date>");
} }
else else
{ {
......
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