Commit 37492c36 authored by ssalve's avatar ssalve

Sarita : Done changes in AssetSalesConf class

1. To get sales transaction date & other values
2. To fetch sales accounting period  3. To consider accounting period of sales
on 30 JUN 18

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187149 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 99abd775
......@@ -110,14 +110,22 @@ AssetSalesConfLocal,AssetSalesConfRemote
ResultSet rs1 = null,rs2 = null, rs3 = null, rs4 = null, rs5 = null, rs6 = null, rs9 = null, rs10 = null, rs11 = null, rs12 = null;
//Added by sarita on 26 JUN 18 [END]
//Modified by Piyush on 30/06/2018 [To get sales transaction date & other values].Start
java.sql.Timestamp salesTranDate = null;
String salesAcPeriod = "", sqlTemp1 = "";
int detRowNo = 0;
ResultSet rsTemp1 = null;
PreparedStatement pstmtTemp1 = null;
//Modified by Piyush on 30/06/2018 [To get sales transaction date & other values].Start
try
{
ConnDriver connDriver = null;
connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
loginEmpCode= genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
loginEmpCode=loginEmpCode==null ? "" :loginEmpCode.trim();
System.out.println("loginEmpCode---->>["+loginEmpCode+"]");
......@@ -142,6 +150,7 @@ conn = getConnection();
confirmed = rs.getString(1) == null ? "":rs.getString(1);
currDate = rs.getTimestamp(2);
salesTranDate = rs.getTimestamp(2);// Added on 30JUN18 by Pyush Sir
saleAmt = rs.getDouble(3);
tranType = rs.getString(4) == null ? "":rs.getString(4);
currCode = rs.getString(5) == null ? "":rs.getString(5);
......@@ -165,6 +174,33 @@ conn = getConnection();
System.out.println("Current Date is :::["+currentDate+"]"); //Current Date is :::[2018-06-06 00:00:00.0]
//Added by sarita to get Current Date in dbformat [END]
// Modified by Piyush on 30/06/2018 [To fetch sales accounting period].Start
salesTranDate = rs.getTimestamp(2);
detRowNo = detRowNo + 1;
if (detRowNo == 1)
{
sqlTemp1 = "select acct_prd from period where ? between fr_date and to_date";
pstmtTemp1 = conn.prepareStatement(sqlTemp1);
pstmtTemp1.setTimestamp(1,salesTranDate);
rsTemp1 = pstmtTemp1.executeQuery();
if (rsTemp1.next())
{
salesAcPeriod = rsTemp1.getString("acct_prd");
}
if (rsTemp1 != null)
{
rsTemp1.close();
rsTemp1 = null;
}
if (pstmtTemp1 != null)
{
pstmtTemp1.close();
pstmtTemp1 = null;
}
}
// Modified by Piyush on 30/06/2018 [To fetch sales accounting period].Start
// Commented and added if statement to give naming to rs and pstmt and close them after while statement by sarita on 26 JUN 18 [START]
/*if(confirmed == "" || confirmed.equalsIgnoreCase("N"))
{
......@@ -683,13 +719,20 @@ conn = getConnection();
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
procDate2d = sdf.format(procDate2ts); // procDate2d : [01/06/12]
// Modified by Piyush on 30/06/2018 [To consider accounting period of sales]
/*
sql2 = "select prd_code__upto from asset_depr"
+ " where asset_code = ? and item_ser = ? and grp_code= ? and site_code = ?";
*/
sql2 = "select prd_code__upto from asset_depr"
+ " where asset_code = ? and item_ser = ? and grp_code= ? and site_code = ? and acct_prd = ?";
pstmt2=conn.prepareStatement(sql2);
pstmt2.setString(1,assetCode);
pstmt2.setString(2,itmSer);
pstmt2.setString(3,grpCode);
pstmt2.setString(4,siteCode);
pstmt2.setString(5,salesAcPeriod); // Modified by Piyush on 30/06/2018 [To consider accounting period of sales]
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
......@@ -1388,6 +1431,18 @@ conn = getConnection();
pstmt13 = null;
}
//Added by sarita to close resultset and preparestatement on 26 JUN 18 [START]
// Modified by Piyush on 30/06/2018 [Closing additional resultsets and statements].Start
if (rsTemp1 != null)
{
rsTemp1.close();
rsTemp1 = null;
}
if (pstmtTemp1 != null)
{
pstmtTemp1.close();
pstmtTemp1 = null;
}
// Modified by Piyush on 30/06/2018 [Closing additional resultsets and statements].End
if (conn != null)
{
conn.close();
......@@ -2301,16 +2356,16 @@ conn = getConnection();
//System.out.println("serviceCode = "+serviceCode+" compName "+compName);
System.out.println("serviceCode = "+serviceCode+" compName "+compName + "compType "+compType);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
}
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
//Commented and Added by sarita to add comp_type in query on 19 JUN 18 [END]
......@@ -2328,16 +2383,16 @@ conn = getConnection();
//System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
System.out.println("serviceURI = "+serviceURI+" compName = "+compName+" methodName ="+methodName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
//Commented and Added by sarita to add method_name in query on 19 JUN 18 [END]
......@@ -2388,16 +2443,24 @@ conn = getConnection();
System.out.println(" Values in aobj[i] : ["+aobj[i]+"] \t For Argument is ["+argName1+"] \t value of i is ["+i+"] ");
i++;
}//end of while loop
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
// Modified by Piyush on 30/06/2018 [Web service should be called in case of WSR hence shifted above].Start
System.out.println("@@@@@@ call.setReturnType(XMLType.XSD_STRING) executed........");
call.setReturnType(XMLType.XSD_STRING);
retString = (String)call.invoke(aobj);
System.out.println("Returned from Depreciation process WSR called from Confirmation of Asset Sales :==>["+retString+"]");
// Modified by Piyush on 30/06/2018 [Web service should be called in case of WSR hence shifted above].End
}//end of if for comp_type [WSR]
/*call.addParameter( new javax.xml.namespace.QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
......@@ -2411,13 +2474,16 @@ conn = getConnection();
aobj[3] = new String(forcedFlag);*/
//System.out.println("@@@@@@@@@@loginEmpCode:" +genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode")+":");
// Modified by Piyush on 30/06/2018 [Web service should be called in case of WSR hence shifted above].Start
/*
System.out.println("@@@@@@ call.setReturnType(XMLType.XSD_STRING) executed........");
call.setReturnType(XMLType.XSD_STRING);
retString = (String)call.invoke(aobj);
System.out.println("Confirm Complete @@@@@@@@@@@ Return string from NVO is:==>["+retString+"]");
*/
// Modified by Piyush on 30/06/2018 [Web service should be called in case of WSR hence shifted above].End
// System.out.println("Confirm Complete @@@@@@@@@@@ Return string from NVO is:==>["+retString+"]");
System.out.println("@@@@@@ call.setReturnType(XMLType.XSD_STRING) executed........");
}
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