Commit bb753461 authored by manohar's avatar manohar

no_art, gross_weight,tare_weight and net_weight set as per stock on itemchange of lot_sl


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95979 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0adc1f11
......@@ -2305,6 +2305,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
infoMap = new HashMap();
retReplFlag = genericUtility.getColumnValue("ret_repl_flag", dom);
siteCode = genericUtility.getColumnValue("site_code", dom1);
// 20/08/14 manoharan cust_code is used below for getting no_art
custCode = genericUtility.getColumnValue("cust_code", dom1);
locCode = genericUtility.getColumnValue("loc_code", dom);
lotNo = genericUtility.getColumnValue("lot_no", dom);
lotSl = genericUtility.getColumnValue("lot_sl", dom);
......@@ -3924,8 +3926,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
String lcQtyStr = genericUtility.getColumnValue( "quantity", dom );//dw_detedit[ii_currformno].GetItemNumber(1, "quantity")
lcQty = Double.parseDouble( getNumString( lcQtyStr ) );
sqlStr = " select (case when qty_per_art is null then 1 else qty_per_art end) "//into :lc_qty_per_art
double grwtPerArt = 0, trwtPerArt = 0;
sqlStr = " select (case when qty_per_art is null then 1 else qty_per_art end), GROSS_WT_PER_ART,TARE_WT_PER_ART "//into :lc_qty_per_art
+" from stock "
+" where item_code = ? " //:mitem_code
+" and site_code = ? " //:msite_code
......@@ -3946,20 +3948,27 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if( rs.next() )
{
lcQtyPerArt = rs.getDouble( 1 );
grwtPerArt = rs.getDouble( 2 );
trwtPerArt = rs.getDouble( 3 );
}
else
{
// 20/08/14 manoharan the else condition is not required
//else
//{
if( lcQtyPerArt > 0 )
{
int llNoArt = (int)(lcQty / lcQtyPerArt);
if( llNoArt > 0 )
{
valueXmlString.append("<no_art>").append("<![CDATA[" + llNoArt + "]]>").append("</no_art>");
valueXmlString.append("<gross_weight>").append("<![CDATA[" + getReqDecimal((llNoArt * grwtPerArt),3) + "]]>").append("</gross_weight>");
valueXmlString.append("<tare_weight>").append("<![CDATA[" + getReqDecimal((llNoArt * trwtPerArt),3)+ "]]>").append("</tare_weight>");
valueXmlString.append("<net_weight>").append("<![CDATA[" + getReqDecimal((llNoArt * (grwtPerArt - trwtPerArt) ),3) + "]]>").append("</net_weight>");
}
}
}
//}
rs.close();
rs = null;
pstmt.close();
......
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