Commit 89739781 authored by cpatil's avatar cpatil

change the method name gbf_acct_analysis_type to AcctAnalysisType

and  hadle null pointer exceptio for tran type and item code and modify split paramerer  '  ' to  @


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93364 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f68b21e4
......@@ -461,14 +461,15 @@ public class InvAcct
}
// added by cpatil on 09-03-13 start
//ls_analysis = nvo_fin.gbf_acct_analysis_ttype(ls_item,ls_tran_ser,ls_tran_type,)
analysis = gbf_acct_analysis_type( itemCode, tranSer, tranType, "CR", conn);
//ls_analysis = nvo_fin.gbf_acct_analysis_ttype(ls_item,ls_tran_ser,ls_tran_type,)
analysis = AcctAnalysisType( itemCode, tranSer, tranType, "CR", conn);
//analysis = gbf_acct_analysis_type( itemCode, tranSer, tranType, "CR", conn);
//ls_analysis1_cr = f_get_token(ls_analysis,'~t')
//ls_analysis2_cr = f_get_token(ls_analysis,'~t')
//ls_analysis3_cr = f_get_token(ls_analysis,'~t')
System.out.println("@@@@CR return analysis["+analysis+"]");
//analysisStr = analysis.split("@@@@@@1 analysis::["+analysis+"]");
analysisStr = analysis.split(" ");
analysisStr = analysis.split("@");
int len = analysisStr.length-1;
System.out.println("@@@cr len["+len+"]");
if( len > -1 )
......@@ -497,15 +498,16 @@ public class InvAcct
}
System.out.println("@@@@@CR analysis1__cr["+analysis1__cr+"]:::analysis2__cr["+analysis2__cr+"]::::analysis3__cr["+analysis3__cr+"]");
//ls_analysis = nvo_fin.gbf_acct_analysis_ttype(ls_item,ls_tran_ser,ls_tran_type,'DR')
analysis = gbf_acct_analysis_type( itemCode, tranSer, tranType, "DR", conn);
//ls_analysis = nvo_fin.gbf_acct_analysis_ttype(ls_item,ls_tran_ser,ls_tran_type,'DR')
//analysis = gbf_acct_analysis_type( itemCode, tranSer, tranType, "DR", conn);
analysis = AcctAnalysisType( itemCode, tranSer, tranType, "DR", conn);
//ls_analysis1_dr = f_get_token(ls_analysis,'~t')
//ls_analysis2_dr = f_get_token(ls_analysis,'~t')
//ls_analysis3_dr = f_get_token(ls_analysis,'~t')
System.out.println("@@@@DR return analysis["+analysis+"]");
//analysisStr = analysis.split("@@@@@@2 analysis::["+analysis+"]");
analysisStr = analysis.split(" ");
analysisStr = analysis.split("@");
len = analysisStr.length-1;
System.out.println("@@@Dr len["+len+"]");
if( len > -1)
......@@ -1344,8 +1346,9 @@ public class InvAcct
return (errString);
}
////added by cpatil..... migrate pb code into java on 09-03-13 start
public String gbf_acct_analysis_type( String itemCode, String refSer, String tranType,String drcr,Connection conn) throws RemoteException, ITMException, SQLException
////added by cpatil..... migrate pb code into java on 09-03-13 start
//public String gbf_acct_analysis_type( String itemCode, String refSer, String tranType,String drcr,Connection conn) throws RemoteException, ITMException, SQLException
public String AcctAnalysisType( String itemCode, String refSer, String tranType,String drcr,Connection conn) throws RemoteException, ITMException, SQLException //// change the method name gbf_acct_analysis_type to AcctAnalysisType on 22/07/13 as per manoharan sir suggestion
{
String analysis1__dr="",analysis2__dr="",analysis3__dr="",analysis1__cr="",analysis2__cr="",analysis3__cr="" , analysis="";
......@@ -1355,13 +1358,25 @@ public class InvAcct
//String itemCode="", refSer="", tranType="";
int rCnt=0;
if ( itemCode != null && itemCode.trim().length() > 0)
{
itemCode=itemCode.trim();
}
if ( refSer != null && refSer.trim().length() > 0)
{
refSer=refSer.trim();
}
if ( tranType != null && tranType.trim().length() > 0)
{
tranType=tranType.trim();
}
sql = " select analysis1__dr,analysis2__dr,analysis3__dr,analysis1__cr,analysis2__cr,analysis3__cr " +
" from item_acct_analysis where item_code = ? and tran_ser = ? and tran_type = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode.trim());
pstmt.setString(2,refSer.trim());
pstmt.setString(3,tranType.trim());
pstmt.setString(1,itemCode );
pstmt.setString(2,refSer );
pstmt.setString(3,tranType );
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -1387,10 +1402,10 @@ public class InvAcct
if( rCnt == 0)
{
sql = " select analysis1__dr,analysis2__dr,analysis3__dr,analysis1__cr,analysis2__cr,analysis3__cr " +
" from item_acct_analysis where tran_ser = ? and item_code = ? AND tran_type is null ";
" from item_acct_analysis where tran_ser = ? and item_code = ? AND ( tran_type is null or tran_type = ' ' ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refSer.trim());
pstmt.setString(2,itemCode.trim());
pstmt.setString(1,refSer );
pstmt.setString(2,itemCode );
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -1417,9 +1432,10 @@ public class InvAcct
if( rCnt == 0 )
{
sql = " select analysis1__dr,analysis2__dr,analysis3__dr,analysis1__cr,analysis2__cr,analysis3__cr " +
" from item_acct_analysis where tran_ser = ? and item_code is null AND tran_type is null ";
" from item_acct_analysis where tran_ser = ? and ( item_code is null or item_code = ' ' ) " +
" AND ( tran_type is null or tran_type = ' ' )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refSer.trim());
pstmt.setString(1,refSer );
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -1455,11 +1471,11 @@ public class InvAcct
if ("CR".equalsIgnoreCase(drcr))
{
analysis = analysis1__cr+" "+analysis2__cr+" "+analysis3__cr;
analysis = analysis1__cr+"@"+analysis2__cr+"@"+analysis3__cr;
}
else
{
analysis = analysis1__dr+" "+analysis2__dr+" "+analysis3__dr;
analysis = analysis1__dr+"@"+analysis2__dr+"@"+analysis3__dr;
}
System.out.println("@@@@ analysis::::["+analysis+"]");
......
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