Commit d9803880 authored by manohar's avatar manohar

line_no__inv, line_no__invtrace parsing error rectified


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92603 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2d4d0f02
......@@ -244,7 +244,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
distCommon = new DistCommon();
//String tempVal = null;
String reStr = null;
String reStr = null,lineNoInvStr = "0";
String siteCode = null;
String itemDescr = null,itemCode = null;
String loginSiteCode = null;
......@@ -344,7 +344,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
double mNum1= 0.0, mNum2= 0.0, mVal1= 0.0, fact= 0.0;
int llLinenotrace = 0;
int srNo = 0;
int pos;
int pos = 0;
int mdiffDays;
int noArt = 0;
String listType = null;
......@@ -1802,7 +1802,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
setNodeValue( dom, "unit__rate", unitRate );
invoiceId = genericUtility.getColumnValue("invoice_id",dom);
invoiceId = invoiceId == null ?"" : invoiceId.trim();
String lineNoInvStr = genericUtility.getColumnValue("line_no__inv",dom);
lineNoInvStr = genericUtility.getColumnValue("line_no__inv",dom);
System.out.println( "lineNoInvStr before:: " + lineNoInvStr );
pos = 0;
......@@ -2048,6 +2048,16 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{
lineNoTrace = genericUtility.getColumnValue( "line_no__invtrace", dom );
lineNoTrace = lineNoTrace == null ?"0" : lineNoTrace.trim();
if( lineNoTrace != null )
{
pos = lineNoTrace.indexOf(".");
}
if (pos > 0)
{
lineNoTrace = lineNoTrace.substring(0,pos);
}
iLineNoTrace = Integer.parseInt( lineNoTrace ) ;
sql = " select item_code from invoice_trace where invoice_id = ? and line_no = ?";
......@@ -2411,6 +2421,16 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
retOpt = genericUtility.getColumnValue("ret_opt", dom1);
if (invoiceId != null && invoiceId.trim().length() > 0 && lineNoTrace != null && lineNoTrace.trim().length() > 0 )
{
if( lineNoTrace != null )
{
pos = lineNoTrace.indexOf(".");
}
if (pos > 0)
{
lineNoTrace = lineNoTrace.substring(0,pos);
}
iLineNoTrace = Integer.parseInt(lineNoTrace);
sql = " select inv_line_no,site_code__mfg, mfg_date, exp_date, lot_no, "
......@@ -2424,7 +2444,21 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
rs = pstmt.executeQuery();
if( rs.next() )
{
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") ) ;
if( lineNoInvStr != null )
{
pos = lineNoInvStr.indexOf(".");
}
if (pos > 0)
{
lineNoInvStr = lineNoInvStr.substring(0,pos);
}
lineNoInv = Integer.parseInt(lineNoInvStr);
valueXmlString.append("<line_no__inv>").append("<![CDATA[" + lineNoInv + "]]>").append("</line_no__inv>");
System.out.println("lineNoInv before >>> " + lineNoInv);
setNodeValue( dom, "line_no__inv", lineNoInv );
......@@ -2597,6 +2631,16 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
+ " and line_no =? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId);
if( lineNoTrace != null )
{
pos = lineNoTrace.indexOf(".");
}
if (pos > 0)
{
lineNoTrace = lineNoTrace.substring(0,pos);
}
pstmt.setInt( 2, Integer.parseInt(lineNoTrace));
rs = pstmt.executeQuery();
if( rs.next() )
......@@ -2617,6 +2661,16 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
+ " and b.line_no__inv = ? ";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, invoiceId);
if( lineNoTrace != null )
{
pos = lineNoTrace.indexOf(".");
}
if (pos > 0)
{
lineNoTrace = lineNoTrace.substring(0,pos);
}
pstmt.setInt( 2, Integer.parseInt( lineNoTrace ) );
rs = pstmt.executeQuery();
if( rs.next() )
......@@ -2949,7 +3003,12 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
lotSl = genericUtility.getColumnValue("lot_sl", dom);
locCode = genericUtility.getColumnValue("loc_code", dom);
lineNoTrace = genericUtility.getColumnValue("line_no__invtrace", dom);
iLineNoTrace = Integer.parseInt( getNumString( lineNoTrace ) );
if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0)
{
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
}
iLineNoTrace = Integer.parseInt( lineNoTrace );
quantity = qtyStdUom;
infoMap = new HashMap();
......@@ -3597,7 +3656,13 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
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 (lineNoTrace != null && lineNoTrace.indexOf(".") > 0)
{
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
}
iLineNoTrace = Integer.parseInt( lineNoTrace );
if (invoiceId != null && invoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( invoiceId.trim() ) )
{
System.out.println( " retReplFlag :2: " + retReplFlag );
......@@ -4167,6 +4232,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
//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("."));
}
llLinenotrace = Integer.parseInt( llLinenotraceStr == null || llLinenotraceStr.trim().length() == 0 ? "0" : llLinenotraceStr.trim() );
if( llLinenotrace > 0 )
......@@ -5622,6 +5692,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if( childNodeName.equalsIgnoreCase( "line_no__invtrace" ) )
{
String mlineNoStr = getNumString( genericUtility.getColumnValue( "line_no__invtrace", dom ) );
if (mlineNoStr != null && mlineNoStr.indexOf(".") > 0)
{
mlineNoStr = mlineNoStr.substring(0,mlineNoStr.indexOf("."));
}
mlineNo = Integer.parseInt( mlineNoStr.trim() );
mVal1 = genericUtility.getColumnValue( "invoice_id", dom );
if ( mlineNo != 0 )
......@@ -5802,6 +5877,12 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
mlineNo =(int) Double.parseDouble(( getNumString( mlineNoStr ) ));
lsFlag = genericUtility.getColumnValue( "ret_rep_flag", dom );// dw_detedit[ii_currformno].GetItemString(dw_detedit[ii_currformno].GetRow(),"ret_rep_flag")
llLineNoInvtraceStr = genericUtility.getColumnValue( "line_no__invtrace", dom ); //dw_detedit[ii_currformno].getitemnumber(1,"line_no__invtrace") //Added by jasmina 13.03.2008 - FI78SUN041
if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0)
{
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
}
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() ) )
......@@ -5921,6 +6002,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{
// 26/10/10 manoharan to set average rate in case invoiced from multiple lot
llLineNoInvtraceStr = genericUtility.getColumnValue( "line_no__invtrace", dom );
if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0)
{
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
}
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"
+" from invoice_trace i "
......@@ -6522,11 +6608,26 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
ldCurrQty = Double.parseDouble( ldCurrQtyStr == null || ldCurrQtyStr.trim().length() == 0 ? "0" : ldCurrQtyStr.trim() );
lsTranId = genericUtility.getColumnValue( "tran_id", dom );//dw_detedit[ii_currformno].getitemstring(1,"tran_id")
String llLineNoStr = getNumString( genericUtility.getColumnValue( "line_no", dom ) );//dw_detedit[ii_currformno].getitemnumber(1,"line_no")
if (llLineNoStr != null && llLineNoStr.indexOf(".") > 0)
{
llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf("."));
}
llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr.trim() );
lsRetOpt = genericUtility.getColumnValue( "ret_opt", dom1 );
String llLineNoInvStr = getNumString(genericUtility.getColumnValue( "line_no__inv", dom ));//dw_detedit[ii_currformno].getitemnumber(1,"line_no__inv")
if (llLineNoInvStr != null && llLineNoInvStr.indexOf(".") > 0)
{
llLineNoInvStr = llLineNoInvStr.substring(0,llLineNoInvStr.indexOf("."));
}
llLineNoInv = Integer.parseInt( llLineNoInvStr == null || llLineNoInvStr.trim().length() == 0 ? "0" : llLineNoInvStr.trim() );
llLineNoInvtraceStr = getNumString(genericUtility.getColumnValue( "line_no__invtrace", dom ));// dw_detedit[ii_currformno].getitemnumber(1,"line_no__invtrace")
if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0)
{
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
}
llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr == null || llLineNoInvtraceStr.trim().length() == 0 ? "0" : llLineNoInvtraceStr.trim() );
System.out.println( " ldCurrQty :: " + ldCurrQty );
if( ldCurrQty == 0 )
......@@ -6737,6 +6838,10 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
{
lsInvoiceId = genericUtility.getColumnValue( "invoice_id", dom ); // dw_detedit[ii_currformno].getitemstring(dw_detedit[ii_currformno].GetRow(),"invoice_id")
String llLineNoStr = getNumString( genericUtility.getColumnValue( "line_no__inv", dom ) );//dw_detedit[ii_currformno].getitemnumber(dw_detedit[ii_currformno].GetRow(),"line_no__inv")
if (llLineNoStr != null && llLineNoStr.indexOf(".") > 0)
{
llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf("."));
}
llLineNo = Integer.parseInt( llLineNoStr == null || llLineNoStr.trim().length() == 0 ? "0" : llLineNoStr );
if( lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) )
{
......@@ -6894,8 +6999,17 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
String lcRateStr = genericUtility.getColumnValue( "rate", dom );
lcRate = Double.parseDouble( lcRateStr == null || lcRateStr.trim().length() == 0 ? "0" : lcRateStr.trim() );
String llLineNoInvStr = getNumString( genericUtility.getColumnValue( "line_no__inv", dom ) );
if (llLineNoInvStr != null && llLineNoInvStr.indexOf(".") > 0)
{
llLineNoInvStr = llLineNoInvStr.substring(0,llLineNoInvStr.indexOf("."));
}
llLineNoInv = Integer.parseInt( llLineNoInvStr.trim() );
llLineNoInvtraceStr = getNumString( genericUtility.getColumnValue( "line_no__invtrace", dom ) );
if (llLineNoInvtraceStr != null && llLineNoInvtraceStr.indexOf(".") > 0)
{
llLineNoInvtraceStr = llLineNoInvtraceStr.substring(0,llLineNoInvtraceStr.indexOf("."));
}
llLineNoInvtrace = Integer.parseInt( llLineNoInvtraceStr.trim() );
lsTranId = genericUtility.getColumnValue( "tran_id", dom );
if( lcQty < 0 )
......@@ -6921,6 +7035,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
mexpDate = Timestamp.valueOf(genericUtility.getValidDateString( mexpDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String llLineNoStr = getNumString( genericUtility.getColumnValue( "line_no", dom ) );//dw_detedit[ii_currformno].getitemnumber(1, "line_no")//Added by shahid 24/06/2009 for DI89SUN189
if (llLineNoStr != null && llLineNoStr.indexOf(".") > 0)
{
llLineNoStr = llLineNoStr.substring(0,llLineNoStr.indexOf("."));
}
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 "
+" from stock a, invstat b "
......@@ -7321,6 +7440,11 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
lcAmount = Double.parseDouble( lcAmountStr == null || lcAmountStr.trim().length() == 0 ? "0" : lcAmountStr.trim() );
String liLineNoStr = getNumString( genericUtility.getColumnValue("line_no", dom ) );
if (liLineNoStr != null && liLineNoStr.indexOf(".") > 0)
{
liLineNoStr = liLineNoStr.substring(0,liLineNoStr.indexOf("."));
}
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 "
+" from sreturn_inv "
......@@ -7592,6 +7716,10 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
sql = " select desp_id, desp_line_no "
+ " from invoice_trace where invoice_id = ? and line_no = ?";
lineNoTrace = lineNoTrace == null ? "0" : lineNoTrace.trim();
if (lineNoTrace != null && lineNoTrace.indexOf(".") > 0)
{
lineNoTrace = lineNoTrace.substring(0,lineNoTrace.indexOf("."));
}
iLineNoTrace = Integer.parseInt(lineNoTrace);
despId = "";
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