Commit a6600203 authored by msingh's avatar msingh

Changed by Manish on 01/04/16 for maximum cursor issue for DDUK .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101073 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3db5e586
......@@ -65,14 +65,14 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{
retString = actionConfirm(xmlString, xtraParams);
}
catch(Exception e)
catch(Exception e)
{
System.out.println("Exception :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning from actionHandler"+retString);
return (retString);
return (retString);
}
private String actionConfirm(String tranID, String xtraParams) throws RemoteException,ITMException, Exception
{
......@@ -83,7 +83,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
ConnDriver connDriver = new ConnDriver();
String sql = "";
String siteCode = "";
String siteCode = "";
String custCode = "";
String empCode = "";
String confirmed = "";
......@@ -97,7 +97,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
boolean conFlag = false;
String errStr = "";
Timestamp sysDate = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
......@@ -112,13 +112,13 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{
sql = " select tran_id, tran_date, site_code, cust_code, confirmed "
+ " from charge_back where tran_id = ? for update ";
}
else if("mssql".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = " select tran_id, tran_date, site_code, cust_code, confirmed "
+ " from charge_back (updlock) where tran_id = ? ";
}
else
{
......@@ -177,20 +177,20 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDateStr = sdf.format(currentDate.getTime());
System.out.println(">>>>>>>Now sysDateStr :=> " + sysDateStr);
sysDate= Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println(">>>>>>>>sysDate:"+sysDate);
String sysDateStr = sdf.format(currentDate.getTime());
System.out.println(">>>>>>>Now sysDateStr :=> " + sysDateStr);
sysDate= Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println(">>>>>>>>sysDate:"+sysDate);
sql = "update charge_back set "
+" confirmed = 'Y', "
+" VERIFY_FLAG = 'Y', "
+" conf_date = ?, "
+" emp_code__aprv = ?,"
+ "STATUS='A',"//VALLABH KADAM STATUS='A' as APPROVE
+ " STATUS_DATE=?" //VALLABH KADAM STATUS_DATE
+" where tran_id = ? ";
// +" and confirmed <> 'Y' ";
+" confirmed = 'Y', "
+" VERIFY_FLAG = 'Y', "
+" conf_date = ?, "
+" emp_code__aprv = ?,"
+ "STATUS='A',"//VALLABH KADAM STATUS='A' as APPROVE
+ " STATUS_DATE=?" //VALLABH KADAM STATUS_DATE
+" where tran_id = ? ";
// +" and confirmed <> 'Y' ";
System.out.println( "upd sql " + sql );
pstmt = conn.prepareStatement( sql );
pstmt.setTimestamp( 1, currDate );
......@@ -238,8 +238,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
}
catch(Exception e1)
{
System.out.println("ChrgBckLocConfEJB..."+e1.getMessage());
e1.printStackTrace();
System.out.println("ChrgBckLocConfEJB..."+e1.getMessage());
e1.printStackTrace();
}
}
finally
......@@ -323,53 +323,53 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
java.sql.Timestamp tranDate = null;
java.sql.Timestamp pOrderDate = null;
String insHdrSql = "insert into MISC_DRCR_RCP ( "
+" TRAN_ID, TRAN_SER, TRAN_DATE, EFF_DATE, FIN_ENTITY, "
+" SITE_CODE, SUNDRY_TYPE, SUNDRY_CODE, ACCT_CODE, CCTR_CODE, "
+" AMOUNT, CURR_CODE, EXCH_RATE, REMARKS, DRCR_FLAG, "
+" TRAN_ID__RCV, CONFIRMED, CHG_USER, CHG_DATE, CHG_TERM, "
+" CONF_DATE, EMP_CODE__APRV, DUE_DATE, TRAN_TYPE, ITEM_SER, "
+" AMOUNT__BC, SRETURN_NO, ADJ_MISC_CRN, ADJ_AMOUNT, PARENT__TRAN_ID, "
+" REV__TRAN, ROUND_ADJ, "
+" CUST_REF_NO, CUST_REF_DATE, CUST_REF_AMT, RND_OFF, RND_TO ) "
+" values ( "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ? ) ";
+" TRAN_ID, TRAN_SER, TRAN_DATE, EFF_DATE, FIN_ENTITY, "
+" SITE_CODE, SUNDRY_TYPE, SUNDRY_CODE, ACCT_CODE, CCTR_CODE, "
+" AMOUNT, CURR_CODE, EXCH_RATE, REMARKS, DRCR_FLAG, "
+" TRAN_ID__RCV, CONFIRMED, CHG_USER, CHG_DATE, CHG_TERM, "
+" CONF_DATE, EMP_CODE__APRV, DUE_DATE, TRAN_TYPE, ITEM_SER, "
+" AMOUNT__BC, SRETURN_NO, ADJ_MISC_CRN, ADJ_AMOUNT, PARENT__TRAN_ID, "
+" REV__TRAN, ROUND_ADJ, "
+" CUST_REF_NO, CUST_REF_DATE, CUST_REF_AMT, RND_OFF, RND_TO ) "
+" values ( "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, "
+" ?, ? ) ";
String insertDtl = "insert into MISC_DRCR_RDET( "
+" TRAN_ID, LINE_NO, ACCT_CODE, CCTR_CODE, AMOUNT, "
+" NET_AMT, REF_NO, REAS_CODE, ANAL_CODE"
+" ) values ( "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ? )";
+" TRAN_ID, LINE_NO, ACCT_CODE, CCTR_CODE, AMOUNT, "
+" NET_AMT, REF_NO, REAS_CODE, ANAL_CODE"
+" ) values ( "
+" ?, ?, ?, ?, ?, "
+" ?, ?, ?, ? )";
DistCommon disComm = new DistCommon();
try
{
pstmtHdr = conn.prepareStatement( insHdrSql );
pstmtDtl = conn.prepareStatement( insertDtl );
sql = "select a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks, sum(b.discount_amt) as discAmt "
+" from charge_back a, charge_back_det b "
+" where a.tran_id = b.tran_id "
+" and a.tran_id >= ? "
+" and a.tran_id <= ? "
+" and a.tran_date >= ? "
+" and a.tran_date <= ? "
+" and a.cust_code >= ? "
+" and a.cust_code <= ? "
+" and a.site_code = ? "
// +" and a.confirmed = 'Y' "
+" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks";
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks, sum(b.discount_amt) as discAmt "
+" from charge_back a, charge_back_det b "
+" where a.tran_id = b.tran_id "
+" and a.tran_id >= ? "
+" and a.tran_id <= ? "
+" and a.tran_date >= ? "
+" and a.tran_date <= ? "
+" and a.cust_code >= ? "
+" and a.cust_code <= ? "
+" and a.site_code = ? "
// +" and a.confirmed = 'Y' "
+" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, tranIdFr );
......@@ -397,7 +397,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
grossAmount = rs.getDouble("amount");
remarks = rs.getString("remarks");
discountAmt = rs.getDouble("discAmt");
//System.out.println("claimAmt==>["+claimAmt+"]");
//System.out.println("netAmt==>["+netAmt+"]");
//System.out.println("grossAmount ie amount==>["+grossAmount+"]");
......@@ -481,7 +481,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{
drcrAmt = claimAmt < netAmt ? claimAmt : netAmt;
}
//crNtTranId = generateTranId("W_MISC_DRCR_RCP_CR", getCurrdateInAppFormat(), loginSite, userId, tranType );
crNtTranId = generateTranId("W_MISC_DRCR_RCP_CR", getCurrdateInAppFormat(), siteCodeCr, userId, tranType );
//-----------------------Inserting into header-----------------------------------
......@@ -511,7 +511,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
roundAmt = disComm.getRndamt( drcrAmt, round, roundTo );
diffAmt = roundAmt - drcrAmt;
//pstmtHdr.setDouble( 11, drcrAmt );
pstmtHdr.setDouble( 11, roundAmt );
pstmtHdr.setString( 12, currCode == null || currCode.trim().length() == 0 ? "" : currCode);
......@@ -703,7 +703,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
rs = null;
pstmt.close();
pstmt = null;
if( "Y".equalsIgnoreCase( asPost ) )
{
conn.commit();
......@@ -756,7 +756,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
PreparedStatement pStmt = null;
ResultSet rs = null;
int cnt = 0;
try
{
ConnDriver connDriver = new ConnDriver();
......@@ -764,7 +764,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
conn.setAutoCommit(false);
methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName;
sql = "SELECT SERVICE_CODE,COMP_NAME FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND EVENT_CODE = 'pre_confirm' ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,businessObj);
......@@ -774,6 +774,18 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
serviceCode = rs.getString("SERVICE_CODE");
compName = rs.getString("COMP_NAME");
}
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,serviceCode);
......@@ -782,6 +794,18 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{
serviceURI = rs.getString("SERVICE_URI");
}
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -789,17 +813,17 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
call.addParameter( new javax.xml.namespace.QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter( new javax.xml.namespace.QName("http://NvoServiceurl.org", "tran_id"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter( new javax.xml.namespace.QName("http://NvoServiceurl.org", "xtra_params"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter( new javax.xml.namespace.QName("http://NvoServiceurl.org", "forced_flag"), XMLType.XSD_STRING, ParameterMode.IN);
aobj[0] = new String(compName);
aobj[1] = new String(tranIdFr);
aobj[2] = new String(xtraParams);
aobj[3] = new String(forcedFlag);
call.setReturnType(XMLType.XSD_STRING);
retString = (String)call.invoke(aobj);
System.out.println("Return string from NVO is:==>["+retString+"]");
......@@ -818,6 +842,11 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
if( conn != null ){
conn.close();
conn = null;
......@@ -837,12 +866,12 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
currDate =new java.sql.Timestamp(System.currentTimeMillis()) ;
System.out.println( genericUtility.getDBDateFormat());
DBDate= new SimpleDateFormat(genericUtility.getDBDateFormat());
date = DBDate.parse(currDate.toString());
currDate = java.sql.Timestamp.valueOf(DBDate.format(date).toString() + " 00:00:00.0");
currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate).toString();
currDate =new java.sql.Timestamp(System.currentTimeMillis()) ;
System.out.println( genericUtility.getDBDateFormat());
DBDate= new SimpleDateFormat(genericUtility.getDBDateFormat());
date = DBDate.parse(currDate.toString());
currDate = java.sql.Timestamp.valueOf(DBDate.format(date).toString() + " 00:00:00.0");
currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate).toString();
}
catch(Exception e)
{
......@@ -862,14 +891,14 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
String refSer = "";
String keyString = "";
String tranIdCol = "";
try
{
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" );
conn.setAutoCommit(false);
generateTranIdSql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE UPPER(TRAN_WINDOW)= ?";
System.out.println("[ChargeBackLocConfEJB :: generateTranId : input Paramaters][windowName]["+windowName+"][tranDate]["+tranDate+"][siteCode]["+siteCode+"]");
System.out.println( "[ChargeBackLocConfEJB : generateTranId : Tran generator Sql[" + generateTranIdSql+"]" );
System.out.println( "[ChargeBackLocConfEJB : generateTranId : Tran generator Sql[" + generateTranIdSql+"]" );
pstmt = conn.prepareStatement( generateTranIdSql );
pstmt.setString(1, windowName);
rs = pstmt.executeQuery();
......@@ -885,7 +914,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
rs.close();
rs = null;
System.out.println("[Output of Tran generator Sql ][keyString]["+keyString+"][tranIdCol]["+tranIdCol+"][refSer]["+refSer+"]");
xmlValuesBuff.append("<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>");
xmlValuesBuff.append("<Header></Header>");
xmlValuesBuff.append("<Detail1>");
......@@ -943,19 +972,19 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
private String getErrCodeFromErrStr( String errStr ) throws RemoteException,ITMException
{
String retErrCode = null;
try
{
{
Document ParseRetString = genericUtility.parseString( errStr );
NodeList RetStringNodeList = ParseRetString.getElementsByTagName("error");
Node RetStringNode = RetStringNodeList.item(0);
retErrCode = RetStringNode.getAttributes().getNamedItem("id").getNodeValue();
}
catch(Exception exception)
{
exception.printStackTrace();
{
exception.printStackTrace();
throw new ITMException( exception );
}
}
return retErrCode;
}
}
......@@ -258,6 +258,18 @@ String runMode="";
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -266,6 +278,18 @@ String runMode="";
{
serviceURI = rs.getString("SERVICE_URI");
}
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
Service service = new Service();
Call call = (Call)service.createCall();
......@@ -309,6 +333,11 @@ String runMode="";
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -30,7 +30,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
Document detailDom = null;
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
if(xmlString != null && xmlString.trim().length()!=0)
......@@ -89,7 +89,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
//System.out.println("Now the date is :=> ["+newsysDate+"]");
tranId = genericUtility.getColumnValue("tran_id",headerDom);
System.out.println("tranId["+tranId);
if( tranId != null && tranId.trim().length() > 0 )
......@@ -138,7 +138,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
retString =itmDBAccessEJB.getErrorString("","VTTRANIDNL","","",conn);
return retString;
}
sql = " select invoice_id ,tran_date from sreturn where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
......@@ -169,7 +169,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt.close();
rs = null;
pstmt = null;
sql = " select tran_id__porcp,purc_order from sorder where sale_order = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
......@@ -209,14 +209,14 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
return retString;
}
}
}
else
{
retString =itmDBAccessEJB.getErrorString("","VTINVIDBK","","",conn);
return retString;
}
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
......@@ -267,9 +267,9 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no><![CDATA["+lineNo+"]]></line_no>");
xmlBuff.append("<purc_order><![CDATA["+purchOrder+"]]></purc_order>");
sql = " select porcpdet.line_no__ord from porcp,porcpdet where porcp.tran_id = porcpdet.tran_id "
+" and porcp.tran_id = ? and porcp.tran_ser = 'P-RCP' and porcpdet.purc_order = ? and porcpdet.item_code = ? " ;
+" and porcp.tran_id = ? and porcp.tran_ser = 'P-RCP' and porcpdet.purc_order = ? and porcpdet.item_code = ? " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,porderRef);
pstmt1.setString(2,purchOrder);
......@@ -283,7 +283,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt1.close();
rs1 = null;
pstmt1 = null;
xmlBuff.append("<line_no__ord><![CDATA["+lineNoOrd+"]]></line_no__ord>");
xmlBuff.append("<item_code><![CDATA["+itemCode+"]]></item_code>");
xmlBuff.append("<quantity><![CDATA["+quantity+"]]></quantity>");
......@@ -429,6 +429,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -438,6 +450,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -479,6 +503,11 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -2261,6 +2261,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -2270,6 +2282,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -2309,6 +2333,11 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -5,18 +5,15 @@ import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.fin.MiscDrCrRcpConf;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
......@@ -143,10 +140,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
rs = pstmt.executeQuery();
if (rs.next()) {
invoiceId = rs.getString(1);
custCode = rs.getString(2) == null ? "" : rs.getString(2);
siteCode = rs.getString(3) == null ? "" : rs.getString(3);
currCode = rs.getString(4) == null ? "" : rs.getString(4);
ExchRate = rs.getDouble(5);
custCode = rs.getString(2) == null ? "" : rs.getString(2);
siteCode = rs.getString(3) == null ? "" : rs.getString(3);
currCode = rs.getString(4) == null ? "" : rs.getString(4);
ExchRate = rs.getDouble(5);
}
if (rs != null) {
rs.close();
......@@ -196,13 +193,6 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
mapDebitNoteAmt.put(lineNo, detail3Amt);
// detail2xmlString=getDetailsXmlString(conn, xtraParams,
// invoiceId, aprvRate, debitNoteAmtDetail);
// make rounding off logic detail3Amt
System.out.println("detail3Amt Before rounding["+detail3Amt+"]");
detail3Amt = getRequiredDecimal(detail3Amt, custCode,conn);
System.out.println("detail3Amt After rounding["+detail3Amt+"]");
detail2xmlString = detail2xmlString
+ getDetailsXmlString(conn, invoiceId, lineNotrace,
lineNo, aprvRate, PODqty, lotNo, lotSl,
......@@ -211,14 +201,13 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} // end while
System.out.println("detail2xmlString---->>[["
+ detail2xmlString + "]]");
System.out.println("Final detail3AmtT in debit note---Before rounding------->> : ["+ detail3AmtT+"]");
System.out
.println("Final detail3AmtT in debit note---------->> : "
+ detail3AmtT);
// Debit note amount cannot less than hundred.
// [31-JUL-2015] Sanket Girme
if (detail3AmtT >= 100) {
// make roundings off logic detail3AmtT
detail3AmtT = getRequiredDecimal(detail3AmtT, custCode,conn);
System.out.println("Final detail3AmtT in debit note---After rounding------->> : ["+ detail3AmtT+"]");
errString = genDebitNote("POD", invoiceId, custCode,
siteCode, xtraParams, currCode, ExchRate,
detail2xmlString, detail3AmtT, conn);
......@@ -237,20 +226,24 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if ((errString != null)
&& errString.indexOf("CONFSUCCES") > -1) {
updCnt = updatePodHeader(conn, tranId, loginCode);
System.out.println("return count from updateDebitNoteAmounts--->["
System.out
.println("return count from updateDebitNoteAmounts--->["
+ updCnt + "]");
if (updCnt > 0) {
conn.commit();
errString = itmdbAccess.getErrorString("",
"VTCONSUCF", "", "", conn);
System.out.println("-----@@@Debit Note Generated successfully for amount : "
System.out
.println("------@@@Debit Note Generated successfully for amount : "
+ actualDBamount);
System.out.println("Confirmation of Debit note done successfully----------");
System.out
.println("Confirmation of Debit note done successfully----------");
} else {
errString = itmdbAccess.getErrorString("",
"VTNCONFT", "", "", conn);
conn.rollback();
System.out.println("transaction not confirmed----------");
System.out
.println("transaction not confirmed----------");
}
} else {
errString = itmdbAccess.getErrorString("",
......@@ -267,7 +260,8 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} else {
errString = itmdbAccess.getErrorString("", "VTCOSUCFT", "",
"", conn);
System.out.println("Debit note generated zero for invoice ID-->>["
System.out
.println("Debit note generated zero for invoice ID-->>["
+ invoiceId + "]");
debitNoteTranID = "";
updCnt = updatePodHeader(conn, tranId, loginCode);
......@@ -877,6 +871,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = [" + serviceCode
+ "] compName [" + compName + "]");
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -887,6 +893,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = [" + serviceURI
+ "]---> compName = [" + compName + "]");
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -987,6 +1005,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
}
System.out.println("serviceCode = " + serviceCode + " compName "
+ compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -994,7 +1024,20 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = " + serviceURI + " compName = " + compName);
System.out.println("serviceURI = " + serviceURI + " compName = "
+ compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -1052,71 +1095,11 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
System.out.println("Unable to rollback");
s.printStackTrace();
}
throw new ITMException(e);
}
}
return retString;
}
@SuppressWarnings("finally")
public double getRequiredDecimal(double actVal, String custCode,Connection conn) throws SQLException
{
ResultSet rs = null;
PreparedStatement pstmt = null;
String sql = "",round="";
double roundTo= 0d,reqVal=0d;
java.sql.Timestamp invDate = null;
DistCommon dist = new DistCommon();
try {
sql = " select round,round_to from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
round = rs.getString("round")==null?"":rs.getString("round").trim();
roundTo = rs.getDouble("round_to");
}
reqVal = dist.getRndamt(actVal, round, roundTo);
// if("R".equals(round)) //Near
// {
//
// }
// else if("X".equals(round)) //Next
// {
// BigDecimal noZero = new BigDecimal(actVal);
// noZero.scale();
// noZero.precision();
// }
// else if("P".equals(round)) //Previous
// {
//
// }
// else if("N".equals(round)) //No Round
// {
// reqVal = actVal;
// }
} catch (Exception e) {
System.out.println("Exception in getRequiredDecimal off Round-------");
e.printStackTrace();
}
// NumberFormat numberFormat = NumberFormat.getIntegerInstance();
// Double DoubleValue = new Double(actVal);
// numberFormat.setMaximumFractionDigits(prec);
// String strValue = numberFormat.format(DoubleValue);
// strValue = strValue.replaceAll(",", "");
// double reqVal = Double.parseDouble(strValue);
finally
{
rs.close();
rs=null;
pstmt.close();
pstmt=null;
return reqVal;
}
}
}
......@@ -481,6 +481,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
issCriteria = rset.getString(1);
System.out.println("issCriteria :"+issCriteria);
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
NodeList detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for(int ctr = 0; ctr < noOfDetails; ctr++)
......@@ -562,6 +569,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
valueXmlString.append("<acct_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(acctCodeInv).append("]]>").append("</acct_code__inv>\r\n");
valueXmlString.append("<cctr_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(cctrCodeInv).append("]]>").append("</cctr_code__inv>\r\n");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
if (Double.parseDouble(stockQty) <= quantity1)
{
valueXmlString.append("<quantity isSrvCallOnChg='0'>").append("<![CDATA[").append(stockQty).append("]]>").append("</quantity>\r\n");
......
......@@ -32,35 +32,22 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
public String submit(String tranId, String xtraParams, String forcedFlag)throws RemoteException, ITMException
{
System.out.println(">>>>>>>>>>>>>>>>>>CustStockGWTConf submit called>>>>>>>>>>>>>>>>>>>");
String sql = "",status="",confirmed="",sql1="",sql2="";
String sql = "",status="",confirmed="";
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
PreparedStatement pstmt2 = null;
String errString = null;
ResultSet rs = null;
ResultSet rs1 = null;
ResultSet rs2 = null;
String methodName = "";
String compName = "";
String retString = "";
String serviceCode = "";
String serviceURI = "";
String actionURI = "";
String missingInserted="",transitUpdate="",loginEmpCode="";
String transitFlag="",siteCode="",custCode="",totclValue="",totSalesValue="",tranType="",stockMode="";
String lineNo="",invoiceId="",itemCode="";
double transitQty=0.0,invoiceQty=0.0,clStock=0.0;
int cnt = 0,cnfCnt=0;
Timestamp currDate = null,tranDate=null;
int cnt = 0;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
E12GenericUtility genericUtility= new E12GenericUtility();
try
{
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currDate = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
System.out.println("currDate>>>>"+currDate);
ConnDriver connDriver = null;
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
......@@ -69,7 +56,7 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
if (tranId != null && tranId.trim().length() > 0)
{
System.out.println("tranId>>>["+tranId+"]");
sql = " select status,confirmed,missing_inserted, transit_update from cust_stock where tran_id = ? ";
sql = " select status,confirmed from cust_stock where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
......@@ -77,8 +64,6 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
{
status = rs.getString("status");
confirmed = rs.getString("confirmed");
missingInserted = rs.getString("missing_inserted");
transitUpdate = rs.getString("transit_update");
}
rs.close();
rs = null;
......@@ -87,164 +72,6 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
System.out.println("status>>>>>>>>"+status);
if(!"Y".equalsIgnoreCase(confirmed) && !"S".equalsIgnoreCase(status))
{
//start added by chandrashekar on 31-dec-2015
if(!"Y".equalsIgnoreCase(missingInserted))
{
errString = itmDBAccessLocal.getErrorString("", "VTMISSITEM", "");
return errString;
}
if(transitUpdate == null || transitUpdate.trim().length()==0 || "N".equalsIgnoreCase(transitUpdate))
{
sql = " select transit_flag, site_code, cust_code, tran_date, tot_cl_value, tot_sales_value,tran_type" +
" from cust_stock where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if (rs.next())
{
transitFlag = rs.getString("transit_flag");
siteCode = rs.getString("site_code");
custCode = rs.getString("cust_code");
tranDate = rs.getTimestamp("tran_date");
totclValue = rs.getString("tot_cl_value");
totSalesValue = rs.getString("tot_sales_value");
tranType = rs.getString("tran_type");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE = '999999' AND VAR_NAME = 'CUST_STOCK_MODE'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
stockMode = checkNull(rs.getString("VAR_VALUE"));
System.out.println("stockMode :" + stockMode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(stockMode == null || "NULLFOUND".equalsIgnoreCase(stockMode)|| stockMode.trim().length()==0)
{
stockMode="S";
}
if(transitFlag == null || transitFlag.trim().length()==0)
{
transitFlag="N";
}
if("S".equalsIgnoreCase(tranType))
{
sql = "Select line_no, item_code, transit_qty, cl_stock, sales,op_stock, purc_rcp," +
" adj_qty, purc_ret, adhoc_repl_qty, unit " +
"From cust_stock_det Where tran_id = ? " +
"and case when transit_qty is null then 0 else transit_qty end = 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
while (rs.next())
{
lineNo = rs.getString("line_no");
clStock = rs.getDouble("cl_stock");
transitQty = rs.getDouble("transit_qty");
itemCode = rs.getString("item_code");
System.out.println("itemcode@@@@@@>>"+itemCode);
sql1 = "update cust_stock_det set original_cl_stock = ? "
+ "where tran_id = ? and line_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setDouble(1, clStock);
pstmt1.setString(2, tranId);
pstmt1.setString(3, lineNo);
cnt = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
if (transitQty == 0)
{
sql1 = "Select invoice_id From cust_stock_inv Where tran_id = ? and dlv_flg = 'N'";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
while (rs1.next())
{
invoiceId = checkNull(rs1.getString("invoice_id"));
System.out.println("invoiceId :" + invoiceId);
sql2 = "Select sum(quantity__stduom) as invoice_qty From "
+ "invdet Where invoice_id = ? " + "and item_code = ? ";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1, invoiceId);
pstmt2.setString(2, itemCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
invoiceQty = rs2.getDouble("invoice_qty");
System.out.println("invoiceQty :" + invoiceQty);
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
transitQty = transitQty + invoiceQty;
}// invoice loop
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
if (transitQty != 0)
{
sql = "update cust_stock_det set transit_qty = ? "
+ " where tran_id = ? "
+ " and line_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1, transitQty);
pstmt1.setString(2, tranId);
pstmt1.setString(3, lineNo);
cnt = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
}//cust_stock_det loop
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update cust_stock set transit_upd_flag = 'Y' where tran_id = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
cnt = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
}
sql = " update cust_stock set confirmed = 'Y', conf_date = ?, emp_code__aprv = ?,status = 'S' " +
" where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, currDate);
pstmt.setString(2, loginEmpCode);
pstmt.setString(3, tranId);
cnfCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if (cnfCnt>0)
{
conn.commit();
errString = itmDBAccessLocal.getErrorString("", "VTSUBM1", "");
}
//End added by chandrashekar on 31-dec-2015
/*
methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName;
......@@ -257,6 +84,18 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
compName = rs.getString("COMP_NAME");
}
System.out.println(">>>cust stock confirmation serviceCode = " + serviceCode + " compName " + compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -266,6 +105,18 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println(">>>cust stock confirmation serviceURI = " + serviceURI + " compName = " + compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -303,7 +154,7 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
conn.commit();
}
}*///commented by chandrashekar on 04-01-2016
}
}else
{
errString = itmDBAccessLocal.getErrorString("", "VTINVSUB2", "");
......@@ -466,12 +317,5 @@ public class CustStockGWTConf extends ActionHandlerEJB implements CustStockGWTCo
return errString;
}
private String checkNull(String input)
{
if (input == null)
{
input="";
}
return input;
}
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
CommonConstants commonConstants = new CommonConstants();
Connection conn = null;
public String process() throws RemoteException,ITMException
{
return "";
......@@ -77,7 +77,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
ResultSet rs = null;
PreparedStatement pstmt = null;
StringBuffer retDistOrdIssBuff = new StringBuffer();
String siteCodeFr="", siteCodeTo="",toDateStr="",frDateStr="";
java.sql.Date toDate = null;
java.sql.Date frDate = null;
......@@ -89,7 +89,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
double grossWeight=0.0,tareWeight=0.0,netWeight=0.0,frtAmt=0.0;
double amount=0.0,taxAmt=0.0,netAmt=0.0,discount=0.0,exchRateFrt=0.0;
double dcNo=0.0;
*/
*/
SimpleDateFormat sdf = null;
java.sql.Date tranDate = null;
java.sql.Date effDate = null;
......@@ -119,7 +119,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
toDateStr = genericUtility.getColumnValue("to_date",headerDom);
System.out.println("siteCodeFrom is ::"+siteCodeFr+"and siteCodeTo is ::"+siteCodeTo);
System.out.println("frDateStr is ::"+frDateStr+"and toDateStr is ::"+toDateStr);
if ((siteCodeFr == null || siteCodeFr.trim().length() == 0) ||(siteCodeTo == null || siteCodeTo.trim().length() == 0))
{
errString = itmDBAccessEJB.getErrorString("","VTMNULSITE","","",conn);
......@@ -144,7 +144,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
rs = null;
pstmt.close();
pstmt = null;
sql =" select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeTo);
......@@ -163,7 +163,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
pstmt.close();
pstmt = null;
}
if (frDateStr != null && frDateStr.trim().length() > 0 )
{
//frDate=java.sql.Date.valueOf(frDateStr.trim());
......@@ -185,26 +185,26 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
return errString;
}
System.out.println("frDate is ::"+frDate+"and toDate is ::"+toDate);
if (frDate.after(toDate)) //frmdate is grater than todate
{
errString = itmDBAccessEJB.getErrorString("","VTDATE12","","",conn);
return errString;
}
sql =" SELECT TRAN_ID,TRAN_DATE,EFF_DATE,DIST_ORDER,SITE_CODE, "
+" SITE_CODE__DLV,DIST_ROUTE,TRAN_CODE,LR_NO,LR_DATE,LORRY_NO, "
+" GROSS_WEIGHT,TARE_WEIGHT,NET_WEIGHT,FRT_AMT,AMOUNT,TAX_AMT, "
+" NET_AMT,LOC_CODE__GIT,REMARKS,FRT_TYPE,CHG_USER,CHG_TERM , "
+" CURR_CODE,CHG_DATE,CONFIRMED,CONF_DATE,ORDER_TYPE,AVAILABLE_YN ,"
+" STOCK_STATUS,GP_NO,GP_DATE,GP_SER,DISCOUNT,SHIPMENT_ID, "
+" CURR_CODE__FRT,EXCH_RATE__FRT,PROJ_CODE,DC_NO "
+" FROM DISTORD_ISS "
+" WHERE (tran_date >= ? ) AND "
+" (tran_date <= ? ) AND "
+" (site_code between ? and ? )AND "
+" CONFIRMED = ? ";
+" SITE_CODE__DLV,DIST_ROUTE,TRAN_CODE,LR_NO,LR_DATE,LORRY_NO, "
+" GROSS_WEIGHT,TARE_WEIGHT,NET_WEIGHT,FRT_AMT,AMOUNT,TAX_AMT, "
+" NET_AMT,LOC_CODE__GIT,REMARKS,FRT_TYPE,CHG_USER,CHG_TERM , "
+" CURR_CODE,CHG_DATE,CONFIRMED,CONF_DATE,ORDER_TYPE,AVAILABLE_YN ,"
+" STOCK_STATUS,GP_NO,GP_DATE,GP_SER,DISCOUNT,SHIPMENT_ID, "
+" CURR_CODE__FRT,EXCH_RATE__FRT,PROJ_CODE,DC_NO "
+" FROM DISTORD_ISS "
+" WHERE (tran_date >= ? ) AND "
+" (tran_date <= ? ) AND "
+" (site_code between ? and ? )AND "
+" CONFIRMED = ? ";
System.out.println("sql..."+ sql);
pstmt = conn.prepareStatement(sql);
pstmt.setDate(1,frDate );
......@@ -309,7 +309,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
rs = null;
pstmt.close();
pstmt = null;
}
catch (SQLException e)
{
......@@ -325,7 +325,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
{
try
{
// retTabSepStrBuff = null;
// retTabSepStrBuff = null;
if(conn != null && !conn.isClosed())
{
if(rs != null)
......@@ -359,10 +359,10 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
String retStr = "";
try
{
System.out.println("xmlString[process]::::::::::;;;"+xmlString);
System.out.println("xmlString2[process]::::::::::;;;"+xmlString2);
System.out.println("windowName[process]::::::::::;;;"+windowName);
System.out.println("xtraParams[process]:::::::::;;;"+xtraParams);
System.out.println("xmlString[process]::::::::::;;;"+xmlString);
System.out.println("xmlString2[process]::::::::::;;;"+xmlString2);
System.out.println("windowName[process]::::::::::;;;"+windowName);
System.out.println("xtraParams[process]:::::::::;;;"+xtraParams);
}
catch(Exception e)
{
......@@ -397,7 +397,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
//Connection conn = null;
int parentNodeListLength = 0;
int childNodeListLength = 0;
NodeList parentNodeList = null;
NodeList childNodeList = null;
......@@ -422,7 +422,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
System.out.println("[DistIssPrcEJB][loginCode]=>"+loginCode);
System.out.println("[DistIssPrcEJB][chgTerm]=>"+chgTerm);
genericUtility = new ibase.utility.E12GenericUtility();
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
System.out.println("parentNodeListLength:::::::::"+parentNodeListLength);
......@@ -444,7 +444,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
System.out.println( "tranIdFr before.........:-"+ tranIdFr );
tranIdFr = childNode.getFirstChild().getNodeValue();
System.out.println( "tranIdFr after.........:-"+ tranIdFr );
}
}
System.out.println( "tranIdFr final.........:-"+ tranIdFr );
......@@ -477,16 +477,16 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
{
System.out.println("Exception : WorkorderPrcEJB =>"+d.toString());
d.printStackTrace();
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
}
finally
{
System.out.println("errorString...." + errString);
System.out.println("Closing Connection....");
System.out.println("Closing Connection....");
try
{
if(conn != null && !conn.isClosed())
......@@ -534,6 +534,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,serviceCode);
......@@ -543,6 +555,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -583,20 +607,25 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
}
catch(Exception e)
{
System.out.println("Exception inCalling confirmed");
e.printStackTrace();
try{
conn.rollback();
}catch (Exception s)
{
System.out.println("Unable to rollback");
s.printStackTrace();
}
}
e.printStackTrace();
try{
conn.rollback();
}catch (Exception s)
{
System.out.println("Unable to rollback");
s.printStackTrace();
}
}
}
return retString;
}
......
......@@ -42,8 +42,8 @@ public class POMilestoneCnf
// Following variable defined by Sagar on 26/11/15 Start.
int minDaysDlvTerm=0,maxDaysDlvTerm=0;
double minAmtDlvTerm=0.0,maxAmtDlvTerm=0.0,finChrgeDlvTerm=0.0;
String fchgTypeDlvTerm="";
// Following variable defined by Sagar on 26/11/15 End.
String fchgTypeDlvTerm="";
// Following variable defined by Sagar on 26/11/15 End.
public String confMilestone( String tranId, String xmlDataAll, String editFlag ) throws Exception
{
......@@ -91,19 +91,19 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@tranId["+tranId+"]tranType["+tranType+"]");
//vishakha method called
if(!"D".equalsIgnoreCase(tranType))
{
POrderMilestone pOrderMilestone = new POrderMilestone();
returnStr = pOrderMilestone.recalcDueDate(tranId, xmlDataAll, conn);
System.out.println("@@@@@@@@@ pOrderMilestone.recalcDueDate() returnStr["+returnStr+"]");
}
if(returnStr == null || returnStr.trim().length() == 0 || "SUCCESS".equalsIgnoreCase(returnStr))
{
returnStr = workflowForPenalty(tranId, xmlDataAll, conn);
......@@ -116,7 +116,7 @@ public class POMilestoneCnf
else
{
System.out.println("@@@@@@@@@ workflowForPenalty failed.....");
// returnStr = "N";
// returnStr = "N";
}
}
......@@ -166,11 +166,11 @@ public class POMilestoneCnf
// Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf.format(currentDate)+" 00:00:00.0");
Timestamp newsysDate = getCurrdateAppFormat();
System.out.println("Now the date is :=> ["+newsysDate+"]");
// wfStatusDate code Added by Sagar on 23/11/15
java.util.Date date1= new java.util.Date();
Timestamp wfStatusDate = new Timestamp(date1.getTime());
System.out.println(">>wfStatusDate["+wfStatusDate+"]");
java.util.Date date1= new java.util.Date();
Timestamp wfStatusDate = new Timestamp(date1.getTime());
System.out.println(">>wfStatusDate["+wfStatusDate+"]");
java.sql.Timestamp today = null;
java.util.Date date = null;
......@@ -186,11 +186,11 @@ public class POMilestoneCnf
String chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"CHG_USER");
String suppName="",taskDescr="";
String mileStoneVouchAutoCnf="",mileStoneDebitAutoCnf="";
sql = " select tran_id,tran_date,purc_order,line_no__ord,tran_type,site_code,supp_code,acct_code,cctr_code," +
" tax_class,tax_chap,tax_env, task_code, amount,due_date,task_status,payment_opt,remarks,tran_id__vch," +
" conf_date,compl_date,emp_code__aprv,wf_status,status_date,compl_date,allow_override,amount_orig " +
" from PUR_MILSTN where tran_id = ? " ;
" tax_class,tax_chap,tax_env, task_code, amount,due_date,task_status,payment_opt,remarks,tran_id__vch," +
" conf_date,compl_date,emp_code__aprv,wf_status,status_date,compl_date,allow_override,amount_orig " +
" from PUR_MILSTN where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId );
rs = pstmt.executeQuery();
......@@ -246,7 +246,7 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
*/
*/
// xml iterate
Document xmlDataAllDom= null;
if(xmlDataAll != null && xmlDataAll.trim().length()!=0)
......@@ -256,8 +256,8 @@ public class POMilestoneCnf
}
timeDiff = calculateDelayDays(xmlDataAll);
amount = 0; // testing
paymentOpt = "";
System.out.println("@@@@ before paymentOpt["+paymentOpt+"]amount["+amount+"]");
......@@ -280,8 +280,8 @@ public class POMilestoneCnf
*/
System.out.println("tranId["+tranId+"]tranType["+tranType+"]timeDiff["+timeDiff+"]paymentOpt["+paymentOpt+"]taskCode["+taskCode+"]complDateStr["+complDateStr+"]amountStr["+amountStr+"]");
if( "P".equalsIgnoreCase(tranType))
{ // voucher created for tran type 'P'
System.out.println("@@@@@@@@ voucher created for tran type 'P' ");
......@@ -319,19 +319,19 @@ public class POMilestoneCnf
if(returnStr.indexOf("Success") > -1 )
{
System.out.println("CreatePoVoucherAdvance created Successfully["+returnStr+"]");
// Code added by Sagar on 20/11/15, Start..
String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
tranIdForVoucher = arrayForTranId[1].substring(0,endIndex);
tranIdForVoucher=tranIdForVoucher==null ? "" : tranIdForVoucher.trim();
System.out.println(">>tranIdForVoucher["+tranIdForVoucher+"]");
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println(">>ts_now["+ts_now+"]");*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y', tran_id__vch= ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
......@@ -342,20 +342,20 @@ public class POMilestoneCnf
int cntVouch = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(">>>cntVouch:"+cntVouch);
// Code added by Sagar on 20/11/15, End..
conn.commit();
/*String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
tranIdForVoucher = arrayForTranId[1].substring(0,endIndex);
tranIdForVoucher=tranIdForVoucher==null ? "" : tranIdForVoucher.trim();
System.out.println("tranIdForVoucher["+tranIdForVoucher+"]");
*/
*/
//returnStr = confirmTranscation("voucher_adv",tranIdForVoucher,xtraParams,conn); // Comment added by Sagar on 20/11/15
//Code added by Sagar on 20/11/15 Start..
FinCommon fincommon = new FinCommon();
mileStoneVouchAutoCnf= fincommon.getFinparams("999999", "MLSTNVOUCH_AUTOCNF", conn);
......@@ -372,7 +372,7 @@ public class POMilestoneCnf
{
mileStoneVouchAutoCnf ="N";
}
if("Y".equalsIgnoreCase(mileStoneVouchAutoCnf))
{
returnStr = confirmTranscation("voucher_adv",tranIdForVoucher,xtraParams,conn);
......@@ -383,7 +383,7 @@ public class POMilestoneCnf
}
//Code added by Sagar on 20/11/15 End.
System.out.println("CreatePoVoucherAdvance confirmTranscation returnStr["+returnStr+"]");
if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 )
{
// Comment added by Sagar on 20/11/15, Start.
......@@ -397,7 +397,7 @@ public class POMilestoneCnf
pstmt = null;
System.out.println("@@@@@ updated sucessfully pur_milstn tranId["+tranId+"]tranIdForVoucher["+tranIdForVoucher+"]cnt["+cnt+"]");*/
// Comment added by Sagar on 20/11/15, End.
// conn.commit();
}
else
......@@ -421,9 +421,9 @@ public class POMilestoneCnf
System.out.println("paymentOpt is 'N' .....");
//conn.rollback();
//return returnStr;
//Code added by Sagar on 23/11/15 Start.
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
......@@ -435,7 +435,7 @@ public class POMilestoneCnf
pstmt = null;
System.out.println(">>>If paymentOpt is 'N' cntPurMlstn:"+cntPurMlstn);
conn.commit();
//Code added by Sagar on 23/11/15 End.
returnStr = "Success";
}
......@@ -448,8 +448,8 @@ public class POMilestoneCnf
double penalatyAmount = penalatyAmount(xmlDataAllDom,purcOrder,amountStr,timeDiff,taskCode,conn );
sql = " select supp_name from supplier where supp_code = ? ";
sql = " select supp_name from supplier where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode );
rs = pstmt.executeQuery();
......@@ -461,7 +461,7 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
//fn_gencode_desc('TASK_CODE__DELAY','W_PUR_MILSTN', rtrim(PUR_MILSTN_RESCH.TASK_CODE__DELAY),'D') as task_descr
sql = " select fn_gencode_desc('TASK_CODE','W_PORDER', rtrim(?),'D') as task_descr from dual ";
pstmt = conn.prepareStatement(sql);
......@@ -475,51 +475,51 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
// remarks = "Penalty for "+taskCode+"("+taskDescr+") delayed by "+timeDiff+" days."; // Comment added by Sagar on 24/11/15
//remarks = "Penalty request generated for "+taskCode+"("+taskDescr+") delayed by "+timeDiff+" days."; // Comment added by Sagar on 26/11/15
// Code added by Sagar on 26/11/15 Start.
if(taskCode!= null && taskCode.trim().length() > 0)
{
taskCode=taskCode.trim();
}
daySlab= ""+minDaysDlvTerm+"-"+maxDaysDlvTerm+"";
chargesSlab= ""+minAmtDlvTerm+"-"+maxAmtDlvTerm+"";
if(fchgTypeDlvTerm!=null && fchgTypeDlvTerm.trim().length() > 0)
{
fchgTypeDlvTerm=fchgTypeDlvTerm.trim();
if("F".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Fixed";
}
else if("P".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Percentage";
}
else if("Q".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Per Quantity";
}
}
remarks="Request Generated for Task: ("+taskCode+"), Days slab: ("+daySlab+"), Charges slab("+chargesSlab+"), Type: ("+finChrgTypeDescr+"), Financial Charges: ("+finChrgeDlvTerm+") task delayed by "+timeDiff+" days";
if(fchgTypeDlvTerm!=null && fchgTypeDlvTerm.trim().length() > 0)
{
fchgTypeDlvTerm=fchgTypeDlvTerm.trim();
if("F".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Fixed";
}
else if("P".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Percentage";
}
else if("Q".equals(fchgTypeDlvTerm))
{
finChrgTypeDescr="Per Quantity";
}
}
remarks="Request Generated for Task: ("+taskCode+"), Days slab: ("+daySlab+"), Charges slab("+chargesSlab+"), Type: ("+finChrgTypeDescr+"), Financial Charges: ("+finChrgeDlvTerm+") task delayed by "+timeDiff+" days";
System.out.println(">>>daySlab:"+daySlab);
System.out.println(">>>chargesSlab:"+chargesSlab);
System.out.println(">>>finChrgTypeDescr:"+finChrgTypeDescr);
System.out.println(">>>finChrgeDlvTerm:"+finChrgeDlvTerm);
System.out.println(">>>remarks:"+remarks);
// Code added by Sagar on 26/11/15 End.
// Code added by Sagar on 27/11/15 Start.
sql = " select ord_amt, tax_amt, tot_amt from porder where purc_order= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
......@@ -534,11 +534,11 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">>>Delay ordAmtPord:"+ ordAmtPord);
System.out.println(">>>Delay taxAmtPord:"+ taxAmtPord);
System.out.println(">>>Delay totAmtPord:"+ totAmtPord);
sql = " select descr from gencodes where fld_name='TASK_CODE' and mod_name='W_PORDER' and fld_value= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taskCode);
......@@ -551,11 +551,11 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">>>taskCodeDescr:"+ taskCodeDescr);
// Code added by Sagar on 27/11/15 End.
xmlBuff = new StringBuffer();
System.out.println("--XML CREATION !!!!!--");
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
......@@ -620,7 +620,7 @@ public class POMilestoneCnf
xmlBuff.append( "<chg_user><![CDATA["+chgUser+"]]></chg_user>");
xmlBuff.append( "<chg_date><![CDATA["+ sdf.format(currentDate).toString() +"]]></chg_date>");
xmlBuff.append( "<chg_term><![CDATA["+chgTerm+"]]></chg_term>");
xmlBuff.append( "<ord_amt><![CDATA["+ordAmtPord+"]]></ord_amt>"); // Code added by Sagar on 27/11/15 Start.
xmlBuff.append( "<tax_amt><![CDATA["+taxAmtPord+"]]></tax_amt>");
xmlBuff.append( "<tot_amt><![CDATA["+totAmtPord+"]]></tot_amt>"); // Code added by Sagar on 27/11/15 End.
......@@ -650,7 +650,7 @@ public class POMilestoneCnf
minAmtDlvTerm=0.0;
maxAmtDlvTerm=0.0;
finChrgeDlvTerm=0.0;
fchgTypeDlvTerm="";
fchgTypeDlvTerm="";
}
if( "D".equalsIgnoreCase(tranType))
{ // debit note created created
......@@ -713,11 +713,11 @@ public class POMilestoneCnf
String tranIdForDebit = arrayForTranId[1].substring(0,endIndex);
tranIdForDebit=tranIdForDebit==null ? "" : tranIdForDebit.trim();
System.out.println(">>tranIdForDebit["+tranIdForDebit+"]");
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println(">>ts_now["+ts_now+"]");*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y', tran_id__vch= ? where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
......@@ -732,7 +732,7 @@ public class POMilestoneCnf
// Code added by Sagar on 20/11/15, End.
conn.commit();
// Comment added by Sagar on 20/11/15
/*String[] arrayForTranId = returnStr.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
......@@ -741,9 +741,9 @@ public class POMilestoneCnf
System.out.println("-tranIdForDebit["+tranIdForDebit+"]"); */
//returnStr = confirmTranscation("drcrpay_dr",tranIdForDebit,xtraParams,conn); // Comment added by Sagar on 20/11/15
// Code added by Sagar on 20/11/15, Start.
FinCommon fincommon = new FinCommon();
mileStoneDebitAutoCnf= fincommon.getFinparams("999999", "MLSTNDEBIT_AUTOCNF", conn);
System.out.println(">>>mileStoneDebitAutoCnf:"+mileStoneDebitAutoCnf);
......@@ -759,7 +759,7 @@ public class POMilestoneCnf
{
mileStoneDebitAutoCnf ="N";
}
if("Y".equalsIgnoreCase(mileStoneDebitAutoCnf))
{
returnStr = confirmTranscation("drcrpay_dr",tranIdForDebit,xtraParams,conn);
......@@ -769,10 +769,10 @@ public class POMilestoneCnf
returnStr = "Success";
}
// Code added by Sagar on 20/11/15, End.
System.out.println("confirmTranscation debit node returnStr["+returnStr+"]");
// conn.commit();
if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 )
......@@ -787,9 +787,9 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
System.out.println("@@@@@ updated sucessfully pur_milstn tranId["+tranId+"]tranIdForDebit["+tranIdForDebit+"]cnt["+cnt+"]");
*/
*/
// Comment added by Sagar on 20/11/15, End
// conn.commit();
}
else
......@@ -810,7 +810,7 @@ public class POMilestoneCnf
{
// Code added by Sagar on 23/11/15, Start.
System.out.println(">>>If tranType 'D' and amount in less than ZERO then update....");
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
......@@ -829,14 +829,14 @@ public class POMilestoneCnf
System.out.println("@@@@@@@@@@@ before status update pur_milstn returnStr["+returnStr+"]");
//if(returnStr.indexOf("Success") > -1 || returnStr.indexOf("VTSUCC1") > -1 || returnStr.indexOf("SucAmtZero") > -1 ) // Comment Added by Sagar on 20/11/15
if(returnStr.indexOf("SucAmtZero") > -1 ) // Condition added by Sagar on 20/11/15
{
/*java.util.Date date1= new java.util.Date();
/*java.util.Date date1= new java.util.Date();
Timestamp ts_now = new Timestamp(date1.getTime());
System.out.println("ts_now["+ts_now+"]");
*/
*/
sql = " update pur_milstn set wf_status = 'C' ,conf_date = ? ,status_date = ? , confirmed = 'Y' where tran_id = ? ";
System.out.println("sql :"+sql );
pstmt = conn.prepareStatement(sql);
......@@ -879,60 +879,60 @@ public class POMilestoneCnf
Timestamp complDateNew = null,dueDateOrg = null;
String retString = "SUCCESS";
String sqlResch ="",dateFormat = "";
System.out.println("xmlString DOM-->>["+xmlDataAll+"]");
System.out.println("xmlString DOM-->>["+xmlDataAll+"]");
System.out.println("recalcDueDate called................");
E12GenericUtility genericUtility = new E12GenericUtility();
dom = genericUtility.parseString(xmlDataAll);// read xmldataAll
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
if(childNodeName.equalsIgnoreCase("compl_date"))
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
if(childNodeName.equalsIgnoreCase("compl_date"))
{
complDate = checkNull(genericUtility.getColumnValue("compl_date",dom));
System.out.println("complDate--->["+complDate+"]");
}
if(childNodeName.equalsIgnoreCase("task_code"))
{
taskCode = checkNull(genericUtility.getColumnValue("task_code",dom));
System.out.println("taskCode--->["+taskCode+"]");
}
if(childNodeName.equalsIgnoreCase("due_date"))
{
dueDateOrgStr = checkNull(genericUtility.getColumnValue("due_date",dom));
System.out.println("dueDateOrgStr--->["+dueDateOrgStr+"]");
}
if(childNodeName.equalsIgnoreCase("date_format"))
{
dateFormat = checkNull(genericUtility.getColumnValue("date_format",dom));
System.out.println("dateFormat--->["+dateFormat+"]");
}
complDate = checkNull(genericUtility.getColumnValue("compl_date",dom));
System.out.println("complDate--->["+complDate+"]");
}
if(childNodeName.equalsIgnoreCase("task_code"))
{
taskCode = checkNull(genericUtility.getColumnValue("task_code",dom));
System.out.println("taskCode--->["+taskCode+"]");
}
if(childNodeName.equalsIgnoreCase("due_date"))
{
dueDateOrgStr = checkNull(genericUtility.getColumnValue("due_date",dom));
System.out.println("dueDateOrgStr--->["+dueDateOrgStr+"]");
}
if(childNodeName.equalsIgnoreCase("date_format"))
{
dateFormat = checkNull(genericUtility.getColumnValue("date_format",dom));
System.out.println("dateFormat--->["+dateFormat+"]");
}
}
if(complDate.length() > 0)//completion date is not null
{
complDateNew = Timestamp.valueOf(genericUtility.getValidDateString(complDate, dateFormat,genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("completionDate ====parsed into sql format:::::"+complDateNew);
complDateNew = Timestamp.valueOf(genericUtility.getValidDateString(complDate, dateFormat,genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("completionDate ====parsed into sql format:::::"+complDateNew);
}
if(dueDateOrgStr.length() > 0)
{
dueDateOrg = Timestamp.valueOf(genericUtility.getValidDateString(dueDateOrgStr,dateFormat,genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("Due Date Original ====parsed into sql format:::==="+dueDateOrg);
}
if(dueDateOrg.before(complDateNew))//if completion date is greater than due date original
......@@ -941,8 +941,8 @@ public class POMilestoneCnf
delayDays = (int)utilmethod.DaysAfter(dueDateOrg, complDateNew); //(int)countDaysBetween(dueDateOrg,complDateNew);
System.out.println("delayed days-----"+delayDays);
}
return delayDays;
}
......@@ -963,7 +963,7 @@ public class POMilestoneCnf
sql = " select min_day,max_day,fin_chg,fchg_type,min_amt,max_amt from pord_dlv_term where purc_order= ? " +
" and REF_CODE=? and ? between min_day and max_day ";
" and REF_CODE=? and ? between min_day and max_day ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
pstmt.setString(2, taskCode);
......@@ -987,7 +987,7 @@ public class POMilestoneCnf
System.out.println("fchgType :"+fchgType);
System.out.println("minAmt :"+minAmt);
System.out.println("maxAmt :"+maxAmt);
// Code added by Sagar on 26/11/15 Start.
minDaysDlvTerm= minDays;
maxDaysDlvTerm= maxDays;
......@@ -995,7 +995,7 @@ public class POMilestoneCnf
maxAmtDlvTerm= maxAmt;
finChrgeDlvTerm= finChrge;
fchgTypeDlvTerm= fchgType;
// Code added by Sagar on 26/11/15 End.
System.out.println("========Penalty amount calculation=======");
......@@ -1123,7 +1123,7 @@ public class POMilestoneCnf
public String createDebitNote(HashMap<String,String> drcrMap,Connection conn)
throws RemoteException, ITMException {
throws RemoteException, ITMException {
StringBuffer xmlBuff = null;
String xmlString = null;
......@@ -1145,7 +1145,7 @@ public class POMilestoneCnf
double finChrge=0.0,minAmt=0.0,maxAmt=0.0,amtDet=0.0,taxAmtDet=0.0,amount=0.0,pentlyAmt=0.0;
double exchRate = 0.0,billAmt=0.0,taxAmt=0.0,totAmt=0.0,netAMt=0.0;
Date taxDate=null,effDate=null;
// HashMap<String,String> vocDetMap = new HashMap<String,String>();
// HashMap<String,String> vocDetMap = new HashMap<String,String>();
boolean flag=false;
E12GenericUtility genericUtility = new E12GenericUtility();
......@@ -1298,7 +1298,7 @@ public class POMilestoneCnf
{
sql = " select SUPP_CODE,PURC_ORDER,ACCT_CODE,CCTR_CODE,DUE_DATE,SITE_CODE " +
" from pur_milstn where tran_id = ? ";
" from pur_milstn where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
......@@ -1348,11 +1348,11 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
sql = " select CURR_CODE,EXCH_RATE , " +
" TAX_AMT,TOT_AMT,TAX_DATE ,TAX_CLASS,TAX_CHAP,TAX_ENV ," +
" PROJ_CODE from porder where PURC_ORDER = ?" ;
" TAX_AMT,TOT_AMT,TAX_DATE ,TAX_CLASS,TAX_CHAP,TAX_ENV ," +
" PROJ_CODE from porder where PURC_ORDER = ?" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
......@@ -1409,8 +1409,8 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
sql = " select acct_code__dr,cctr_code__dr,acct_code__cr,cctr_code__cr from porddet where purc_order= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder);
......@@ -1422,39 +1422,39 @@ public class POMilestoneCnf
acctCodeCr = rs.getString("acct_code__cr");
cctrCodeCr = rs.getString("cctr_code__cr");
acctCodeDr=acctCodeDr==null ? "" :acctCodeDr.trim();
cctrCodeDr=cctrCodeDr==null ? "" :cctrCodeDr ;
acctCodeCr=acctCodeCr==null ? "" :acctCodeCr.trim();
cctrCodeCr=cctrCodeCr==null ? "" :cctrCodeCr ;
System.out.println("acctCodeDr :"+acctCodeDr);
System.out.println("cctCodeDr :"+cctrCodeDr);
System.out.println("acctCodeCr :"+acctCodeCr);
System.out.println("cctrCodeCr :"+cctrCodeCr);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
FinCommon fincommon = new FinCommon();
String delayPenaltyAcct = fincommon.getFinparams("999999", "DELAY_PENALTY_ACCT", conn);
if(delayPenaltyAcct != null && delayPenaltyAcct.trim().length()>0 && !("NULLFOUND".equalsIgnoreCase(delayPenaltyAcct)))
{
acctCodeDr = delayPenaltyAcct;
cctrCodeDr = cctrCodeCr;
}
/*
/*
sql = " select line_no,site_code,tax_amt,tax_chap,tax_class,tax_env,acct_code__dr," +
" cctr_code__dr from porddet where PURC_ORDER= ? " ;
......@@ -1532,7 +1532,7 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
*/
*/
/*
double penaltyAmtDummy= pentlyAmt;
sql = " select tran_id,LINE_NO,ACCT_CODE,CCTR_CODE,AMOUNT,TAX_AMT,EXCH_RATE," +
......@@ -1618,7 +1618,7 @@ public class POMilestoneCnf
vocDetMap.put("tax_chap"+cnt, taxChapDet);
vocDetMap.put("tax_chep"+cnt, taxChepDet);
vocDetMap.put("tax_env"+cnt, taxEnvDet);
penaltyAmtDummy = penaltyAmtDummy - amtDet;
}
}
......@@ -1628,9 +1628,9 @@ public class POMilestoneCnf
pstmt = null;
*/
// System.out.println("@@@@@@@@@@@@@@ vocDetMap["+vocDetMap+"]");
// System.out.println("@@@@@@@@@@@@@@ vocDetMap["+vocDetMap+"]");
// Code added by Sagar on 26/11/15 Start.
sql = "select ord_date from porder where purc_order= ? ";
pstmt = conn.prepareStatement(sql);
......@@ -1645,7 +1645,7 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
System.out.println(">>>ordDate:"+ordDate);
if(ordDate!= null)
{
ordDateApp = sdfApp.format(ordDate);
......@@ -1656,8 +1656,8 @@ public class POMilestoneCnf
tranSer="DRNPAY";
siteCode = siteCode == null ? "" : siteCode.trim();
// Code added by Sagar on 27/11/15 Start
System.out.println(">>>tranId:"+tranId);
//getting line_no__ord
......@@ -1676,7 +1676,7 @@ public class POMilestoneCnf
pstmt = null;
System.out.println(">>>for drcrpay_dr lineNoOrd:"+lineNoOrd);
System.out.println(">>>for drcrpay_dr purcOrdNo:"+purcOrdNo);
//getting amout,voucher no, task_code
sql = " select amount, tran_id__vch, task_code from pur_milstn where purc_order= ? and line_no__ord= ? and tran_type='P' ";
pstmt = conn.prepareStatement(sql);
......@@ -1696,10 +1696,10 @@ public class POMilestoneCnf
System.out.println(">>>for drcrpay_dr amountPurMilstn:"+amountPurMilstn);
System.out.println(">>>for drcrpay_dr tranIdVouch:"+tranIdVouch);
System.out.println(">>>for drcrpay_dr taskCodePurMilstn:"+taskCodePurMilstn);
//remark="Generated Against Voucher No: "+tranIdVouch+" , Voucher Amt: "+amountPurMilstn+" , For Task: "+taskCodePurMilstn+" ";
remark="Voucher:"+tranIdVouch+",Amt:"+amountPurMilstn+",Task:"+taskCodePurMilstn+""; // added for maintain remarks lenght not more than 60 character by cpatil on 30/11/15
System.out.println(">>>for drcrpay_dr remark:"+remark);
// Code added by Sagar on 27/11/15 End
......@@ -1745,7 +1745,7 @@ public class POMilestoneCnf
}
xmlBuff.append("<vouch_ser><![CDATA[]]></vouch_ser>");
// xmlBuff.append("<vouch_no><![CDATA[" + checkNull(voucherId)+ "]]></vouch_no>");
// xmlBuff.append("<vouch_no><![CDATA[" + checkNull(voucherId)+ "]]></vouch_no>");
xmlBuff.append("<vouch_no><![CDATA[]]></vouch_no>");
xmlBuff.append("<amount><![CDATA[" + pentlyAmt + "]]></amount>");
xmlBuff.append("<curr_code><![CDATA[" + checkNull(currCode)+ "]]></curr_code>");
......@@ -1791,51 +1791,51 @@ public class POMilestoneCnf
System.out.println("end of details 1");
// for (int itemCtr = 1; itemCtr <= cnt; itemCtr++)
// {
lineNo++;
System.out.println("lineNo is " + lineNo);
// tempMap = (HashMap)tempList.get(itemCtr);
// for (int itemCtr = 1; itemCtr <= cnt; itemCtr++)
// {
lineNo++;
System.out.println("lineNo is " + lineNo);
// tempMap = (HashMap)tempList.get(itemCtr);
System.out.println("start of details 2");
System.out.println("start of details 2");
xmlBuff.append("<Detail2 dbID='' domID=\"1\" objName=\"drcrpay_dr\" objContext=\"2\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no>" + lineNo + "</line_no>");
xmlBuff.append("<vouch_no><![CDATA[]]></vouch_no>");
xmlBuff.append("<line_no__vou><![CDATA[]]></line_no__vou>");
xmlBuff.append("<Detail2 dbID='' domID=\"1\" objName=\"drcrpay_dr\" objContext=\"2\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no>" + lineNo + "</line_no>");
xmlBuff.append("<vouch_no><![CDATA[]]></vouch_no>");
xmlBuff.append("<line_no__vou><![CDATA[]]></line_no__vou>");
// xmlBuff.append("<vouch_no><![CDATA["+vocDetMap.get("tran_id" + itemCtr)+"]]></vouch_no>");
// xmlBuff.append("<line_no__vou><![CDATA["+vocDetMap.get("line_no" + itemCtr)+"]]></line_no__vou>");
// xmlBuff.append("<line_no__vou><![CDATA["+vocDetMap.get("line_no" + itemCtr)+"]]></line_no__vou>");
// xmlBuff.append("<vouch_no><![CDATA["+voucherId+"]]></vouch_no>");
// xmlBuff.append("<line_no__vou><![CDATA["+lineNo+"]]></line_no__vou>");
xmlBuff.append("<item_code><![CDATA[]]></item_code>");
xmlBuff.append("<item_code><![CDATA[]]></item_code>");
// xmlBuff.append("<tax_class><![CDATA["+vocDetMap.get("tax_class" + itemCtr)+"]]></tax_class>");
// xmlBuff.append("<tax_chap><![CDATA["+vocDetMap.get("tax_chap" + itemCtr)+"]]></tax_chap>");
// xmlBuff.append("<tax_env><![CDATA["+vocDetMap.get("tax_env" + itemCtr)+"]]></tax_env>");
xmlBuff.append("<tax_class><![CDATA[]]></tax_class>");
xmlBuff.append("<tax_chap><![CDATA[]]></tax_chap>");
xmlBuff.append("<tax_env><![CDATA[]]></tax_env>");
xmlBuff.append("<drcr_amt><![CDATA["+pentlyAmt+"]]></drcr_amt>");
xmlBuff.append("<tax_class><![CDATA[]]></tax_class>");
xmlBuff.append("<tax_chap><![CDATA[]]></tax_chap>");
xmlBuff.append("<tax_env><![CDATA[]]></tax_env>");
xmlBuff.append("<drcr_amt><![CDATA["+pentlyAmt+"]]></drcr_amt>");
// xmlBuff.append("<tax_amt><![CDATA["+vocDetMap.get("tax_amt" + itemCtr)+"]]></tax_amt>");
xmlBuff.append("<tax_amt><![CDATA[0]]></tax_amt>");
xmlBuff.append("<tax_amt><![CDATA[0]]></tax_amt>");
// xmlBuff.append("<net_amt><![CDATA["+vocDetMap.get("amount" + itemCtr)+"]]></net_amt>");
// xmlBuff.append("<net_amt><![CDATA[0]]></net_amt>");
xmlBuff.append("<net_amt><![CDATA["+pentlyAmt+"]]></net_amt>");
xmlBuff.append("<reas_code><![CDATA[]]></reas_code>");
xmlBuff.append("<acct_code><![CDATA["+acctCodeDr.trim()+"]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA["+cctrCodeDr+"]]></cctr_code>");
xmlBuff.append("<net_amt><![CDATA["+pentlyAmt+"]]></net_amt>");
xmlBuff.append("<reas_code><![CDATA[]]></reas_code>");
xmlBuff.append("<acct_code><![CDATA["+acctCodeDr.trim()+"]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA["+cctrCodeDr+"]]></cctr_code>");
// xmlBuff.append("<amount><![CDATA["+vocDetMap.get("amount" + itemCtr)+"]]></amount>");
xmlBuff.append("<amount><![CDATA["+pentlyAmt+"]]></amount>");
xmlBuff.append("<amount><![CDATA["+pentlyAmt+"]]></amount>");
// xmlBuff.append("<analysis3><![CDATA["+vocDetMap.get("analysis3" + itemCtr)+"]]></analysis3>");
// xmlBuff.append("<analysis2><![CDATA["+vocDetMap.get("analysis2" + itemCtr)+"]]></analysis2>");
// xmlBuff.append("<analysis1><![CDATA["+vocDetMap.get("analysis1" + itemCtr)+"]]></analysis1>");
xmlBuff.append("</Detail2>");
xmlBuff.append("</Detail2>");
//}// end of for loop
......@@ -2219,6 +2219,18 @@ public class POMilestoneCnf
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -2228,6 +2240,18 @@ public class POMilestoneCnf
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -2270,6 +2294,11 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -210,8 +210,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// ///////////////////
if (connStatus)// Condition added - 25/11/11 - Gulzar as
// confirm method is called from post save
// component
// confirm method is called from post save
// component
{
conn.commit();
retString = itmDBAccessLocal.getErrorString("", "VTMCONF2", "");
......@@ -243,7 +243,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
// if( conn != null && ! conn.isClosed() ) // Gulzar - 25/11/11
if (conn != null && !conn.isClosed() && connStatus) // Gulzar -
// 25/11/11
// 25/11/11
{
conn.close();
conn = null;
......@@ -609,7 +609,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtSql = null;
rs1.close();
rs1 = null;
System.out.println("(((totRcp - ordQty) / ordQty) * 100) :- ["+(((totRcp - ordQty) / ordQty) * 100)+"]");
if ((((totRcp - ordQty) / ordQty) * 100) > qtyTol)
......@@ -769,10 +769,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -787,10 +787,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -885,11 +885,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
System.out.println(">>>>>>>>>>>>>>>Lock group for updation:" + lckGroup);
confDate = new java.sql.Timestamp(System.currentTimeMillis());
sql = "UPDATE PORCP SET CONFIRMED = 'Y',CONF_DATE = ?, LOCK_GROUP=? WHERE TRAN_ID = ? "; // add
// LOCK_GROUP
// by
// Sagar
// M.
// 03/MAy/14
// LOCK_GROUP
// by
// Sagar
// M.
// 03/MAy/14
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setTimestamp(1, confDate);
pstmtUpd.setString(2, lckGroup);
......@@ -910,88 +910,88 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
InvAcct invAcct = new InvAcct();
retString = invAcct.acctPoRcpt(tranId, conn);
System.out.println("RetString1>>>>>>>" + retString);
if(retString != null && "CREATE-VOUCHER".equals(retString.trim()))
{
/**
* VALLABH KADAM [03/JUL/15] Req Id:- [D15DSUN004] Before
* Check record exist in table 'PORD_PAY_TERM' for
* current purchase order and REL_AGNST = '05',06.
* */
sql = "SELECT COUNT(*) AS CNT FROM PORD_PAY_TERM WHERE PURC_ORDER=? AND REL_AGNST IN ('05','06')";
pstmt3 = conn.prepareStatement(sql);
pstmt3.setString(1, purcOrder);
rs3 = pstmt3.executeQuery();
if (rs3.next())
{
cnt3 = rs3.getLong("CNT");
}
System.out.println("@V@ Line No count from pord_pay_term :- ["+cnt3+"]");
if (cnt3 > 0)
{
/**
* From table 'PORD_PAY_TERM'
* select all line_no
* for current purchase_order and Rel_agnst ='05','06'
* VALLABH KADAM [03/JUL/15] Req Id:- [D15DSUN004] Before
* Check record exist in table 'PORD_PAY_TERM' for
* current purchase order and REL_AGNST = '05',06.
* */
sql = "SELECT LINE_NO FROM PORD_PAY_TERM WHERE PURC_ORDER=? AND REL_AGNST IN ('05','06')";
pstmt4 = conn.prepareStatement(sql);
pstmt4.setString(1, purcOrder);
rs4 = pstmt4.executeQuery();
while (rs4.next())
sql = "SELECT COUNT(*) AS CNT FROM PORD_PAY_TERM WHERE PURC_ORDER=? AND REL_AGNST IN ('05','06')";
pstmt3 = conn.prepareStatement(sql);
pstmt3.setString(1, purcOrder);
rs3 = pstmt3.executeQuery();
if (rs3.next())
{
System.out.println("@V@ Line No :- ["+rs4.getString("LINE_NO")+"]");
cnt3 = rs3.getLong("CNT");
}
System.out.println("@V@ Line No count from pord_pay_term :- ["+cnt3+"]");
if (cnt3 > 0)
{
/**
* For every line_no of purchase order
* check task_status count
* from table 'PUR_MILSTN'
* From table 'PORD_PAY_TERM'
* select all line_no
* for current purchase_order and Rel_agnst ='05','06'
* */
sql = "SELECT COUNT(*) AS CNT FROM PUR_MILSTN WHERE PURC_ORDER=? AND LINE_NO__ORD=? AND TASK_STATUS ='C'";
pstmt5 = conn.prepareStatement(sql);
pstmt5.setString(1, purcOrder);
pstmt5.setString(2, rs4.getString("LINE_NO"));
rs5 = pstmt5.executeQuery();
if (rs5.next())
sql = "SELECT LINE_NO FROM PORD_PAY_TERM WHERE PURC_ORDER=? AND REL_AGNST IN ('05','06')";
pstmt4 = conn.prepareStatement(sql);
pstmt4.setString(1, purcOrder);
rs4 = pstmt4.executeQuery();
while (rs4.next())
{
cnt4=rs5.getInt("CNT");
}
pstmt5.close();
pstmt5 = null;
rs5.close();
rs5 = null;
if(cnt4<=0)
System.out.println("@V@ Line No :- ["+rs4.getString("LINE_NO")+"]");
/**
* For every line_no of purchase order
* check task_status count
* from table 'PUR_MILSTN'
* */
sql = "SELECT COUNT(*) AS CNT FROM PUR_MILSTN WHERE PURC_ORDER=? AND LINE_NO__ORD=? AND TASK_STATUS ='C'";
pstmt5 = conn.prepareStatement(sql);
pstmt5.setString(1, purcOrder);
pstmt5.setString(2, rs4.getString("LINE_NO"));
rs5 = pstmt5.executeQuery();
if (rs5.next())
{
cnt4=rs5.getInt("CNT");
}
pstmt5.close();
pstmt5 = null;
rs5.close();
rs5 = null;
if(cnt4<=0)
{
testFlag=true;
break;
}
}
if (testFlag)
{
testFlag=true;
break;
}
}
if (testFlag)
{
System.out.println("@V@ Mileston Are pending for purchase order :- [" + purcOrder + "]");
voucher_error="DONOT-CREATE-VOUCHER";
retString="";
}
pstmt4.close();
pstmt4 = null;
rs4.close();
rs4 = null;
}
pstmt3.close();
pstmt3 = null;
rs3.close();
rs3 = null;
/**
* VALLABH KADAM [03/JUL/15] Req Id:- [D15DSUN004]
*
* END
* */
}
System.out.println("@V@ Mileston Are pending for purchase order :- [" + purcOrder + "]");
voucher_error="DONOT-CREATE-VOUCHER";
retString="";
}
pstmt4.close();
pstmt4 = null;
rs4.close();
rs4 = null;
}
pstmt3.close();
pstmt3 = null;
rs3.close();
rs3 = null;
/**
* VALLABH KADAM [03/JUL/15] Req Id:- [D15DSUN004]
*
* END
* */
}
System.out.println("@V@ Before Voucher Error :- ["+voucher_error+"]");
if (retString != null && "CREATE-VOUCHER".equals(retString.trim()) && !("DONOT-CREATE-VOUCHER".equalsIgnoreCase(voucher_error)))
{
CreatePoRcpVoucher createVouc = new CreatePoRcpVoucher();
......@@ -1375,7 +1375,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
* .println(">>>>>>>>Add to lckGroup for supplier:"+lckGroup); }
* //Added by Sagar M. on 06/05/14 end
*/// comment by sagar on 24/07/14
// added by sagar on 24/07/14
// added by sagar on 24/07/14
lockGroup = "";
sql = "select lock_group from itemmnfr where item_code= ? ";
pstmt1 = conn.prepareStatement(sql);
......@@ -2040,10 +2040,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
errString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -2140,21 +2140,18 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
if (pocomp == true)
{
chgDate = new java.sql.Timestamp(System.currentTimeMillis());
sql = "update porder Set status = 'C' , status_date = ? Where purc_order = ?";
sql = "update porder Set status = 'C' Where purc_order = ?";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setTimestamp(1, chgDate); // update current date on status close by cpatil on 25/01/16
pstmtUpd.setString(2, purcOrder);
pstmtUpd.setString(1, purcOrder);
updCnt = pstmtUpd.executeUpdate();
System.out.println("in update");
if (updCnt != 1)
{
errString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -2203,21 +2200,21 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (!"O".equals(formStatus))
{
errString = itmDBAccessLocal.getErrorString("", "VTCT3FORM2", "");// CT3
// Form
// has
// been
// closed/cancelled/expired.
// Form
// has
// been
// closed/cancelled/expired.
break;
} else if (ct3Quantity - qtyUsed < quantity)
{
errString = itmDBAccessLocal.getErrorString("", "VTCT3QTY", "");// Quantity
// exceeds
// the
// balance
// quantity
// of
// CT3
// Form
// exceeds
// the
// balance
// quantity
// of
// CT3
// Form
break;
} else
{
......@@ -2231,10 +2228,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
errString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -2282,13 +2279,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs1.close();
rs1 = null;
errString = itmDBAccessLocal.getErrorString("", "VTB17ERR1", ""); // Active
// B17
// Bond
// Not
// Found
// for
// the
// Site
// B17
// Bond
// Not
// Found
// for
// the
// Site
break;
}
pstmt1.close();
......@@ -2299,8 +2296,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (bankGuarantee < (bondValue - bondTaxAmount) || (bondValue - bondTaxAmount) < 0)
{
errString = itmDBAccessLocal.getErrorString("", "VTB17ERR2", ""); // Insufficient
// Bond
// Balance
// Bond
// Balance
break;
} else
{
......@@ -2313,10 +2310,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
errString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -2324,7 +2321,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
} // bondTaxGroup
} // EOU and !dutyPaid
// Added end by Jasmina-28/11/08- EO89SUN002
// Added end by Jasmina-28/11/08- EO89SUN002
} // end of details
pstmt.close();
pstmt = null;
......@@ -2903,11 +2900,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.setString(2, tranId);
// pstmtUpd.setString(3, lineNo);
pstmtUpd.setInt(3, Integer.parseInt(lineNo.trim()));// change
// done
// by
// kunal
// on
// 6/11/12
// done
// by
// kunal
// on
// 6/11/12
updCnt = pstmtUpd.executeUpdate();
if (updCnt != 1)
{
......@@ -3016,21 +3013,21 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
String dbName = "", useSuppLot = "", qcOrdType = "";
String suppCode = "", suppCodeMnfr = "";// added by Kunal on 8/11/12
String apprLocLogic = "", apprLocUdf = "", qcLotLocCode = "";// added by
// chandrashekar
// on
// 07-01-15
// chandrashekar
// on
// 07-01-15
double qty = 0.0;
double qtySample = 0.0, qtySampleSiteItem = 0;
double passedQty = 0.0;
double qcLeadTime = 0.0;
double convQty = 0.0;
double quantity = 0.0, excessShortQty = 0.0, quantityStduom = 0.0; // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
double netWeight = 0.0, noArt = 0.0;// added by chandrashekar 0n
// 31-12-2014
// 31-12-2014
java.sql.Timestamp expiryDate = null;
java.sql.Timestamp qcDueDate = null;
java.sql.Timestamp retestDt = null;
......@@ -3109,8 +3106,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
purcorder = checkNull(rs.getString("PURC_ORDER"));
tranDate = rs.getTimestamp("TRAN_DATE");
suppCode = checkNull(rs.getString("SUPP_CODE")); // added by
// Kunal on
// 8/11/12
// Kunal on
// 8/11/12
}
pstmtSql.close();
pstmtSql = null;
......@@ -3160,7 +3157,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtSql.close();
pstmtSql = null;
}
jobWorkType = distCommon.getDisparams("999999", "JOBWORK_TYPE", conn);
if (jobWorkType == null)
{
......@@ -3220,8 +3217,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if ("Y".equalsIgnoreCase(qcReqd))
{
sql = "SELECT ITEM_CODE, MIN(LINE_NO) AS LINE_NO FROM PORCPDET WHERE PORCPDET.TRAN_ID = ? GROUP BY ITEM_CODE "; // ORDER
// BY
// MIN(LINE_NO)";
// BY
// MIN(LINE_NO)";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, tranId);
rs = pstmtSql.executeQuery();
......@@ -3258,11 +3255,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
qcReqdSite = checkNull(rs1.getString("QC_REQD"));
procMth = checkNull(rs1.getString("PROC_MTH"));
qcType = checkNull(rs1.getString("QC_REQD_TYPE")); // added
// by
// Kunal
// Mandhre
// on
// 29/10/12
// by
// Kunal
// Mandhre
// on
// 29/10/12
qtySampleSiteItem = rs1.getDouble("QTY_SAMPLE");
} else
{
......@@ -3279,7 +3276,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
qcType = checkNull(rs1.getString("QC_REQD_TYPE"));
qtySample = rs1.getDouble("QTY_SAMPLE");
procMth = checkNull(rs1.getString("PROC_MTH"));
}
}
}
rs1.close();
rs1 = null;
......@@ -3289,8 +3286,6 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
{
qtySample = qtySampleSiteItem;
}
if (itemSer == null || itemSer.trim().length() == 0)
{
sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_CODE = ?";
......@@ -3306,27 +3301,6 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmt1.close();
pstmt1 = null;
}
/* Added By Dhiraj R chavan on 7/MAR/2016*/
if(qcReqdSite==null || qcReqdSite.trim().length()==0)
{
System.out.println("####qcReqdSite"+qcReqdSite);
//sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_CODE = ?";
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code=?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
qcReqdSite =checkNull(rs1.getString("qc_reqd"));
}
rs1.close();
rs1 = null;
pstmt1.close();
}
System.out.println(">>>qcReqdSite Dj: = " + qcReqdSite);
/* Ended By Dhiraj R chavan on 7/MAR/2016*/
if (procMth != null && procMth.trim().length() > 0)
{
......@@ -3334,14 +3308,14 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
if (qcType == null || qcType.trim().length() == 0) // change
// done
// by
// Kunal
// on
// 26/10/12
// add
// trim()
// cond.
// done
// by
// Kunal
// on
// 26/10/12
// add
// trim()
// cond.
{
qcType = "S";
}
......@@ -3358,7 +3332,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// kunal
// on
// 5/11/12
+ " FROM PORCPDET WHERE TRAN_ID = ? AND ITEM_CODE = ? ORDER BY LINE_NO ASC";
+ " FROM PORCPDET WHERE TRAN_ID = ? AND ITEM_CODE = ? ORDER BY LINE_NO ASC";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
pstmt1.setString(2, itemCode);
......@@ -3382,15 +3356,15 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 start as per Pravin
// Sali Sir instruction
excessShortQty = rs1.getDouble("EXCESS_SHORT_QTY"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
quantityStduom = rs1.getDouble("quantity__stduom"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
System.out.println("excessShortQt =" + excessShortQty);
System.out.println("quantityStduom =" + quantityStduom);
if (excessShortQty == 0)
......@@ -3401,10 +3375,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 end as per Pravin Sali
// Sir instruction
suppCodeMnfr = checkNull(rs1.getString("supp_code__mnfr"));// added
// by
// Kunal
// on
// 8/11/12
// by
// Kunal
// on
// 8/11/12
System.out.println("suppCodeMnfr = " + suppCodeMnfr);
// if ( "Q".equalsIgnoreCase(value) ||
......@@ -3471,10 +3445,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// xmlValues = xmlValues +
// "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";// added
// by
// sagar
// on
// 10/07/14
// by
// sagar
// on
// 10/07/14
xmlValues = xmlValues + "<lot_no>" + lotNoRcp + "</lot_no>";
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
......@@ -3512,8 +3486,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs2 = null;
if (!"Y".equals(useSuppLot)) // Condition added
// by sagar on
// 11/07/14
// by sagar on
// 11/07/14
{
System.out.println(">>>>>>>in S & Y if useSuppLot is not Y:" + useSuppLot);
if ("Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto))
......@@ -3575,8 +3549,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(1, qcNo);
// pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType);// added by
// sagar on
// 10/07/14
// sagar on
// 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -3612,24 +3586,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setTimestamp(35, mfgDate);
pstmtInsert.setString(36, emp);
pstmtInsert.setString(37, suppCode); // added by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
pstmtInsert.setString(38, suppCodeMnfr);// added
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
updCnt = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......@@ -3675,41 +3649,41 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
System.out.println(">>>>>>>In L And Y <<<<<<<<<<=" + qcReqdSite);
sql = "SELECT (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) AS BATCH_NO, " + " LOC_CODE, UNIT__STD, " + " CASE WHEN (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " + " (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " + " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) IS NULL " + " THEN 0 ELSE (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " + " ( CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " // bug
// fixing
// done
// by
// kunal
// on
// 29/10/12
// add
// bracket
+ " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) END)) IS NULL THEN 0" + " ELSE (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " + " (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " + " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) IS NULL THEN " + " 0 ELSE ( ((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " // bug
// fixing
// done
// by
// kunal
// on
// 29/10/12
// add
// bracket
+ " (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " + " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END))END)) END, " + " MIN(LINE_NO), MFG_DATE ,LOT_NO, " + " ( CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " sum(case when excess_short_qty is null then 0 else excess_short_qty end) as excess_short_qty ,sum((case when quantity__stduom is null then 0 else quantity__stduom end)) as quantity__stduom,supp_code__mnfr " // added
// by
// kunal
// on
// 5/11/12
+ " ,(case when no_art is null then 0 else no_art end) as no_art," // stary
// added
// by
// chandrashekar
// on
// 06-01-2015
+ "(case when net_weight is null then 0 else net_weight end) as net_weight"// stary
// added
// by
// chandrashekar
// on
// 06-01-2015
+ " ,expiry_date " + " FROM PORCPDET WHERE TRAN_ID = ? " + " AND ITEM_CODE = ? " + " GROUP BY (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END), " + " LOC_CODE, UNIT__STD, (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " MFG_DATE ,expiry_date,LOT_NO,supp_code__mnfr,no_art,net_weight " + " ORDER BY MIN(LINE_NO) ASC ";
// fixing
// done
// by
// kunal
// on
// 29/10/12
// add
// bracket
+ " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) END)) IS NULL THEN 0" + " ELSE (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " + " (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " + " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) IS NULL THEN " + " 0 ELSE ( ((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + " // bug
// fixing
// done
// by
// kunal
// on
// 29/10/12
// add
// bracket
+ " (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * " + " (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END))END)) END, " + " MIN(LINE_NO), MFG_DATE ,LOT_NO, " + " ( CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " sum(case when excess_short_qty is null then 0 else excess_short_qty end) as excess_short_qty ,sum((case when quantity__stduom is null then 0 else quantity__stduom end)) as quantity__stduom,supp_code__mnfr " // added
// by
// kunal
// on
// 5/11/12
+ " ,(case when no_art is null then 0 else no_art end) as no_art," // stary
// added
// by
// chandrashekar
// on
// 06-01-2015
+ "(case when net_weight is null then 0 else net_weight end) as net_weight"// stary
// added
// by
// chandrashekar
// on
// 06-01-2015
+ " ,expiry_date " + " FROM PORCPDET WHERE TRAN_ID = ? " + " AND ITEM_CODE = ? " + " GROUP BY (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END), " + " LOC_CODE, UNIT__STD, (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " MFG_DATE ,expiry_date,LOT_NO,supp_code__mnfr,no_art,net_weight " + " ORDER BY MIN(LINE_NO) ASC ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
pstmt1.setString(2, itemCode);
......@@ -3728,15 +3702,15 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 start as per Pravin
// Sali Sir instruction
excessShortQty = rs1.getDouble("excess_short_qty"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
quantityStduom = rs1.getDouble("quantity__stduom"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
expiryDate = rs1.getTimestamp("expiry_date");
System.out.println("excessShortQt =" + excessShortQty);
System.out.println("quantityStduom =" + quantityStduom);
......@@ -3748,17 +3722,17 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 end as per Pravin Sali
// Sir instruction
suppCodeMnfr = rs1.getString("supp_code__mnfr");// added
// by
// Kunal
// on
// 8/11/12
// by
// Kunal
// on
// 8/11/12
System.out.println("suppCodeMnfr = " + suppCodeMnfr);
sql = "SELECT PURC_ORDER, LINE_NO__ORD"
// +
// ", EXPIRY_DATE , LOT_SL , LINE_NO, MFG_DATE"//Changed
// by manoj td 21/01/2015
+ " FROM PORCPDET WHERE TRAN_ID = ? AND ITEM_CODE = ? AND LOC_CODE = ? AND (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ?";
// +
// ", EXPIRY_DATE , LOT_SL , LINE_NO, MFG_DATE"//Changed
// by manoj td 21/01/2015
+ " FROM PORCPDET WHERE TRAN_ID = ? AND ITEM_CODE = ? AND LOC_CODE = ? AND (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, tranId);
pstmt2.setString(2, itemCode);
......@@ -3806,10 +3780,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// xmlValues = xmlValues +
// "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";// added
// by
// sagar
// on
// 10/07/14
// by
// sagar
// on
// 10/07/14
xmlValues = xmlValues + "<lot_no>" + lotNoRcp + "</lot_no>";
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
......@@ -3848,8 +3822,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs2 = null;
if (!"Y".equals(useSuppLot)) // Condition added
// by sagar on
// 11/07/14
// by sagar on
// 11/07/14
{
System.out.println(">>>>>>>in L & Y if useSuppLot is not Y:" + useSuppLot);
if ("Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto))
......@@ -3925,20 +3899,20 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
sql = "INSERT INTO QC_ORDER( QORDER_NO, QORDER_TYPE, QORDER_DATE, SITE_CODE ,ITEM_CODE, ROUTE_CODE, QUANTITY, QTY_PASSED ," + " QTY_REJECTED , START_DATE , DUE_DATE , PORCP_NO , LOT_NO, LOT_SL , CHG_DATE , CHG_USER, CHG_TERM ," + " LOC_CODE, QTY_SAMPLE, STATUS, UNIT, QC_CREATE_TYPE , BATCH_NO, EXPIRY_DATE, " + " LOC_CODE__APRV , LOC_CODE__REJ , UNIT__SAMPLE, LOT_NO__NEW , RETEST_DATE , EMP_CODE__QCAPRV, " + " SPEC_REF, ITEM_CODE__NEW , MFG_DATE, EMP_CODE,SUPP_CODE,SUPP_CODE__MFG ) " + " VALUES( ?,?,?,?,?,?,?,? ,? ," // bug
// fixing
// done
// by
// kunal
// on
// 29/10/12
+ " ?,?,?,?,?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?,?,?,? )";
// fixing
// done
// by
// kunal
// on
// 29/10/12
+ " ?,?,?,?,?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?,?,?,? )";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qcNo);
// pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType); // added by
// sagar
// on
// 10/07/14
// sagar
// on
// 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -3958,9 +3932,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(13, lotNoRcp);
// pstmtInsert.setString(15, lotSl);
pstmtInsert.setString(14, null);// start added
// by
// chandrashekar
// on 12-12-14
// by
// chandrashekar
// on 12-12-14
pstmtInsert.setTimestamp(15, tranDate);
pstmtInsert.setString(16, userId);
pstmtInsert.setString(17, termId);
......@@ -3982,24 +3956,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setTimestamp(33, mfgDate);
pstmtInsert.setString(34, emp);
pstmtInsert.setString(35, suppCode); // added by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
pstmtInsert.setString(36, suppCodeMnfr);// added
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
updCnt = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......@@ -4131,13 +4105,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
updCnt = pstmtUpd.executeUpdate();
// if ( updCnt != 1 )
if (updCnt == 0)// Condition Added by
// Sagar on 20/OCT/14
// Sagar on 20/OCT/14
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -4169,14 +4143,14 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
updCnt = pstmtUpd.executeUpdate();
// if ( updCnt != 1 )
if (updCnt == 0)// Condition Added
// by Sagar on
// 20/OCT/14
// by Sagar on
// 20/OCT/14
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -4213,15 +4187,15 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 start as per Pravin
// Sali Sir instruction
excessShortQty = rs1.getDouble("excess_short_qty"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
quantityStduom = rs1.getDouble("quantity__stduom"); // added
// by
// Kunal
// on
// 5/11/12
// by
// Kunal
// on
// 5/11/12
if (excessShortQty == 0)
{
System.out.println("qty get from qty stduom");
......@@ -4230,10 +4204,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// added by kunal on 5/11/12 end as per Pravin Sali
// Sir instruction
suppCodeMnfr = checkNull(rs1.getString("supp_code__mnfr"));// added
// by
// Kunal
// on
// 8/11/12
// by
// Kunal
// on
// 8/11/12
System.out.println("suppCodeMnfr = " + suppCodeMnfr);
// tranDate = getCurrdateAppFormat();
xmlValues = "";
......@@ -4246,10 +4220,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// xmlValues = xmlValues +
// "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";// added
// by
// sagar
// on
// 10/07/14
// by
// sagar
// on
// 10/07/14
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
xmlValues = xmlValues + "</Detail1></Root>";
......@@ -4358,8 +4332,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(1, qcNo);
// pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType);// added by
// sagar on
// 10/07/14
// sagar on
// 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -4394,24 +4368,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(33, itemCode);
pstmtInsert.setString(34, emp);
pstmtInsert.setString(35, suppCode); // added by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
pstmtInsert.setString(36, suppCodeMnfr);// added
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
// by
// Kunal
// on
// 8/11/12
// as
// per
// Pravin
// Sali
// intruction
updCnt = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......@@ -4454,8 +4428,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if ("Y".equalsIgnoreCase(genLotAuto))
{
lotNoManualSite = distCommon.getDisparams("999999", "LOT_NO_MANUAL_SITE", conn); // Gulzar
// -
// 25/11/11
// -
// 25/11/11
siteString = lotNoManualSite;
// 10/09/13 manoharan in case there is no comma
String siteArray[];
......@@ -4500,10 +4474,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// xmlValues = xmlValues +
// "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";// added
// by
// sagar
// on
// 10/07/14
// by
// sagar
// on
// 10/07/14
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
xmlValues = xmlValues + "<porcp_line_no>" + lineNo + "</porcp_line_no>";
......@@ -4522,7 +4496,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
sql = "UPDATE PORCPDET SET LOT_NO = ? WHERE TRAN_ID = ? AND ITEM_CODE = ? AND (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ? AND LOC_CODE = ? AND (LOT_NO IS NULL OR LENGTH(TRIM(LOT_NO)) = 0)";
pstmtUpd = conn.prepareStatement(sql);
if ("Y".equals(useSuppLot)) // condition added by
// sagar on 18/07/14
// sagar on 18/07/14
{
pstmtUpd.setString(1, lotNoRcp);
} else
......@@ -4536,13 +4510,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
updCnt = pstmtUpd.executeUpdate();
// if ( updCnt != 1 )
if (updCnt == 0)// Condition Added by Sagar on
// 20/OCT/14
// 20/OCT/14
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
if (pstmtUpd != null)
{
......@@ -4901,10 +4875,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs.close();
rs = null;
if (distOrder == null || distOrder.trim().length() == 0) // added
// by
// kunal
// on
// 09/july/14
// by
// kunal
// on
// 09/july/14
{
retString = itmDBAccessLocal.getErrorString("", "VTPORCP01", "");
return retString;
......@@ -4956,8 +4930,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
lnoPoRcpDet = checkNull(rs.getString("LINE_NO"));
System.out.println("before trim lnoPoRcpDet----" + lnoPoRcpDet);
if (lnoPoRcpDet.length() > 0)// Added By Manoj dtd
// 02/10/2013 to trim
// line_no
// 02/10/2013 to trim
// line_no
{
lnoPoRcpDet = lnoPoRcpDet.trim();
}
......@@ -4983,25 +4957,25 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
innerHashMap.put("unitOrd", unitTemp);
innerHashMap.put("lnnoPoRcpDet", lnoPoRcpDet);
innerHashMap.put("poRcpdetlotSL", rs.getString("LOT_SL"));// Added
// by
// manoj
// dtd
// 25/09/2013
// to
// set
// lotSL
// from
// porcpdet
// by
// manoj
// dtd
// 25/09/2013
// to
// set
// lotSL
// from
// porcpdet
innerHashMap.put("poRcpdetlocCode", rs.getString("LOC_CODE"));// Added
// by
// manoj
// dtd
// 27/10/2014
// to
// set
// locCode
// from
// porcpdet
// by
// manoj
// dtd
// 27/10/2014
// to
// set
// locCode
// from
// porcpdet
outerHashMap.put(lnoPoRcpDet, innerHashMap);
......@@ -5112,13 +5086,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
if (acctGl != null && acctGl.trim().length() == 0)// change
// done
// by
// kunal
// on
// 21/may/14
// handle
// null
// done
// by
// kunal
// on
// 21/may/14
// handle
// null
{
acctGl = null;
}
......@@ -5186,12 +5160,12 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtRbHdr.setString(18, cctrGl);
sql = "select lot_no__passign,exp_date__passign FROM porddet where purc_order = ? and line_no = ? ";// manoj
// dtd
// 03/10/2013
// Removed
// trim
// from
// line_no
// dtd
// 03/10/2013
// Removed
// trim
// from
// line_no
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, purcOrderTemp);
pstmt1.setString(2, lnoOrdTemp);
......@@ -5675,14 +5649,14 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtRbHdr.setDouble(23, 0.0);
pstmtRbHdr.setDouble(24, 0.0);
pstmtRbHdr.setString(25, ((outerHashMap.get(entry.getKey())).get("purcOrderDet")));// Added
// by
// Manoj
// dtd
// 25/09/2013
// to
// store
// porder
// no.
// by
// Manoj
// dtd
// 25/09/2013
// to
// store
// porder
// no.
pstmtRbHdr.setString(26, tranId);
pstmtRbHdr.addBatch();
pstmtRbHdr.clearParameters();
......@@ -5721,10 +5695,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
generatedTranId = (String) rcbTranIdList.get(backflushId);
System.out.println("generatedTranId--[" + generatedTranId + "]");
retString = rcpBackflushConf.confirmRcpBackflush(generatedTranId, xtraParams, "", conn, false);// change
// on
// 22/may/14
// handle
// connection
// on
// 22/may/14
// handle
// connection
System.out.println("retString 4953::" + retString);
}
}
......@@ -5917,7 +5891,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
linePoRcpDet = checkNull(rs.getString("LINE_NO"));
if (linePoRcpDet.length() > 0)// Added By Kunal on 3/oct/13
// to trim line_no
// to trim line_no
{
linePoRcpDet = linePoRcpDet.trim();
}
......@@ -6007,12 +5981,12 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs1 = null;
sql = "SELECT ITEM_CODE__ORD, QUANTITY, EXP_LEV , QTY_ALLOC FROM SORDITEM WHERE SALE_ORDER = ? AND LINE_NO= ? AND LINE_TYPE = 'I'";// Manoj
// dtd
// 03/10/2013
// removed
// trim
// from
// line_no
// dtd
// 03/10/2013
// removed
// trim
// from
// line_no
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder);
pstmt1.setString(2, lineNoSord);
......@@ -6271,10 +6245,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -6312,10 +6286,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -6379,10 +6353,10 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
if (updCnt != 1)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");// Added
// by
// chandrashekar
// on
// 17-sep-2014
// by
// chandrashekar
// on
// 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
......@@ -7520,6 +7494,18 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, serviceCode);
......@@ -7529,6 +7515,18 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = " + serviceURI + " compName = " + compName);
// 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;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -7568,6 +7566,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*
* if( conn != null ){ conn.close(); conn = null; }
*/
......
......@@ -874,6 +874,18 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
{
try
{
//Changed by Manish on 1-04-2016 to close prepared statement [START]
if(pstmtStock != null)
{
pstmtStock.close();
pstmtStock = null;
}
if(rsStock != null)
{
rsStock.close();
rsStock = null;
}
//Changed by Manish on 1-04-2016 to close prepared statement [END]
//added by chitranjan connStatus if connstatus is true then commit.
if( !isError && connStatus )
{
......@@ -3521,7 +3533,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
lineNo++;
sql = " Insert into qc_order_lots (QC_ORDER,LINE_NO,ITEM_CODE,LOT_NO,LOT_SL,LOC_CODE,QUANTITY," +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT) " +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT,LOC_CODE) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qorderNo);
......@@ -3530,7 +3542,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(4, lotNo);
pstmtInsert.setString(5, lotSl);
// pstmtInsert.setString(6, locationCode);
pstmtInsert.setString(6, locCode);
pstmtInsert.setString(6, qcLotLocCode);
quantity = getUnroundDecimal(quantity, 3);
pstmtInsert.setDouble(7, quantity);
pstmtInsert.setString(8, unit);
......@@ -3540,7 +3552,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(12, qorderNo);
pstmtInsert.setDouble(13, noArt);
pstmtInsert.setDouble(14, netWeight);
// pstmtInsert.setString(15, locCode);
pstmtInsert.setString(15, locCode);
updCnt1 = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......
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