Commit 414cb718 authored by ssalve's avatar ssalve

Sarita: Done changes for exp_date developement for(syncom) on 29 JUN 18

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187107 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9f13697d
...@@ -1851,6 +1851,42 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -1851,6 +1851,42 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
valueXmlString.append("<tax_env protect =\"0\">").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>"); valueXmlString.append("<tax_env protect =\"0\">").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>");
} }
valueXmlString.append("<stk_opt protect =\"1\">").append("<![CDATA[" + stkOpt + "]]>").append("</stk_opt>"); valueXmlString.append("<stk_opt protect =\"1\">").append("<![CDATA[" + stkOpt + "]]>").append("</stk_opt>");
//Added by sarita on 29 JUN 18 [START] on edit mode if exp_date available against lot_no , lot_sl , item_code and site_code in stock then system should not allow to change exp_date
String expDateStr = "";
int cntExpDate = 0;
expDateStr = genericUtility.getColumnValue("exp_date",dom);
siteCode = genericUtility.getColumnValue("site_code", dom1);
itemCode = genericUtility.getColumnValue("item_code", dom);
lotNo = genericUtility.getColumnValue("lot_no", dom);
lotSl = genericUtility.getColumnValue("lot_sl", dom);
System.out.println("For itemdefaultedit Values are expDateStr ["+expDateStr+"] \t siteCode ["+siteCode+"] \t itemCode ["+itemCode+"] \t locCode ["+locCode+"] \t lotNo ["+lotNo+"] \t lotSl ["+lotSl+"]");
if(expDateStr != null && expDateStr.trim().length() > 0)
{
sql = "select exp_date"
+ " from stock"
+ " where item_code = ? "
+ " and site_code = ? "
+ " and lot_no = ? "
+ " and 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() )
{
cntExpDate++;
expDate = rs.getTimestamp("exp_date");
System.out.println("[cntExpDate >> ["+cntExpDate+"]] && expDate >> ["+expDate+"]");
}
if(cntExpDate > 0)
{
valueXmlString.append("<exp_date protect =\"1\">").append("<![CDATA[" + new SimpleDateFormat(genericUtility.getApplDateFormat()).format(expDate).toString() + "]]>").append("</exp_date>");
}
}
//Added by sarita on 29 JUN 18 [END] on edit mode if exp_date available against lot_no , lot_sl , item_code and site_code in stock then system should not allow to change exp_date
} // end itm_defaultedit } // end itm_defaultedit
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
...@@ -4041,8 +4077,18 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -4041,8 +4077,18 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
} }
else else
{ {
//Added & Commented by sarita on 29 JUN 18 [START][if exp_date available against lot_no , lot_sl , item_code and site_code in stock then system should not allow to change exp_date]
if(expDate != null)
{
valueXmlString.append("<exp_date protect =\"1\">").append("<![CDATA[" + new SimpleDateFormat(genericUtility.getApplDateFormat()).format(expDate).toString() + "]]>").append("</exp_date>");
}
else
{
valueXmlString.append("<exp_date protect =\"0\">").append("<![CDATA[]]>").append("</exp_date>");
}
//valueXmlString.append("<exp_date protect =\"0\">").append("<![CDATA[" + ( expDate != null ? new SimpleDateFormat(genericUtility.getApplDateFormat()).format(expDate).toString() : "" ) + "]]>").append("</exp_date>");
//Added & Commented by sarita on 29 JUN 18 [END] [START][if exp_date available against lot_no , lot_sl , item_code and site_code in stock then system should not allow to change exp_date]
valueXmlString.append("<mfg_date protect =\"0\">").append("<![CDATA[" + ( mfgDate != null ? new SimpleDateFormat(genericUtility.getApplDateFormat()).format(mfgDate).toString() : "" ) + "]]>").append("</mfg_date>"); valueXmlString.append("<mfg_date protect =\"0\">").append("<![CDATA[" + ( mfgDate != null ? new SimpleDateFormat(genericUtility.getApplDateFormat()).format(mfgDate).toString() : "" ) + "]]>").append("</mfg_date>");
valueXmlString.append("<exp_date protect =\"0\">").append("<![CDATA[" + ( expDate != null ? new SimpleDateFormat(genericUtility.getApplDateFormat()).format(expDate).toString() : "" ) + "]]>").append("</exp_date>");
valueXmlString.append("<pack_code protect =\"1\">").append("<![CDATA[" + packCode + "]]>").append("</pack_code>"); valueXmlString.append("<pack_code protect =\"1\">").append("<![CDATA[" + packCode + "]]>").append("</pack_code>");
valueXmlString.append("<site_code__mfg protect =\"1\">").append("<![CDATA[" + siteCodeMfg + "]]>").append("</site_code__mfg>"); valueXmlString.append("<site_code__mfg protect =\"1\">").append("<![CDATA[" + siteCodeMfg + "]]>").append("</site_code__mfg>");
} }
...@@ -5303,7 +5349,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -5303,7 +5349,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
mmfgDate = distCommon.CalcExpiry( ldExpDate, mshlife * -1 ); mmfgDate = distCommon.CalcExpiry( ldExpDate, mshlife * -1 );
} }
valueXmlString.append("<mfg_date>").append("<![CDATA["+ genericUtility.getValidDateString(mmfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) +"]]>").append("</mfg_date>");
//Changes by sarita as if mexpDate is null then its giving NullPointerException on 28 JUN 18 [START]
//valueXmlString.append("<mfg_date>").append("<![CDATA["+ genericUtility.getValidDateString(mmfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) +"]]>").append("</mfg_date>");
valueXmlString.append("<mfg_date>").append("<![CDATA["+ ( mmfgDate != null ? genericUtility.getValidDateString(mmfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()) : "") +"]]>").append("</mfg_date>");
//Changes by sarita as if mexpDate is null then its giving NullPointerException on 28 JUN 18 [END]
String mtranDateStr = genericUtility.getColumnValue( "tran_date", dom1 ); String mtranDateStr = genericUtility.getColumnValue( "tran_date", dom1 );
mtranDate = Timestamp.valueOf(genericUtility.getValidDateString(mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mtranDate = Timestamp.valueOf(genericUtility.getValidDateString(mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.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