Commit 09c7ee89 authored by msharma's avatar msharma

Sales Return Discount on LotSL DI1ISUN006 Done By Mahesh


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91654 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 58303799
......@@ -3580,6 +3580,86 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{
valueXmlString.append("<discount>").append("<![CDATA[" + mdisc + "]]>").append("</discount>");
}
// else part added ba Mahesh Patidar on 28/03/12 for discount value change according to lot_sl
else
{
itemCode = genericUtility.getColumnValue("item_code", dom);
invoiceId = genericUtility.getColumnValue("invoice_id", dom1);
retReplFlag = genericUtility.getColumnValue("ret_rep_flag", dom);
lineNoTrace = genericUtility.getColumnValue("line_no__invtrace", dom);
iLineNoTrace = Integer.parseInt( getNumString( lineNoTrace ) );
if (invoiceId != null && invoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( invoiceId.trim() ) )
{
System.out.println( " retReplFlag :2: " + retReplFlag );
if (retReplFlag.equals("R"))
{
sql = "select sord_no, sord_line_no "
+ " from invoice_trace "
+ " where invoice_id = ? "
+ " and line_no = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId );
pstmt.setInt( 2, iLineNoTrace );
rs = pstmt.executeQuery();
if( rs.next() )
{
sorder = rs.getString(1);
sordLineNo = rs.getString(2);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
sql = "select count(1) from invoice_trace "
+ " where invoice_id = ? "
+ " and item_code = ? "
+ " and sord_no = ? "
+ " and sord_line_no = ? "
+ " and item_code <> item_code__ord " ;
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId );
pstmt.setString( 2, itemCode );
pstmt.setString( 3, sorder );
pstmt.setString( 4, sordLineNo );
rs = pstmt.executeQuery();
cnt = 0;
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
System.out.println( " cnt :1: " + cnt );
if(cnt == 0)
{
System.out.println( "if in " );
sql = "select discount "
+ " from invoice_trace "
+ " where invoice_id = ? "
+ " and line_no = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId);
pstmt.setInt( 2, iLineNoTrace);
rs = pstmt.executeQuery();
if( rs.next() )
{
discount = rs.getDouble(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
}
}
valueXmlString.append("<discount>").append("<![CDATA[" + discount + "]]>").append("</discount>");
setNodeValue( dom, "discount", discount );
} // ended else by Mahesh
mtranDateStr = genericUtility.getColumnValue( "tran_date", dom1 );
mtranDate = Timestamp.valueOf(genericUtility.getValidDateString( mtranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");//dw_header.getitemdatetime(1,"tran_date")
sqlStr = "select count(*) mcount1 " //into :mcount1
......
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