Commit c1950b7d authored by msalla's avatar msalla

1)MRP rate and Last valued rate should show in depspatch detai

please find the jsp and jar and sql for the point.

2)In purchase order detail, item info is not displayed in which they need last purchase rate. which was there in ITM under Item Info button.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206436 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8fd5c959
...@@ -49,13 +49,14 @@ public class ItemDetails extends ValidatorEJB ...@@ -49,13 +49,14 @@ public class ItemDetails extends ValidatorEJB
} }
String sql = ""; String sql = "";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null,pstmt1= null;
ResultSet rs = null; ResultSet rs = null,rs1= null;
ArrayList itemList = new ArrayList(); ArrayList itemList = new ArrayList();
Timestamp orderDate=null; Timestamp orderDate=null,ordDate=null;
String phyAttrib2IT = "", phyAttrib2 = "", phyAttrib6IT = "", phyAttrib6 = "", phyAttrib4IT = "", phyAttrib4 = "", itemParent = "", String phyAttrib2IT = "", phyAttrib2 = "", phyAttrib6IT = "", phyAttrib6 = "", phyAttrib4IT = "", phyAttrib4 = "", itemParent = "",
parentDesrc = "", unit = "",hsnNo = ""; parentDesrc = "", unit = "",hsnNo = "";
String lsListType="",lsPriceList="",lsRefNo = ""; String lsListType="",lsPriceList="",lsRefNo = "";
double lastPurcRate=0;
int quantity = 0, allocQty = 0, holdQty = 0, availQty = 0,llPlcount=0; int quantity = 0, allocQty = 0, holdQty = 0, availQty = 0,llPlcount=0;
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
...@@ -261,6 +262,11 @@ sql =" select m.ITEM_CODE, m.descr as PARENT_DESCR, m.unit, x.QUANTITY, x.ALLOC_ ...@@ -261,6 +262,11 @@ sql =" select m.ITEM_CODE, m.descr as PARENT_DESCR, m.unit, x.QUANTITY, x.ALLOC_
} }
itemList.add(String.valueOf(mRate)); itemList.add(String.valueOf(mRate));
//added by monika 28 aug 2019
lastPurcRate =getLastPurcRate(itemCode,orderDate,siteCode,conn);
System.out.println("lastPurcRate11::::"+lastPurcRate);
itemList.add(String.valueOf(lastPurcRate));
//end
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -1425,7 +1431,40 @@ sql =" select m.ITEM_CODE, m.descr as PARENT_DESCR, m.unit, x.QUANTITY, x.ALLOC_ ...@@ -1425,7 +1431,40 @@ sql =" select m.ITEM_CODE, m.descr as PARENT_DESCR, m.unit, x.QUANTITY, x.ALLOC_
return (rate); return (rate);
} }
//added by monika 28 august 2019
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;
} //end
} }
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