Commit 05dc61ce authored by kdabholkar's avatar kdabholkar

commited to add condition for taxRegNo. in gst_data_hdr insert query


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106374 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 134cfc19
......@@ -44,7 +44,7 @@ public class GSTRWebServiceDao extends ValidatorEJB {
PreparedStatement pstmt2 = null;
ResultSet rs = null;
int cnt=0;
int cnt=0;
System.out.println("input Values"+input);
......@@ -128,6 +128,7 @@ public class GSTRWebServiceDao extends ValidatorEJB {
gstType=obj.getString("gsttype");
refId=obj.getString("refid");
System.out.println("values is "+tranID);
System.out.println("tranDate is "+tranDate);
System.out.println("tranIdRef is "+tranIdRef);
......@@ -178,28 +179,39 @@ public class GSTRWebServiceDao extends ValidatorEJB {
}
System.out.println("COUNT"+cnt);
if(cnt==1)
if(cnt==0 && (taxRegNo != "") && taxRegNo.trim().length() != 0)
{
checkTaxNo="SELECT S.GST_NO,S.STATE_CODE,S.NAME,G.GST_CODE FROM gst_registration S JOIN STATE G ON G.STATE_CODE=s.state_code WHERE S.gst_no=?";
pstmt2 = conn.prepareStatement(checkTaxNo);
pstmt2.setString(1, taxRegNo);
//checkTaxNo="SELECT S.GST_NO,S.STATE_CODE,S.NAME,G.GST_CODE FROM gst_registration S JOIN STATE G ON G.STATE_CODE=s.state_code WHERE S.gst_no=?";
checkTaxNo="SELECT state_code FROM STATE WHERE GST_CODE=?";
pstmt2 = conn.prepareStatement(checkTaxNo);
pstmt2.setString(1, gstCode);
rs = pstmt2.executeQuery();
if ( rs.next() )
{
newgstno = rs.getString(1);
newstatecode=rs.getString(2);
newname=rs.getString(3);
newgstcode=rs.getString(4);
newgstcode = rs.getString(1);
//newstatecode=rs.getString(2);
//newname=rs.getString(3);
//newgstcode=rs.getString(4);
}
System.out.println("newgstno"+newgstno);
System.out.println("newgstno"+newgstcode);
System.out.println("newstatecode"+newstatecode);
System.out.println("newname"+newname);
System.out.println("newgstcode"+newgstcode);
System.out.println("inside cnt");
taxRegNo="";
custName=newname;
//custName=newname;
gstCode=newgstcode;
checkTaxNo="Insert into gst_registration (GST_NO,NAME,STATE_CODE) values (?,?,?)";
pstmt2 = conn.prepareStatement(checkTaxNo);
pstmt2.setString(1,taxRegNo);
pstmt2.setString(2,custName);
pstmt2.setString(3,newgstcode);
pstmt2.executeQuery();
}
System.out.println("taxRegNo after checking"+taxRegNo);
......@@ -350,7 +362,8 @@ public class GSTRWebServiceDao extends ValidatorEJB {
}
retString ="successfull";
retString ="successfull";
}
catch(Exception e)
......
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