Commit 35f9b63d authored by manohar's avatar manohar

Updated source received from Ritesh Tiwari from Sun


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97185 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 703475f4
package ibase.webitm.ejb.dis;
package ibase.webitm.ejb.chq;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
......@@ -2125,7 +2125,9 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
double frtRate=0,frtAmtQty=0,frtAmtFixed=0;
//SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String frtRateStr = "", frtAmtQtyStr = "", frtAmtFixedStr = "",conv_rtuom_stduomStr="";
String ordDateHdr = "";
double lastPurcRate = 0d;
String lastPurcPo = "";
try
{
......@@ -3036,7 +3038,18 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
valueXmlString.append("<item_code protect = \"0\">").append("<![CDATA["+itemCode+"]]>").append("</item_code>");
}
// added by ritesh on 02/feb/2015 for request S14ISUN007 start
lastPurcRate = 0d;
lastPurcPo = "";
//itemCode = genericUtility.getColumnValue("item_code", dom); //RITESH
ordDateHdr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
ordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateHdr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode,ordDate,siteCode,conn);System.out.println("lastPurcRate ::[ "+lastPurcRate+" ]");
lastPurcPo = getLastPurcPo(itemCode,ordDate,siteCode,conn);System.out.println("lastPurcPo ::[ "+lastPurcPo+" ]");
valueXmlString.append("<last_purc_rate>").append("<![CDATA["+ lastPurcRate +"]]>").append("</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append("<![CDATA["+ lastPurcPo +"]]>").append("</last_purc_po>");
// added by ritesh on 02/feb/2015 for request S14ISUN007 end
}
}
......@@ -3404,7 +3417,18 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
valueXmlString.append("<tax_env >").append("<![CDATA["+ taxEnv +"]]>").append("</tax_env>");
}
// added by ritesh on 02/feb/2015 for request S14ISUN007 start
lastPurcRate = 0d;
lastPurcPo = "";
//itemCode = genericUtility.getColumnValue("item_code", dom); //RITESH
ordDateHdr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
ordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateHdr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
lastPurcRate = getLastPurcRate(itemCode,ordDate,siteCode,conn);System.out.println("lastPurcRate ::[ "+lastPurcRate+" ]");
lastPurcPo = getLastPurcPo(itemCode,ordDate,siteCode,conn);System.out.println("lastPurcPo ::[ "+lastPurcPo+" ]");
valueXmlString.append("<last_purc_rate>").append("<![CDATA["+ lastPurcRate +"]]>").append("</last_purc_rate>");
valueXmlString.append("<last_purc_po>").append("<![CDATA["+ lastPurcPo +"]]>").append("</last_purc_po>");
// added by ritesh on 02/feb/2015 for request S14ISUN007 end
}
else if ( currentColumn.trim().equalsIgnoreCase("quantity") )
{
......@@ -3801,5 +3825,94 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
}
return msgType;
}
}
private double getLastPurcRate(String itemCode , Timestamp ordDate,String siteCode,Connection conn)
{
double lastPurRate = 0;
PreparedStatement pstmt = null ;
ResultSet rs = null;
String sql = "";
try
{
sql = "SELECT DDF_GET_LASTPURRATE(?,?,?) FROM DUAL ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setTimestamp(2,ordDate);
pstmt.setString(3,siteCode);
rs = pstmt.executeQuery();
while(rs.next())
{
lastPurRate = rs.getDouble(1);
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return lastPurRate;
}
private String getLastPurcPo(String itemCode , Timestamp ordDate,String siteCode,Connection conn)
{
String lastPurPo = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
String sql = "";
try
{
sql = "SELECT DDF_GET_PO(?,?,?) FROM DUAL ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setTimestamp(2,ordDate);
pstmt.setString(3,siteCode);
rs = pstmt.executeQuery();
while(rs.next())
{
lastPurPo = rs.getString(1);
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return lastPurPo;
}
}
\ No newline at end of file
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