Commit bb3e57c0 authored by manohar's avatar manohar

In case status is D the invoice_id and line_no__itrace are not retrieved and a...

In case status is D the invoice_id and line_no__itrace are not retrieved and a nullpointer exception is thrown, corrected


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93859 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5e081628
......@@ -4498,17 +4498,38 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
lsRetRepFlag = genericUtility.getColumnValue( "ret_rep_flag", dom ); // dw_detedit[ii_currformno].getitemstring(dw_detedit[ii_currformno].getrow(),"ret_rep_flag")
mcode = genericUtility.getColumnValue( "item_code", dom ); // dw_detedit[ii_currformno].getitemstring(dw_detedit[ii_currformno].getrow(),"item_code")
System.out.println( "lsRetRepFlag :7: " + lsRetRepFlag );
lsInvoiceId = genericUtility.getColumnValue( "invoice_id", dom1 ); //dw_header.getitemstring(1, "invoice_id")
System.out.println( "lsInvoiceId :157: " + lsInvoiceId );
if( lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) )
{
boolean recordNotFound = true;
//mlineNoInv = Integer.parseInt( getNumString( genericUtility.getColumnValue( "line_no__inv", dom ) ) ); //dw_detedit[ii_currformno].getitemnumber(dw_detedit[ii_currformno].getrow(),'line_no__inv')
//Added by Manoj dtd 05/12/12 to cast double to int
mlineNoInv =(int) Double.parseDouble(( getNumString( genericUtility.getColumnValue( "line_no__inv", dom ) ) ));
String llLinenotraceStr = genericUtility.getColumnValue( "line_no__invtrace", dom ); //dw_detedit[ii_currformno].getitemnumber(dw_detedit[ii_currformno].getrow(),'line_no__invtrace')
if (llLinenotraceStr != null && llLinenotraceStr.indexOf(".") > 0)
{
llLinenotraceStr = llLinenotraceStr.substring(0,llLinenotraceStr.indexOf("."));
}
llLinenotraceStr = llLinenotraceStr == null || llLinenotraceStr.trim().length() == 0 ? "0" : llLinenotraceStr.trim();
llLinenotrace = Integer.parseInt( llLinenotraceStr == null || llLinenotraceStr.trim().length() == 0 ? "0" : llLinenotraceStr.trim() );
if( llLinenotrace > 0 )
{
System.out.println( "recordNotFound :4519: " + recordNotFound );
}
}
if( !"P".equalsIgnoreCase( lsRetRepFlag ) )
{
sqlStr = " select item_code ls_invoice_item "
+" from invoice_trace "
+" where invoice_id = ? " //:ls_invoice_id
+" and inv_line_no = ? "; //:mline_no_inv;
+" and line_no = ? "; //:mline_no_inv;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, lsInvoiceId );
pstmt.setInt( 2, mlineNoInv );
pstmt.setInt( 2, llLinenotrace );
rs = pstmt.executeQuery();
if( rs.next() )
......
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