Commit 384fb41b authored by msharma's avatar msharma

set Costrate from siteitem master.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95207 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cf3a9f3c
...@@ -176,6 +176,7 @@ QCTransferConfLocal, QCTransferConfRemote ...@@ -176,6 +176,7 @@ QCTransferConfLocal, QCTransferConfRemote
double rate=0; double rate=0;
double grossRate=0; double grossRate=0;
String dimension=""; String dimension="";
boolean isFound=false;
try try
{ {
StockUpdate stockUpdate = new StockUpdate(); StockUpdate stockUpdate = new StockUpdate();
...@@ -507,18 +508,38 @@ QCTransferConfLocal, QCTransferConfRemote ...@@ -507,18 +508,38 @@ QCTransferConfLocal, QCTransferConfRemote
pstmt=null; pstmt=null;
if(considerYield.equalsIgnoreCase("N")) if(considerYield.equalsIgnoreCase("N"))
{ {
sql="select cost_rate from item where item_code=?";
sql="select cost_rate from siteitem where site_code=? and item_code=?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode); pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
costRate=rs.getDouble(1); costRate=rs.getDouble(1);
isFound=true;
} }
rs.close(); rs.close();
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
if(!isFound)
{
sql="select cost_rate from item where item_code=?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs=pstmt.executeQuery();
if(rs.next())
{
costRate=rs.getDouble(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
stockUpd.put("rate", costRate); stockUpd.put("rate", costRate);
stockUpd.put("gross_rate", costRate); stockUpd.put("gross_rate", costRate);
......
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