Commit 78fdcc83 authored by manohar's avatar manohar

In case return is not against invoce reference parsing of line_no__invtrace...

In case return is not against invoce reference parsing of line_no__invtrace exception handled properly


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92634 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 54d09ed4
...@@ -1815,7 +1815,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -1815,7 +1815,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
lineNoInvStr = lineNoInvStr.substring(0,pos); lineNoInvStr = lineNoInvStr.substring(0,pos);
} }
System.out.println( "lineNoInvStr after:: " + lineNoInvStr ); System.out.println( "lineNoInvStr after:: " + lineNoInvStr );
lineNoInv = Integer.parseInt( getNumString( lineNoInvStr ) ); lineNoInvStr = lineNoInvStr == null || lineNoInvStr.trim().length() == 0 ? "0" : lineNoInvStr.trim();
lineNoInv = Integer.parseInt( lineNoInvStr );
valStr = genericUtility.getColumnValue( "quantity__stduom", dom ); valStr = genericUtility.getColumnValue( "quantity__stduom", dom );
valStr = valStr == null || valStr.trim().length() == 0 ? "0" : valStr.trim(); valStr = valStr == null || valStr.trim().length() == 0 ? "0" : valStr.trim();
...@@ -2421,7 +2422,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -2421,7 +2422,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
retOpt = genericUtility.getColumnValue("ret_opt", dom1); retOpt = genericUtility.getColumnValue("ret_opt", dom1);
if (invoiceId != null && invoiceId.trim().length() > 0 && lineNoTrace != null && lineNoTrace.trim().length() > 0 ) if (invoiceId != null && invoiceId.trim().length() > 0 && lineNoTrace != null && lineNoTrace.trim().length() > 0 )
{ {
lineNoTrace = lineNoTrace == null || lineNoTrace.trim().length() == 0 ? "0" : lineNoTrace.trim();
if( lineNoTrace != null ) if( lineNoTrace != null )
{ {
pos = lineNoTrace.indexOf("."); pos = lineNoTrace.indexOf(".");
...@@ -2448,7 +2449,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -2448,7 +2449,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
//lineNoInv = Integer.parseInt( getNumString( rs.getString("inv_line_no") ) ); //lineNoInv = Integer.parseInt( getNumString( rs.getString("inv_line_no") ) );
lineNoInvStr = getNumString( rs.getString("inv_line_no") ) ; lineNoInvStr = getNumString( rs.getString("inv_line_no") ) ;
lineNoInvStr = lineNoInvStr == null || lineNoInvStr.trim().length() == 0 ? "0" : lineNoInvStr.trim();
if( lineNoInvStr != null ) if( lineNoInvStr != null )
{ {
pos = lineNoInvStr.indexOf("."); pos = lineNoInvStr.indexOf(".");
...@@ -2640,7 +2641,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -2640,7 +2641,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
lineNoTrace = lineNoTrace.substring(0,pos); lineNoTrace = lineNoTrace.substring(0,pos);
} }
lineNoTrace = lineNoTrace == null || lineNoTrace.trim().length() == 0 ? "0" : lineNoTrace.trim();
pstmt.setInt( 2, Integer.parseInt(lineNoTrace)); pstmt.setInt( 2, Integer.parseInt(lineNoTrace));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next() ) if( rs.next() )
...@@ -2670,7 +2671,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -2670,7 +2671,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
lineNoTrace = lineNoTrace.substring(0,pos); lineNoTrace = lineNoTrace.substring(0,pos);
} }
lineNoTrace = lineNoTrace == null || lineNoTrace.trim().length() == 0 ? "0" : lineNoTrace.trim();
pstmt.setInt( 2, Integer.parseInt( lineNoTrace ) ); pstmt.setInt( 2, Integer.parseInt( lineNoTrace ) );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next() ) if( rs.next() )
...@@ -2996,6 +2997,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -2996,6 +2997,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
iValStr = iValStr.substring(0,iValStr.indexOf(".")); iValStr = iValStr.substring(0,iValStr.indexOf("."));
} }
infoMap = new HashMap();
iValStr = iValStr == null || iValStr.trim().length() == 0 ? "0" : iValStr.trim();
lineNoInv = Integer.parseInt( getNumString( iValStr ) ); lineNoInv = Integer.parseInt( getNumString( iValStr ) );
iValStr = genericUtility.getColumnValue( "quantity__stduom", dom); iValStr = genericUtility.getColumnValue( "quantity__stduom", dom);
qtyStdUom = Double.parseDouble( getNumString( iValStr ) ); qtyStdUom = Double.parseDouble( getNumString( iValStr ) );
...@@ -3003,15 +3006,19 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -3003,15 +3006,19 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
lotSl = genericUtility.getColumnValue("lot_sl", dom); lotSl = genericUtility.getColumnValue("lot_sl", dom);
locCode = genericUtility.getColumnValue("loc_code", dom); locCode = genericUtility.getColumnValue("loc_code", dom);
lineNoTrace = genericUtility.getColumnValue("line_no__invtrace", dom); lineNoTrace = genericUtility.getColumnValue("line_no__invtrace", dom);
if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0) if (lineNoTrace != null )
{ {
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf(".")); if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0)
} {
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
iLineNoTrace = Integer.parseInt( lineNoTrace ); }
iLineNoTrace = Integer.parseInt( lineNoTrace );
infoMap.put("line_no__invtrace",lineNoTrace);
}
quantity = qtyStdUom; quantity = qtyStdUom;
infoMap = new HashMap();
infoMap.put("ret_repl_flag",retReplFlag); infoMap.put("ret_repl_flag",retReplFlag);
infoMap.put("item_code", itemCode); infoMap.put("item_code", itemCode);
...@@ -3021,7 +3028,6 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -3021,7 +3028,6 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
infoMap.put("lot_sl", lotSl); infoMap.put("lot_sl", lotSl);
infoMap.put("tran_date", tranDate); infoMap.put("tran_date", tranDate);
infoMap.put("invoice_id", invoiceId); infoMap.put("invoice_id", invoiceId);
infoMap.put("line_no__invtrace",lineNoTrace);
infoMap.put( "quantity__stduom", new Double( -1 * quantity ) ); infoMap.put( "quantity__stduom", new Double( -1 * quantity ) );
costRate = getCostRate(infoMap, conn); costRate = getCostRate(infoMap, conn);
infoMap = null; infoMap = null;
...@@ -3661,7 +3667,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -3661,7 +3667,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf(".")); lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
} }
lineNoTrace = lineNoTrace == null || lineNoTrace.trim().length() == 0 ? "0" : lineNoTrace.trim();
iLineNoTrace = Integer.parseInt( lineNoTrace ); iLineNoTrace = Integer.parseInt( lineNoTrace );
if (invoiceId != null && invoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( invoiceId.trim() ) ) if (invoiceId != null && invoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( invoiceId.trim() ) )
{ {
...@@ -4236,7 +4242,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -4236,7 +4242,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
llLinenotraceStr = llLinenotraceStr.substring(0,llLinenotraceStr.indexOf(".")); 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() ); llLinenotrace = Integer.parseInt( llLinenotraceStr == null || llLinenotraceStr.trim().length() == 0 ? "0" : llLinenotraceStr.trim() );
if( llLinenotrace > 0 ) if( llLinenotrace > 0 )
...@@ -5696,7 +5702,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -5696,7 +5702,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
mlineNoStr = mlineNoStr.substring(0,mlineNoStr.indexOf(".")); mlineNoStr = mlineNoStr.substring(0,mlineNoStr.indexOf("."));
} }
mlineNoStr = mlineNoStr == null || mlineNoStr.trim().length() == 0 ? "0" : mlineNoStr.trim();
mlineNo = Integer.parseInt( mlineNoStr.trim() ); mlineNo = Integer.parseInt( mlineNoStr.trim() );
mVal1 = genericUtility.getColumnValue( "invoice_id", dom ); mVal1 = genericUtility.getColumnValue( "invoice_id", dom );
if ( mlineNo != 0 ) if ( mlineNo != 0 )
...@@ -5882,7 +5888,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -5882,7 +5888,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf(".")); llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
} }
llLineNoInvtraceStr = llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim();
llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim() ); llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim() );
if( ( !"P".equalsIgnoreCase( lsFlag ) ) && lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) ) if( ( !"P".equalsIgnoreCase( lsFlag ) ) && lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) )
...@@ -6006,7 +6012,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -6006,7 +6012,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf(".")); llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
} }
llLineNoInvtraceStr = llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim();
llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim() ); llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim() );
sqlStr = " select i.SORD_NO as SORD_NO, i.SORD_LINE_NO as LINE_NO__SORD" sqlStr = " select i.SORD_NO as SORD_NO, i.SORD_LINE_NO as LINE_NO__SORD"
+" from invoice_trace i " +" from invoice_trace i "
...@@ -6613,7 +6619,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -6613,7 +6619,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf(".")); llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf("."));
} }
llLineNoStr = llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim();
llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim() ); llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim() );
lsRetOpt = genericUtility.getColumnValue( "ret_opt", dom1 ); lsRetOpt = genericUtility.getColumnValue( "ret_opt", dom1 );
String llLineNoInvStr = getNumString(genericUtility.getColumnValue( "line_no__inv", dom ));//dw_detedit[ii_currformno].getitemnumber(1,"line_no__inv") String llLineNoInvStr = getNumString(genericUtility.getColumnValue( "line_no__inv", dom ));//dw_detedit[ii_currformno].getitemnumber(1,"line_no__inv")
...@@ -7009,7 +7015,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -7009,7 +7015,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0) if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0)
{ {
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf(".")); llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
} }
llLineNoInvtraceStr = llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim();
llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr.trim() ); llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr.trim() );
lsTranId = genericUtility.getColumnValue( "tran_id", dom ); lsTranId = genericUtility.getColumnValue( "tran_id", dom );
if( lcQty < 0 ) if( lcQty < 0 )
...@@ -7039,7 +7046,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -7039,7 +7046,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf(".")); llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf("."));
} }
llLineNoStr = llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim();
llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim() ); llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim() );
sqlStr = " Select (a.quantity - case when a.alloc_qty is null then 0 else a.alloc_qty end - case when a.hold_qty is null then 0 else a.hold_qty end) lc_stkqty " sqlStr = " Select (a.quantity - case when a.alloc_qty is null then 0 else a.alloc_qty end - case when a.hold_qty is null then 0 else a.hold_qty end) lc_stkqty "
+" from stock a, invstat b " +" from stock a, invstat b "
...@@ -7444,7 +7451,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -7444,7 +7451,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{ {
liLineNoStr = liLineNoStr.substring(0,liLineNoStr.indexOf(".")); liLineNoStr = liLineNoStr.substring(0,liLineNoStr.indexOf("."));
} }
liLineNo = Integer.parseInt( liLineNoStr == null || liLineNoStr.trim().length() == 0 ? "0" : liLineNoStr.trim() ); liLineNo = Integer.parseInt( liLineNoStr == null || liLineNoStr.trim().length() == 0 ? "0" : liLineNoStr.trim() );
sqlStr = " select ( case when sum(adj_amt) is null then 0 else sum(adj_amt) end ) lc_sum_adj " sqlStr = " select ( case when sum(adj_amt) is null then 0 else sum(adj_amt) end ) lc_sum_adj "
+" from sreturn_inv " +" from sreturn_inv "
...@@ -7719,7 +7726,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales ...@@ -7719,7 +7726,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0) if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0)
{ {
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf(".")); lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
} }
lineNoTrace = lineNoTrace == null || lineNoTrace.trim().length() == 0 ? "0" : lineNoTrace.trim();
iLineNoTrace = Integer.parseInt(lineNoTrace); iLineNoTrace = Integer.parseInt(lineNoTrace);
despId = ""; despId = "";
pstmt= conn.prepareStatement(sql); pstmt= conn.prepareStatement(sql);
......
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