Commit 74af60f0 authored by kmandhre's avatar kmandhre

set exp_date in itemchange from disp parm


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92339 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 135aa5a9
...@@ -194,6 +194,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -194,6 +194,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
String sretLocCode="",taxCal="",itemCodeOrd=""; String sretLocCode="",taxCal="",itemCodeOrd="";
double effCost=0; double effCost=0;
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
int months = 0;
java.util.Date defaultExpDate = null;
try try
{ {
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB(); ITMDBAccessEJB dbEjb = new ITMDBAccessEJB();
...@@ -980,8 +982,11 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -980,8 +982,11 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
} }
valueXmlString.append("<ret_rep_flag protect =\"1\">").append("<![CDATA[R]]>").append("</ret_rep_flag>"); valueXmlString.append("<ret_rep_flag protect =\"1\">").append("<![CDATA[R]]>").append("</ret_rep_flag>");
valueXmlString.append("<status>").append("<![CDATA[S]]>").append("</status>"); //added by kunal on 7/12/12 as per Manoj instruction valueXmlString.append("<status>").append("<![CDATA[S]]>").append("</status>"); //added by kunal on 7/12/12 as per Manoj instruction
months = Integer.parseInt(distCommon.getDisparams("999999","DEFAULT_EXP_MONTHS",conn)==null?"0":distCommon.getDisparams("999999","DEFAULT_EXP_MONTHS",conn)) ;
System.out.println("months = "+months );
valueXmlString.append("<mfg_date>").append("<![CDATA["+simpleDateFormat.format(new Date(2012, 00,01))+"]]>").append("</mfg_date>");//added by kunal on 7/12/12 as per Manoj instruction valueXmlString.append("<mfg_date>").append("<![CDATA["+simpleDateFormat.format(new Date(2012, 00,01))+"]]>").append("</mfg_date>");//added by kunal on 7/12/12 as per Manoj instruction
valueXmlString.append("<exp_date>").append("<![CDATA["+simpleDateFormat.format(new Date(2049, 00, 01))+"]]>").append("</exp_date>");//added by kunal on 7/12/12 as per Manoj instruction valueXmlString.append("<exp_date>").append("<![CDATA["+simpleDateFormat.format(addMonths(new Date(2012, 00,01),months))+"]]>").append("</exp_date>");//added by kunal on 7/12/12 as per Manoj instruction
} }
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
...@@ -6148,4 +6153,17 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -6148,4 +6153,17 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
} }
return retVal ; return retVal ;
} }
private java.util.Date addMonths(java.util.Date date, int months) throws Exception ,ITMException //added by Kunal on 10/12/12
{
java.util.Date calculatedDate = null;
if (date != null) {
final GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.add(Calendar.MONTH, months);
calculatedDate = new java.util.Date(calendar.getTime().getTime());
}
return calculatedDate;
}
} }
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