Commit 3004bdfa authored by manohar's avatar manohar

connection closing related changes in various components


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91080 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7b303039
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.utility.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.utility.*;
......@@ -688,7 +688,7 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
custCode = genericUtility.getColumnValue("cust_code",dom1);
tranId = genericUtility.getColumnValue("tran_id",dom1);
//System.out.println( "siteCode:" + siteCode +"custCode:"+custCode+"columnValue:"+columnValue);
String itemValSql = " select count(1) cnt from item where item_code = ? ";
String itemValSql = "select count(1) cnt from item where item_code = ? ";
int itemCount = 0;
stmt = conn.prepareStatement( itemValSql );
stmt.setString( 1, columnValue );
......@@ -946,6 +946,21 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
errString = getErrorString("item_ser","SYSERR",userId);//,null,conn);
throw new ITMException(e);
}
finally
{
try
{
if(conn!=null)
{
conn = null;
}
}catch(Exception d)
{
d.printStackTrace();
throw new ITMException( d );
}
//System.out.println("[SOrderForm] CONNECTION is CLOSED");
}
//System.out.println( "*****errString********::" + errString );
return errString == null ? "" : errString ;
}
......@@ -2251,7 +2266,7 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
//genericUtility.serializeDom( dom );
//genericUtility.serializeDom( dom1 );
//genericUtility.serializeDom( dom2 );
System.out.println( "This is the changed jar at 08/04/09 2:09 pm" );
DecimalFormat df = new DecimalFormat();
df.applyPattern("##.00");
......@@ -2335,11 +2350,36 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
}
else if (stockMode.trim().equals("C") || stockMode.trim().equals("A") )
{
clStks = genericUtility.getColumnValue("cl_stock",dom );//, formNo);//, domID);
if (opStock == null || opStock.equalsIgnoreCase( "null" ) || opStock.trim().length() == 0 )
{
opStock = "0";
}
if (purReceipt == null || purReceipt.equalsIgnoreCase( "null" ) || purReceipt.trim().length() == 0 )
{
purReceipt = "0";
}
if (transitQtyStr == null || transitQtyStr.equalsIgnoreCase( "null" ) || transitQtyStr.trim().length() == 0 )
{
transitQtyStr = "0";
}
if (clStks == null || clStks.equalsIgnoreCase( "null" ) || clStks.trim().length() == 0 )
{
clStks = "0";
}
if (adjQty == null || adjQty.equalsIgnoreCase( "null" ) || adjQty.trim().length() == 0 )
{
adjQty = "0";
}
if (purReturn == null || purReturn.equalsIgnoreCase( "null" ) || purReturn.trim().length() == 0 )
{
purReturn = "0";
}
if (adhocReplQty == null || adhocReplQty.equalsIgnoreCase( "null" ) || adhocReplQty.trim().length() == 0 )
{
adhocReplQty = "0";
}
saless = Double.parseDouble( opStock )
+ Double.parseDouble( purReceipt )
- Double.parseDouble( transitQtyStr )
......@@ -2432,6 +2472,21 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn!=null)
{
conn = null;
}
}catch(Exception d)
{
d.printStackTrace();
throw new ITMException( d );
}
//System.out.println("[SOrderForm] CONNECTION is CLOSED");
}
//System.out.println( "Alam valueXmlString :: " + valueXmlString.toString() );
return valueXmlString.toString();
}//itemChanged(Document,String) method ends here */
......@@ -2462,6 +2517,12 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
if (rs != null)
{
rs.close();
rs = null;
}
if (stmt != null)
{
stmt.close();
stmt = null;
}
////Uncommet by Daynand on 25/08/07 []
......@@ -2494,9 +2555,15 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
retRate = rs.getFloat(1);
//System.out.println("retRate [" +retRate+ "]");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (stmt != null)
{
stmt.close();
stmt = null;
}
}
catch(Exception e)
......@@ -2505,6 +2572,22 @@ public class CustStockItem extends ValidatorEJB //implements SessionBean
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn!=null)
{
conn.close();
conn = null;
}
}catch(Exception d)
{
d.printStackTrace();
throw new ITMException( d );
}
//System.out.println("[SOrderForm] CONNECTION is CLOSED");
}
//System.out.println("[CustStockEJB]rate :"+retRate);
return retRate;
////System.out.println("returning value from getRate as 1");
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.util.*;
......@@ -43,12 +43,10 @@ public class CustStockPos extends ValidatorEJB //implements SessionBean
{
return "";
}
public String postSave(String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException
{
return postSave(tranId, "A", xtraParams, conn, "");
}
public String postSave(String tranId, String editFlag, String xtraParams, Connection conn, String domString) throws RemoteException,ITMException
//public String postSave(String winName,String editFlag,String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException
public String postSave(String tranId, String editFlag, String xtraParams, Connection conn) throws RemoteException,ITMException
{
String retString = "";
boolean isError = false;
......@@ -65,6 +63,7 @@ public class CustStockPos extends ValidatorEJB //implements SessionBean
conn = connDriver.getConnectDB("DriverValidator");
isLocalConn = true;
conn.setAutoCommit( false );
connDriver = null;
}
int totOpValue = 0;
int totPurValue = 0;
......@@ -114,7 +113,7 @@ public class CustStockPos extends ValidatorEJB //implements SessionBean
{
try
{
conn.commit();
//conn.commit();
System.out.println("isError ["+isError+"]");
System.out.println("isLocalConn ["+isLocalConn+"]");
if( conn != null )
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......@@ -15,6 +15,8 @@ import javax.ejb.Local; //added for ejb3
public interface CustStockPosLocal extends ValidatorLocal//, EJBObject
{
public String postSave()throws RemoteException,ITMException;
public String postSave(String tranId,String editFlag, String xtraParams, Connection conn, String domString) throws RemoteException,ITMException;
public String postSave(String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException;
//public String postSave(String tranId,String editFlag, String domString, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String postSave(String winName,String editFlag,String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String postSave(String tranid, String editFlag, String xtraParams, Connection conn) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......@@ -14,6 +14,7 @@ import javax.ejb.Remote; // added for ejb3
public interface CustStockPosRemote extends ValidatorRemote//, EJBObject
{
public String postSave()throws RemoteException,ITMException;
public String postSave(String tranId,String editFlag, String xtraParams, Connection conn, String domString) throws RemoteException,ITMException;
public String postSave(String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException;
//public String postSave(String tranId,String editFlag, String domString, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String postSave(String winName,String editFlag,String tranId, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String postSave(String tranid, String editFlag, String xtraParams, Connection conn) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.utility.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
package ibase.webitm.ejb.custstock;
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
......
......@@ -22,24 +22,24 @@ public class DistCommon
GenericUtility genericUtility = GenericUtility.getInstance();
public String setPlistTaxClassEnv(String siteCodeFrom,String siteCodeTo,String itemCode,String tranType,String itemSer,String caseString,Connection conn)throws ITMException
{
System.out.println("--------------[setPlistTaxClassEnv]---------------------------------");
System.out.println("DP[siteCodeto/SiteCodeFrom/itemCode/tranType/itemSer/caseString/conn]");
if(siteCodeFrom!=null)
System.out.println("Siite Code From:-["+siteCodeFrom+"]");
if(siteCodeTo!=null)
System.out.println("Site Code To:-["+siteCodeTo+"]");
if(itemCode!=null)
System.out.println("Item Code:-["+itemCode+"]");
if(tranType!=null)
System.out.println("TranType:-["+tranType+"]");
if(caseString!=null)
System.out.println("Case String:-["+caseString+"]");
if(itemSer!=null)
System.out.println("Item Ser:-["+itemSer+"]");
if(conn!=null)
System.out.println("Connection Found["+conn+"]");
System.out.println("-----------------------------------------------");
//System.out.println("--------------[setPlistTaxClassEnv]---------------------------------");
//System.out.println("DP[siteCodeto/SiteCodeFrom/itemCode/tranType/itemSer/caseString/conn]");
//if(siteCodeFrom!=null)
//System.out.println("Siite Code From:-["+siteCodeFrom+"]");
//if(siteCodeTo!=null)
//System.out.println("Site Code To:-["+siteCodeTo+"]");
//if(itemCode!=null)
//System.out.println("Item Code:-["+itemCode+"]");
//if(tranType!=null)
//System.out.println("TranType:-["+tranType+"]");
//if(caseString!=null)
//System.out.println("Case String:-["+caseString+"]");
//if(itemSer!=null)
//System.out.println("Item Ser:-["+itemSer+"]");
//if(conn!=null)
//System.out.println("Connection Found["+conn+"]");
//System.out.println("-----------------------------------------------");
String sql = "";
String sql2 = "";
......@@ -79,7 +79,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList1 :-["+priceList+"]");
//System.out.println("PriceList1 :-["+priceList+"]");
flag=1;
}
if((flag==0) || (priceList == null))
......@@ -102,7 +102,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList2 :-["+priceList+"]");
//System.out.println("PriceList2 :-["+priceList+"]");
flag=1;
}
if((flag==0) || (priceList == null)) //if 2
......@@ -125,7 +125,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList3 :-["+priceList+"]");
//System.out.println("PriceList3 :-["+priceList+"]");
flag=1;
}
if((flag==0) || (priceList == null)) //if 3
......@@ -147,7 +147,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList4 :-["+priceList+"]");
//System.out.println("PriceList4 :-["+priceList+"]");
flag=1;
}
......@@ -170,7 +170,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList5 :-["+priceList+"]");
//System.out.println("PriceList5 :-["+priceList+"]");
}
if((flag==0) || (priceList == null)) //if 5
{
......@@ -184,7 +184,7 @@ public class DistCommon
if(rs.next())
{
priceList = rs.getString(1);
System.out.println("PriceList6 :-["+priceList+"]");
//System.out.println("PriceList6 :-["+priceList+"]");
}//if
stmt.close();
stmt = null;
......@@ -211,8 +211,8 @@ public class DistCommon
{
priceList = getDisparams("999999","DEFAULT_PRICE",conn);
}
System.out.println("Returning the priceList From Dist Common------->");
System.out.println("************** ["+priceList+"]**************");
//System.out.println("Returning the priceList From Dist Common------->");
//System.out.println("************** ["+priceList+"]**************");
returnVlaue = priceList;
}//if(caseString.equals("PRICE_LIST"))
......@@ -239,7 +239,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG1:-["+priceListCLG+"]");
//System.out.println("PriceListCLG1:-["+priceListCLG+"]");
flag=1;
}
......@@ -266,7 +266,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG2:-["+priceListCLG+"]");
//System.out.println("PriceListCLG2:-["+priceListCLG+"]");
flag=1;
}
if((flag==0) || (priceListCLG == null)) //if 2
......@@ -290,7 +290,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG3:-["+priceListCLG+"]");
//System.out.println("PriceListCLG3:-["+priceListCLG+"]");
flag=1;
}
if((flag==0) || (priceListCLG == null)) //if 3
......@@ -312,7 +312,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG4:-["+priceListCLG+"]");
//System.out.println("PriceListCLG4:-["+priceListCLG+"]");
flag=1;
}
if((flag==0) || (priceListCLG == null)) //if 4
......@@ -334,7 +334,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG5:-["+priceListCLG+"]");
//System.out.println("PriceListCLG5:-["+priceListCLG+"]");
flag=1;
}
if((flag==0) || (priceListCLG == null)) //if 5
......@@ -348,7 +348,7 @@ public class DistCommon
if(rs.next())
{
priceListCLG = rs.getString(1);
System.out.println("PriceListCLG6:-["+priceListCLG+"]");
//System.out.println("PriceListCLG6:-["+priceListCLG+"]");
flag=1;
}//if
stmt.close();
......@@ -377,8 +377,8 @@ public class DistCommon
{
priceListCLG = getDisparams("999999","PRICE_LIST__CLG",conn);
}
System.out.println("Returning the priceListCLG From Dist Common------->");
System.out.println("************** ["+priceListCLG+"]**************");
//System.out.println("Returning the priceListCLG From Dist Common------->");
//System.out.println("************** ["+priceListCLG+"]**************");
returnVlaue = priceListCLG;
}//else if(caseString.equals("PRICE_LIST__CLG"))
......@@ -434,7 +434,7 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass 2............."+taxClass);
//System.out.println("taxClass 2............."+taxClass);
flag =1 ;
}
if((flag ==0) || (taxClass == null)) //if 2
......@@ -464,7 +464,7 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass 3............."+taxClass);
//System.out.println("taxClass 3............."+taxClass);
flag =1;
}
if((flag ==0) || (taxClass == null)) //if 3
......@@ -487,7 +487,7 @@ public class DistCommon
if(rs2.next())
{
itemSer = rs2.getString(1);
System.out.println("itemSer 1............."+itemSer);
//System.out.println("itemSer 1............."+itemSer);
}
rs2.close();
if((itemSer == null) || (itemSer.trim().length() == 0)) //if 2
......@@ -502,7 +502,7 @@ public class DistCommon
if(rs2.next())
{
itemSer = rs2.getString(1);
System.out.println("itemSer 2............."+itemSer);
//System.out.println("itemSer 2............."+itemSer);
}
}
catch(Exception ex)
......@@ -536,7 +536,7 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass ............."+taxClass);
//System.out.println("taxClass ............."+taxClass);
flag = 0;
}
......@@ -545,7 +545,7 @@ public class DistCommon
flag = 0;
rs.close();
System.out.println("Inside else if 4 Class");
//System.out.println("Inside else if 4 Class");
taxClass = "";
try
{//try 5
......@@ -566,7 +566,7 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass 4............."+taxClass);
//System.out.println("taxClass 4............."+taxClass);
flag =1;
}
......@@ -574,7 +574,7 @@ public class DistCommon
{
flag=0;
rs.close();
System.out.println("Inside else if 5 Class");
//System.out.println("Inside else if 5 Class");
taxClass = "";
try
{//try 6
......@@ -594,14 +594,14 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass 5............."+taxClass);
//System.out.println("taxClass 5............."+taxClass);
flag = 1;
}
if((flag==0) || (taxClass == null)) //if 6
{
flag = 0;
rs.close();
System.out.println("Inside else if 6 Class");
//System.out.println("Inside else if 6 Class");
taxClass = "";
try
{//try 7
......@@ -612,7 +612,7 @@ public class DistCommon
if(rs.next())
{
taxClass = rs.getString(1);
System.out.println("taxClass 6............."+taxClass);
//System.out.println("taxClass 6............."+taxClass);
}//if
stmt.close();
stmt = null;
......@@ -677,8 +677,8 @@ public class DistCommon
throw new ITMException(ex);
}
if(taxClass==null)taxClass= " " ;
System.out.println("Returning the taxClass From Dist Common------->");
System.out.println("************** ["+taxClass+"]**************");
//System.out.println("Returning the taxClass From Dist Common------->");
//System.out.println("************** ["+taxClass+"]**************");
returnVlaue = taxClass;
}//else if(caseString.equals("TAX_CLASS"))
......@@ -713,7 +713,7 @@ public class DistCommon
flag= 0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 1 Env");
//System.out.println("Inside else if 1 Env");
sql = "SELECT TAX_ENV FROM ITEM_ACCT_DETR_DIST "
+ "WHERE SITE_CODE__FROM = ? "
+ "AND SITE_CODE__TO = ? "
......@@ -739,7 +739,7 @@ public class DistCommon
flag= 0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 2 Env");
//System.out.println("Inside else if 2 Env");
sql = "SELECT TAX_ENV FROM ITEM_ACCT_DETR_DIST "
+ "WHERE SITE_CODE__FROM = ? "
+ "AND SITE_CODE__TO = ? "
......@@ -764,7 +764,7 @@ public class DistCommon
flag =0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 3 Env");
//System.out.println("Inside else if 3 Env");
try
{//try 4b
itemSer = "";
......@@ -775,12 +775,12 @@ public class DistCommon
if(rs2.next())
{
itemSer = rs2.getString(1);
System.out.println("itemSer 1 in env............."+itemSer);
//System.out.println("itemSer 1 in env............."+itemSer);
}
rs2.close();
if((itemSer == null) || (itemSer.trim().length() == 0)) //if 2
{
System.out.println("Inside else if ...Env ");
//System.out.println("Inside else if ...Env ");
itemSer = "";
try
{
......@@ -790,13 +790,13 @@ public class DistCommon
if(rs2.next())
{
itemSer = rs2.getString(1);
System.out.println("itemSer 2 env............."+itemSer);
//System.out.println("itemSer 2 env............."+itemSer);
}
rs2.close();
}
catch(Exception ex)
{
System.out.println("Exception []::"+ sql2 +ex.getMessage());
//System.out.println("Exception []::"+ sql2 +ex.getMessage());
ex.printStackTrace();
}
}// if 2
......@@ -805,7 +805,7 @@ public class DistCommon
}//try 4b
catch(Exception ex)
{
System.out.println("Exception []::"+ sql2 +ex.getMessage());
//System.out.println("Exception []::"+ sql2 +ex.getMessage());
ex.printStackTrace();
}
sql = "SELECT TAX_ENV FROM ITEM_ACCT_DETR_DIST "
......@@ -825,7 +825,7 @@ public class DistCommon
if(rs.next())
{
taxEnv = rs.getString(1);
System.out.println("taxEnv ............."+taxEnv);
//System.out.println("taxEnv ............."+taxEnv);
flag=1;
}
if((flag==0) || (taxClass == null)) // if 4
......@@ -833,7 +833,7 @@ public class DistCommon
flag=0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 4 Env");
//System.out.println("Inside else if 4 Env");
sql = "SELECT TAX_ENV FROM ITEM_ACCT_DETR_DIST "
+ "WHERE SITE_CODE__FROM = ? "
+ "AND SITE_CODE__TO = ? "
......@@ -858,7 +858,7 @@ public class DistCommon
flag=0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 5 Env");
//System.out.println("Inside else if 5 Env");
sql = "SELECT TAX_ENV FROM ITEM_ACCT_DETR_DIST "
+ "WHERE SITE_CODE__FROM = ? "
+ "AND SITE_CODE__TO = ? "
......@@ -882,7 +882,7 @@ public class DistCommon
flag=0;
rs.close();
taxEnv = "";
System.out.println("Inside else if 6 Env");
//System.out.println("Inside else if 6 Env");
sql = "SELECT TAX_ENV FROM DISTORDER_TYPE "
+ "WHERE TRAN_TYPE = '"+tranType+"'";
stmt = conn.createStatement();
......@@ -890,7 +890,7 @@ public class DistCommon
if(rs.next())
{
taxEnv = rs.getString(1);
System.out.println("taxEnv ............."+taxEnv);
//System.out.println("taxEnv ............."+taxEnv);
}//if
rs.close();
stmt.close();
......@@ -918,8 +918,8 @@ public class DistCommon
throw new ITMException(ex);
}
if(taxEnv==null)taxEnv= " " ;
System.out.println("Returning the taxEnv From Dist Common------->");
System.out.println("************** ["+taxEnv+"]**************");
//System.out.println("Returning the taxEnv From Dist Common------->");
//System.out.println("************** ["+taxEnv+"]**************");
returnVlaue = taxEnv;
}//else if(caseString.equals("TAX_ENV"))
return returnVlaue;
......@@ -934,7 +934,7 @@ public class DistCommon
Statement stmt = null;
try
{
System.out.println("Finding the variable value from Disparam for parameters["+prdCode+","+varName+"]");
//System.out.println("Finding the variable value from Disparam for parameters["+prdCode+","+varName+"]");
stmt = conn.createStatement();
sql="SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE ='"+prdCode+"' AND VAR_NAME ='"+varName+"'";
rs =stmt.executeQuery(sql);
......@@ -966,7 +966,7 @@ public class DistCommon
sql = "SELECT LIST_TYPE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"'";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
System.out.println("LIST_TYPE... sql..."+sql);
//System.out.println("LIST_TYPE... sql..."+sql);
//25052007
if (rs.next())
{
......@@ -974,7 +974,7 @@ public class DistCommon
}
rs.close();
stmt.close();
System.out.println("listType...................."+listType);
//System.out.println("listType...................."+listType);
}
catch(Exception e)
{
......@@ -988,21 +988,21 @@ public class DistCommon
public double pickRate(String priceList,String trDate,String itemCode,String aLotNo,String listType,Connection conn)throws ITMException
{
System.out.println("--------------[pickRate]---------------------------------");
System.out.println("DP[priceList/trDate/itemCode/tranType/aLotNo/listType/conn]");
if(priceList!=null)
System.out.println("Price List:-["+priceList+"]");
if(trDate!=null)
System.out.println("Tran Date:-["+trDate+"]");
if(itemCode!=null)
System.out.println("Item Code:-["+itemCode+"]");
if(aLotNo!=null)
System.out.println("Lot No:-["+aLotNo+"]");
if(listType!=null)
System.out.println("List Type:-["+listType+"]");
if(conn!=null)
System.out.println("Connection Found["+conn+"]");
System.out.println("-----------------------------------------------");
//System.out.println("--------------[pickRate]---------------------------------");
//System.out.println("DP[priceList/trDate/itemCode/tranType/aLotNo/listType/conn]");
//if(priceList!=null)
//System.out.println("Price List:-["+priceList+"]");
//if(trDate!=null)
//System.out.println("Tran Date:-["+trDate+"]");
//if(itemCode!=null)
//System.out.println("Item Code:-["+itemCode+"]");
//if(aLotNo!=null)
//System.out.println("Lot No:-["+aLotNo+"]");
//if(listType!=null)
//System.out.println("List Type:-["+listType+"]");
//if(conn!=null)
//System.out.println("Connection Found["+conn+"]");
//System.out.println("-----------------------------------------------");
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -1019,22 +1019,22 @@ public class DistCommon
double rate = 0.0;
type = getPriceListType(priceList,conn);
System.out.println("List Type From Price List:::["+type+"]");
//System.out.println("List Type From Price List:::["+type+"]");
try
{
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
System.out.println("Date in pickRate...."+tranDate);
//System.out.println("Date in pickRate...."+tranDate);
// 25052007
if(type.equalsIgnoreCase("I"))
{
if (aLotNo.indexOf("~t") > 0)
{
String MulStr[] = aLotNo.split("~t");
System.out.println("First String ["+MulStr[0]+"]");
System.out.println("Second String ["+MulStr[1]+"]");
System.out.println("Third String ["+MulStr[2]+"]");
System.out.println("Four String ["+MulStr[3]+"]");
//System.out.println("First String ["+MulStr[0]+"]");
//System.out.println("Second String ["+MulStr[1]+"]");
//System.out.println("Third String ["+MulStr[2]+"]");
//System.out.println("Four String ["+MulStr[3]+"]");
/* siteCode = getTokenList(aLotNo,"~t");
locCode = getTokenList(aLotNo,"~t");
lotNo = getTokenList(aLotNo,"~t");
......@@ -1044,16 +1044,16 @@ public class DistCommon
lotNo = MulStr[2];
lotSl = MulStr[3];
System.out.println("siteCode..**..*>"+siteCode);
System.out.println("locCode..**..*>"+locCode);
System.out.println("lotNo..**..*>"+lotNo);
System.out.println("lotSl..**..*>"+lotSl);
//System.out.println("siteCode..**..*>"+siteCode);
//System.out.println("locCode..**..*>"+locCode);
//System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotSl..**..*>"+lotSl);
}
}
else
{
lotNo = aLotNo;
System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotNo..**..*>"+lotNo);
}
}//try
catch(Exception e)
......@@ -1065,7 +1065,7 @@ public class DistCommon
if(type.trim().equals("L"))
{
rate = 0;
System.out.println("Inside type ::-<L>-::");
//System.out.println("Inside type ::-<L>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -1078,11 +1078,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -1098,13 +1098,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -1121,11 +1121,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -1162,7 +1162,7 @@ public class DistCommon
}//if(type.trim().equals("L"))
if(type.trim().equals("F"))
{
System.out.println("Inside type ::-<F>-::");
//System.out.println("Inside type ::-<F>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -1175,11 +1175,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
System.out.println("The rate for type (F) is.... "+rate);
//System.out.println("The rate for type (F) is.... "+rate);
}
else
{
......@@ -1195,13 +1195,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -1218,11 +1218,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -1260,7 +1260,7 @@ public class DistCommon
if(type.trim().equals("D")) //DISPATCH
{
rate = 0;
System.out.println("Inside type ::-<D>-::");
//System.out.println("Inside type ::-<D>-::");
//First selecting rate from pricelist for L,if not found
//picking up from batch
try
......@@ -1278,7 +1278,7 @@ public class DistCommon
if(rs.next())
{
rate = rs.getDouble(1);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{//else if 1
......@@ -1294,13 +1294,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)//1
......@@ -1320,7 +1320,7 @@ public class DistCommon
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{//else if 2
......@@ -1343,7 +1343,7 @@ public class DistCommon
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent for <D> is ..."+rate);
//System.out.println("The rate inside priceListParent for <D> is ..."+rate);
}
else
{//else if 3
......@@ -1359,13 +1359,13 @@ public class DistCommon
while (rs2.next())
{
priceListParent = rs2.getString(1);
System.out.println("The priceListParent for <D> is .... "+priceListParent);
//System.out.println("The priceListParent for <D> is .... "+priceListParent);
}
rs2.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)//2
......@@ -1384,11 +1384,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs3 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs3.next())
{
rate = rs3.getDouble(1);
System.out.println("The rate inside priceListParent for <D> is ..."+rate);
//System.out.println("The rate inside priceListParent for <D> is ..."+rate);
}
else
{
......@@ -1470,7 +1470,7 @@ public class DistCommon
if(rs.next())
{
rate = rs.getDouble(1);
System.out.println("The rate inside priceListParent for <B> is ..."+rate);
//System.out.println("The rate inside priceListParent for <B> is ..."+rate);
}
else
{
......@@ -1486,14 +1486,14 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent for <B> is .... "+priceListParent);
//System.out.println("The priceListParent for <B> is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -1512,11 +1512,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent for <B> is ..."+rate);
//System.out.println("The rate inside priceListParent for <B> is ..."+rate);
}
else
{
......@@ -1552,7 +1552,7 @@ public class DistCommon
if((type.trim().equals("M")) || (type.trim().equals("N"))) // Discount PRICE
{
rate = 0;
System.out.println("Inside type ::-<M><N>-::");
//System.out.println("Inside type ::-<M><N>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -1565,11 +1565,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
System.out.println("The rate for type (F) is.... "+rate);
//System.out.println("The rate for type (F) is.... "+rate);
}
else
{
......@@ -1584,13 +1584,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -1608,11 +1608,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -1652,7 +1652,7 @@ public class DistCommon
rate = 0;
if ((lotSl == null) || (lotSl.trim().length() == 0))
{
System.out.println("Inside type ::-<I>-::");
//System.out.println("Inside type ::-<I>-::");
try
{//try 1
sql = "SELECT RATE FROM STOCK "
......@@ -1665,7 +1665,7 @@ public class DistCommon
while (rs.next())
{
rate = rs.getDouble(1);
System.out.println("Rate is .*...."+rate);
//System.out.println("Rate is .*...."+rate);
}
rs.close();
}//try
......@@ -1691,7 +1691,7 @@ public class DistCommon
if (rs.next())
{
rate = rs.getDouble(1);
System.out.println("Rate is .*...."+rate);
//System.out.println("Rate is .*...."+rate);
}
rs.close();
}//try
......@@ -1703,7 +1703,7 @@ public class DistCommon
}
}//else
}//if(type.trim().equals("I")) //Inventory
System.out.println("Rate From DisCommon***:::::["+rate+"]");
//System.out.println("Rate From DisCommon***:::::["+rate+"]");
return(rate);
}//pickRate()
......@@ -1729,24 +1729,24 @@ public class DistCommon
}//getTokenList()
public double pickRate(String priceList,String trDate,String itemCode,String aLotNo,String listType,double quantity,String aunit,Connection conn)throws ITMException
{
System.out.println("--------------[pickRate]---------------------------------");
System.out.println("DP[priceList/trDate/itemCode/tranType/aLotNo/listType/quantity/unit/conn]");
if(priceList!=null)
System.out.println("Price List:-["+priceList+"]");
if(trDate!=null)
System.out.println("Tran Date:-["+trDate+"]");
if(itemCode!=null)
System.out.println("Item Code:-["+itemCode+"]");
if(aLotNo!=null)
System.out.println("Lot No:-["+aLotNo+"]");
if(listType!=null)
System.out.println("List Type:-["+listType+"]");
System.out.println("Quantity:-["+quantity+"]");
if(aunit!=null)
System.out.println("Unit:-["+aunit+"]");
if(conn!=null)
System.out.println("Connection Found["+conn+"]");
System.out.println("-----------------------------------------------");
//System.out.println("--------------[pickRate]---------------------------------");
//System.out.println("DP[priceList/trDate/itemCode/tranType/aLotNo/listType/quantity/unit/conn]");
//if(priceList!=null)
//System.out.println("Price List:-["+priceList+"]");
//if(trDate!=null)
//System.out.println("Tran Date:-["+trDate+"]");
//if(itemCode!=null)
//System.out.println("Item Code:-["+itemCode+"]");
//if(aLotNo!=null)
//System.out.println("Lot No:-["+aLotNo+"]");
//if(listType!=null)
//System.out.println("List Type:-["+listType+"]");
//System.out.println("Quantity:-["+quantity+"]");
//if(aunit!=null)
//System.out.println("Unit:-["+aunit+"]");
//if(conn!=null)
//System.out.println("Connection Found["+conn+"]");
//System.out.println("-----------------------------------------------");
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
......@@ -1771,16 +1771,16 @@ public class DistCommon
{
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
System.out.println("Date in pickRate...."+tranDate);
//System.out.println("Date in pickRate...."+tranDate);
if (aLotNo.indexOf("~t") > 0)
{
String sepStr[] = aLotNo.split("~t");
System.out.println(sepStr[0]);
System.out.println(sepStr[1]);
System.out.println(sepStr[2]);
System.out.println(sepStr[3]);
//System.out.println(sepStr[0]);
//System.out.println(sepStr[1]);
//System.out.println(sepStr[2]);
//System.out.println(sepStr[3]);
siteCode =sepStr[0];
locCode =sepStr[1];
......@@ -1791,17 +1791,17 @@ public class DistCommon
locCode = getTokenList(aLotNo,"~t");
lotNo = getTokenList(aLotNo,"~t");
lotSl = getTokenList(aLotNo,"~t");*/
System.out.println("Separated String :---------------------->");
//System.out.println("Separated String :---------------------->");
System.out.println("siteCode..**..*>"+siteCode);
System.out.println("locCode..**..*>"+locCode);
System.out.println("lotNo..**..*>"+lotNo);
System.out.println("lotSl..**..*>"+lotSl);
//System.out.println("siteCode..**..*>"+siteCode);
//System.out.println("locCode..**..*>"+locCode);
//System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotSl..**..*>"+lotSl);
}
else
{
lotNo = aLotNo;
System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotNo..**..*>"+lotNo);
}
}//try
catch(Exception e)
......@@ -1840,7 +1840,7 @@ public class DistCommon
if(type.trim().equals("L")) //LIST PRICE
{
rate = 0;
System.out.println("Inside type ::-<L>-::");
//System.out.println("Inside type ::-<L>-::");
try
{//try 1
sql = "SELECT RATE,UNIT FROM PRICELIST "
......@@ -1856,12 +1856,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -1884,7 +1884,7 @@ public class DistCommon
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
if(!rs.next())
......@@ -1900,13 +1900,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -1926,12 +1926,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -1950,12 +1950,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2010,7 +2010,7 @@ public class DistCommon
if(type.trim().equals("F")) //FIXED PRICE ON DATE
{
rate = 0;
System.out.println("Inside type ::-<F>-::");
//System.out.println("Inside type ::-<F>-::");
try
{//try 1
sql = "SELECT RATE,UNIT FROM PRICELIST "
......@@ -2026,12 +2026,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -2054,7 +2054,7 @@ public class DistCommon
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (F) is.... "+rate);
//System.out.println("The rate for type (F) is.... "+rate);
}
if(!(rs.next()) || (unit == null))
{
......@@ -2075,7 +2075,7 @@ public class DistCommon
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2095,12 +2095,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2119,12 +2119,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
while(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
if(!rs2.next())
{
......@@ -2195,12 +2195,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -2223,7 +2223,7 @@ public class DistCommon
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -2238,13 +2238,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2264,12 +2264,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2288,12 +2288,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2336,12 +2336,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs3 = pstmt.executeQuery();
System.out.println("Sql .. "+sql);
//System.out.println("Sql .. "+sql);
if(rs3.next())
{
rate = rs3.getDouble(1);
unit = rs3.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2362,12 +2362,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs3 = pstmt.executeQuery();
System.out.println("Sql .. "+sql);
//System.out.println("Sql .. "+sql);
if(rs3.next())
{
rate = rs3.getDouble(1);
unit = rs3.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2382,12 +2382,12 @@ public class DistCommon
while (rs3.next())
{
priceListParent = rs3.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2409,12 +2409,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs4 = pstmt.executeQuery();
System.out.println("Sql .. "+sql);
//System.out.println("Sql .. "+sql);
if(rs4.next())
{
rate = rs4.getDouble(1);
unit = rs4.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2435,12 +2435,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs4 = pstmt.executeQuery();
System.out.println("Sql .. "+sql);
//System.out.println("Sql .. "+sql);
if(rs4.next())
{
rate = rs4.getDouble(1);
unit = rs4.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2539,12 +2539,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (B) is.... "+rate);
//System.out.println("The rate for type (B) is.... "+rate);
}
else
{
......@@ -2569,7 +2569,7 @@ public class DistCommon
{
rate = rs.getDouble(1);
unit = rs.getString(2);
System.out.println("The rate for type (L) is.... "+rate);
//System.out.println("The rate for type (L) is.... "+rate);
}
else
{
......@@ -2584,12 +2584,12 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2611,12 +2611,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2637,12 +2637,12 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
unit = rs2.getString(2);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -2700,7 +2700,7 @@ public class DistCommon
rate = convQtyFactor(aunit,unit,itemCode,conv,conn);
}
}
System.out.println("Rate From DisCommon***:::::["+rate+"]");
//System.out.println("Rate From DisCommon***:::::["+rate+"]");
return(rate);
}//pickRate()
......@@ -2730,22 +2730,22 @@ public class DistCommon
{
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
System.out.println("Date in pickRate...."+tranDate);
//System.out.println("Date in pickRate...."+tranDate);
if (aLotNo.indexOf("~t") > 0)
{
siteCode = getTokenList(aLotNo,"~t");
locCode = getTokenList(aLotNo,"~t");
lotNo = getTokenList(aLotNo,"~t");
lotSl = getTokenList(aLotNo,"~t");
System.out.println("siteCode..**..*>"+siteCode);
System.out.println("locCode..**..*>"+locCode);
System.out.println("lotNo..**..*>"+lotNo);
System.out.println("lotSl..**..*>"+lotSl);
//System.out.println("siteCode..**..*>"+siteCode);
//System.out.println("locCode..**..*>"+locCode);
//System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotSl..**..*>"+lotSl);
}
else
{
lotNo = aLotNo;
System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotNo..**..*>"+lotNo);
}
}//try
catch(Exception e)
......@@ -2757,7 +2757,7 @@ public class DistCommon
if(type.trim().equals("L")) //LIST PRICE
{
rate = 0;
System.out.println("Inside type ::-<L>-::");
//System.out.println("Inside type ::-<L>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -2772,7 +2772,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -2794,7 +2794,7 @@ public class DistCommon
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2813,7 +2813,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -2868,7 +2868,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -2892,7 +2892,7 @@ public class DistCommon
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -2911,7 +2911,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -2966,7 +2966,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3007,7 +3007,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3050,12 +3050,12 @@ public class DistCommon
while (rs2.next())
{
priceListParent = rs2.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3076,7 +3076,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs3 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs3.next())
{
rate = rs3.getDouble(1);
......@@ -3175,13 +3175,13 @@ public class DistCommon
while (rs2.next())
{
priceListParent = rs2.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs2.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3202,7 +3202,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3244,7 +3244,7 @@ public class DistCommon
if((type.trim().equals("M")) || (type.trim().equals("N"))) // Discount PRICE
{
rate = 0;
System.out.println("Inside type ::-<M><N>-::");
//System.out.println("Inside type ::-<M><N>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -3259,7 +3259,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3278,13 +3278,13 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
rs.close();
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3304,11 +3304,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -3348,7 +3348,7 @@ public class DistCommon
rate = 0;
if ((lotSl == null) || (lotSl.trim().length() == 0))
{
System.out.println("Inside type ::-<I>-::");
//System.out.println("Inside type ::-<I>-::");
try
{//try 1
sql = "SELECT RATE FROM STOCK "
......@@ -3361,7 +3361,7 @@ public class DistCommon
while (rs.next())
{
rate = rs.getDouble(1);
System.out.println("Rate is .*...."+rate);
//System.out.println("Rate is .*...."+rate);
}
rs.close();
}//try
......@@ -3399,7 +3399,7 @@ public class DistCommon
}
}//else
}//if(type.trim().equals("I")) //Inventory
System.out.println("Rate From DisCommon***:::::["+rate+"]");
//System.out.println("Rate From DisCommon***:::::["+rate+"]");
return(rate);
}//pickRate()
......@@ -3427,22 +3427,22 @@ public class DistCommon
{
trDate = genericUtility.getValidDateString(trDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(trDate + " 00:00:00");
System.out.println("Date in pickRate...."+tranDate);
//System.out.println("Date in pickRate...."+tranDate);
if (aLotNo.indexOf("~t") > 0)
{
siteCode = getTokenList(aLotNo,"~t");
locCode = getTokenList(aLotNo,"~t");
lotNo = getTokenList(aLotNo,"~t");
lotSl = getTokenList(aLotNo,"~t");
System.out.println("siteCode..**..*>"+siteCode);
System.out.println("locCode..**..*>"+locCode);
System.out.println("lotNo..**..*>"+lotNo);
System.out.println("lotSl..**..*>"+lotSl);
//System.out.println("siteCode..**..*>"+siteCode);
//System.out.println("locCode..**..*>"+locCode);
//System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotSl..**..*>"+lotSl);
}
else
{
lotNo = aLotNo;
System.out.println("lotNo..**..*>"+lotNo);
//System.out.println("lotNo..**..*>"+lotNo);
}
}//try
catch(Exception e)
......@@ -3457,7 +3457,7 @@ public class DistCommon
if(type.trim().equals("L")) //LIST PRICE
{
rate = 0;
System.out.println("Inside type ::-<L>-::");
//System.out.println("Inside type ::-<L>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -3472,7 +3472,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3493,7 +3493,7 @@ public class DistCommon
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3512,7 +3512,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3566,7 +3566,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3588,7 +3588,7 @@ public class DistCommon
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3607,7 +3607,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3661,7 +3661,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3701,7 +3701,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3741,12 +3741,12 @@ public class DistCommon
while (rs2.next())
{
priceListParent = rs2.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3767,7 +3767,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs3 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs3.next())
{
rate = rs3.getDouble(1);
......@@ -3863,12 +3863,12 @@ public class DistCommon
while (rs2.next())
{
priceListParent = rs2.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3889,7 +3889,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
......@@ -3930,7 +3930,7 @@ public class DistCommon
if((type.trim().equals("M")) || (type.trim().equals("N"))) // Discount PRICE
{
rate = 0;
System.out.println("Inside type ::-<M><N>-::");
//System.out.println("Inside type ::-<M><N>-::");
try
{//try 1
sql = "SELECT RATE FROM PRICELIST "
......@@ -3945,7 +3945,7 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs = pstmt.executeQuery();
System.out.println("Rate sql ..."+sql);
//System.out.println("Rate sql ..."+sql);
if(rs.next())
{
rate = rs.getDouble(1);
......@@ -3963,12 +3963,12 @@ public class DistCommon
while (rs.next())
{
priceListParent = rs.getString(1);
System.out.println("The priceListParent is .... "+priceListParent);
//System.out.println("The priceListParent is .... "+priceListParent);
}
if((priceListParent == null) || (priceListParent.trim().length() == 0))
{
priceListParent = "";
System.out.println("The priceListParent if null .... "+priceListParent);
//System.out.println("The priceListParent if null .... "+priceListParent);
return -1;
}
if(priceListParent.trim().length() > 0)
......@@ -3988,11 +3988,11 @@ public class DistCommon
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
rs2 = pstmt.executeQuery();
System.out.println("The priceListParent sql .. "+sql);
//System.out.println("The priceListParent sql .. "+sql);
if(rs2.next())
{
rate = rs2.getDouble(1);
System.out.println("The rate inside priceListParent is ..."+rate);
//System.out.println("The rate inside priceListParent is ..."+rate);
}
else
{
......@@ -4031,7 +4031,7 @@ public class DistCommon
rate = 0;
if ((lotSl == null) || (lotSl.trim().length() == 0))
{
System.out.println("Inside type ::-<I>-::");
//System.out.println("Inside type ::-<I>-::");
try
{//try 1
sql = "SELECT RATE FROM STOCK "
......@@ -4044,7 +4044,7 @@ public class DistCommon
while (rs.next())
{
rate = rs.getDouble(1);
System.out.println("Rate is .*...."+rate);
//System.out.println("Rate is .*...."+rate);
}
}//try
catch(Exception e)
......@@ -4069,7 +4069,7 @@ public class DistCommon
if (rs.next())
{
rate = rs.getDouble(1);
System.out.println("Rate is .*...."+rate);
//System.out.println("Rate is .*...."+rate);
}
}//try
catch(Exception e)
......@@ -4113,7 +4113,7 @@ public class DistCommon
if(rs.next())
{
count = rs.getInt("COUNT");
System.out.println("Count........1 "+count);
//System.out.println("Count........1 "+count);
}
pstmt.close();
}//try
......@@ -4138,7 +4138,7 @@ public class DistCommon
if(rs.next())
{
count = rs.getInt("COUNT");
System.out.println("Count........2 "+count);
//System.out.println("Count........2 "+count);
}
pstmt.close();
pstmt = null;
......@@ -4170,7 +4170,7 @@ public class DistCommon
fact = rs.getDouble(1);
round = rs.getString(2);
roundTo = rs.getDouble(3);
System.out.println("fact........"+fact);
//System.out.println("fact........"+fact);
}
pstmt.close();
pstmt = null;
......@@ -4201,7 +4201,7 @@ public class DistCommon
fact = rs.getDouble(1);
round = rs.getString(2);
roundTo = rs.getDouble(3);
System.out.println("fact........"+fact);
//System.out.println("fact........"+fact);
}
pstmt.close();
pstmt = null;
......@@ -4620,7 +4620,7 @@ public class DistCommon
if(rs.next())
{
count = rs.getInt("COUNT");
System.out.println("Count........1 "+count);
//System.out.println("Count........1 "+count);
}
pstmt.close();
}//try
......@@ -4645,7 +4645,7 @@ public class DistCommon
if(rs.next())
{
count = rs.getInt("COUNT");
System.out.println("Count........2 "+count);
//System.out.println("Count........2 "+count);
}
pstmt.close();
pstmt = null;
......@@ -4689,7 +4689,7 @@ public class DistCommon
fact = rs.getDouble(1);
round = rs.getString(2);
roundTo = rs.getDouble(3);
System.out.println("fact........"+fact);
//System.out.println("fact........"+fact);
}
pstmt.close();
pstmt = null;
......@@ -4720,7 +4720,7 @@ public class DistCommon
fact = rs.getDouble(1);
round = rs.getString(2);
roundTo = rs.getDouble(3);
System.out.println("fact........"+fact);
//System.out.println("fact........"+fact);
}
pstmt.close();
pstmt = null;
......@@ -4779,12 +4779,12 @@ public class DistCommon
if(rs.next())
{
intQty = rs.getDouble(1);
System.out.println("intQty........"+intQty);
//System.out.println("intQty........"+intQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(intQty == 0)
{
sql = "select integral_qty from siteitem "
......@@ -4797,10 +4797,10 @@ public class DistCommon
intQty = rs.getDouble(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(intQty==0)
{
sql="select integral_qty from item "
......@@ -4812,10 +4812,10 @@ public class DistCommon
intQty = rs.getDouble(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(intQty == 0)
{
sql="select count(*) from item where item_code = '"+itemCode+"' ";
......@@ -4826,10 +4826,10 @@ public class DistCommon
cnt = rs.getInt(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt==0)
{
sql="select batch_qty from bom "
......@@ -4841,10 +4841,10 @@ public class DistCommon
intQty = rs.getDouble(1);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
......@@ -4910,18 +4910,18 @@ public class DistCommon
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( itemSer == null || itemSer.trim().length() == 0 )
{
sql = "select item_ser from itemser_change "
+ " where ITEM_CODE = '" + itemCode + "'"
+ " and eff_date <= ?"
+ " and valid_upto >= ? or valid_upto is Null";
+ " and (( eff_date <= ?"
+ " and valid_upto >= ? ) or (valid_upto is Null))";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,tranDate);
pstmt.setTimestamp(2,tranDate);
......@@ -4929,19 +4929,19 @@ public class DistCommon
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//CHECKING ITEM SERIES AGAIN FROM ITEMSER CHANGE FOR OLD ITEM SER
if( itemSer == null || itemSer.trim().length() == 0)
{
sql = " SELECT item_ser__old FROM itemser_change "
+ " WHERE ITEM_CODE = '" + itemCode + "'"
+ " AND eff_date >= ?"
+ " AND (valid_upto >= ? or valid_upto is null)"
+ " AND (( eff_date >= ?"
+ " AND valid_upto >= ?) or (valid_upto is null ))"
+ " AND eff_date = (select min(eff_date) from itemser_change"
+ " where item_code = '" + itemCode + "')";
pstmt = conn.prepareStatement(sql);
......@@ -4951,18 +4951,18 @@ public class DistCommon
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( itemSer == null || itemSer.trim().length() == 0)
{
sql = " SELECT item_ser__old FROM itemser_change "
+ " WHERE ITEM_CODE = '" + itemCode + "'"
+ " AND eff_date >= ?"
+ " AND (valid_upto >= ? or valid_upto is null)"
+ " AND (( eff_date >= ?"
+ " AND valid_upto >= ?) or (valid_upto is null))"
+ " AND eff_date = (select min(eff_date) from itemser_change"
+ " where item_code = '" + itemCode + "')";
pstmt = conn.prepareStatement(sql);
......@@ -4972,12 +4972,12 @@ public class DistCommon
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "SELECT item_ser FROM item "
+ "WHERE ITEM_CODE = '" + itemCode + "'";
pstmt = conn.prepareStatement(sql);
......@@ -4985,12 +4985,12 @@ public class DistCommon
if(rs.next())
{
itemSer = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
......@@ -5004,12 +5004,12 @@ public class DistCommon
if(rs.next())
{
itemSerInv = rs.getString(1);
System.out.println("itemSer........"+itemSer);
//System.out.println("itemSer........"+itemSer);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( itemSerInv != null && itemSerInv.trim().length() > 0)
{
itemSer = itemSerInv;
......@@ -5044,26 +5044,26 @@ public class DistCommon
if(rs.next())
{
capacity = rs.getDouble(1);
System.out.println("capacity........"+capacity);
//System.out.println("capacity........"+capacity);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql=" select reo_qty from siteitem where site_code ='"+siteCode+"'"
+" and item_code = '" + itemCode + "'";
System.out.println("sql for retro qty:- " + sql);
//System.out.println("sql for retro qty:- " + sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(reoQty ==0.0)
{
sql="select reo_qty from item "
......@@ -5073,12 +5073,12 @@ public class DistCommon
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(capacity > 0)
shipperQty = capacity;
......@@ -5099,12 +5099,12 @@ public class DistCommon
if(rs.next())
{
capacity = rs.getDouble(1);
System.out.println("capacity........"+capacity);
//System.out.println("capacity........"+capacity);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql="select reo_qty from siteitem "
+"where site_code = '"+siteCode+"' "
......@@ -5114,12 +5114,12 @@ public class DistCommon
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( reoQty==0 )
{
sql="select reo_qty from item "
......@@ -5129,12 +5129,12 @@ public class DistCommon
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(capacity > 0)
shipperQty = capacity;
......@@ -5153,12 +5153,12 @@ public class DistCommon
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lcIntegralQty ==0)
{
sql="select integral_qty from siteitem "
......@@ -5169,12 +5169,12 @@ public class DistCommon
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lcIntegralQty==0)
{
sql="select (case when integral_qty is null then 0 else integral_qty end)"
......@@ -5184,12 +5184,12 @@ public class DistCommon
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if( lcIntegralQty>0 )
liNoArt2 = (remainder - remainder%lcIntegralQty)/lcIntegralQty ;
......@@ -5232,26 +5232,26 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
capacity = rs.getDouble(1);
System.out.println("capacity........"+capacity);
//System.out.println("capacity........"+capacity);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql=" select reo_qty from siteitem where site_code ='"+siteCode+"'"
+" and item_code = '" + itemCode + "'";
System.out.println("sql for retro qty:- " + sql);
//System.out.println("sql for retro qty:- " + sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(reoQty ==0.0)
{
sql="select reo_qty from item "
......@@ -5261,12 +5261,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(capacity > 0)
shipperQty = capacity;
......@@ -5287,12 +5287,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
capacity = rs.getDouble(1);
System.out.println("capacity........"+capacity);
//System.out.println("capacity........"+capacity);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql="select reo_qty from siteitem "
+"where site_code = '"+siteCode+"' "
......@@ -5302,12 +5302,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( reoQty==0 )
{
sql="select reo_qty from item "
......@@ -5317,12 +5317,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty........"+reoQty);
//System.out.println("reoQty........"+reoQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(capacity > 0)
shipperQty = capacity;
......@@ -5341,12 +5341,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lcIntegralQty ==0)
{
sql="select integral_qty from siteitem "
......@@ -5357,12 +5357,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lcIntegralQty==0)
{
sql="select (case when integral_qty is null then 0 else integral_qty end)"
......@@ -5372,12 +5372,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
if(rs.next())
{
lcIntegralQty = rs.getDouble(1);
System.out.println("lcIntegralQty........"+lcIntegralQty);
//System.out.println("lcIntegralQty........"+lcIntegralQty);
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if( lcIntegralQty>0 )
liNoArt2 = (remainder - remainder%lcIntegralQty)/lcIntegralQty ;
......@@ -5426,7 +5426,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
sql = "SELECT TRAN_DATE, SITE_CODE, REF_SER__FOR,REF_ID__FOR, REAS_CODE "
+" FROM STOCK_TRANSFER "
+" WHERE TRAN_ID = '"+tran_id+"' ";
System.out.println("sql......................"+sql);
//System.out.println("sql......................"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5444,7 +5444,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
sql = "select tran_id,line_no,item_code,quantity,loc_code__fr,loc_code__to,lot_no__fr, "
+ " lot_no__to, lot_sl__fr, lot_sl__to, remarks, acct_code__cr,acct_code__dr, cctr_code__dr, cctr_code__cr "
+ "from stock_transfer_det where tran_id = '"+tran_id+"' ";
System.out.println("sql............................."+sql);
//System.out.println("sql............................."+sql);
pstmt1 = conn.prepareStatement(sql);
rs1 = pstmt1.executeQuery();
while(rs1.next())
......@@ -5452,7 +5452,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
lineNo = rs1.getInt("line_no");
itemCode =rs1.getString("item_code");
effqty =rs1.getDouble("quantity");
System.out.println("effqty.................."+effqty);
//System.out.println("effqty.................."+effqty);
locCodeFrom =rs1.getString("loc_code__fr");
locCodeTo =rs1.getString("loc_code__to");
lotNo =rs1.getString("lot_no__fr");
......@@ -5473,14 +5473,14 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+ " and lot_no ='"+lotNo+"' "
+ " and lot_sl ='"+lotSl+"' "
+ " and status <> 'C' " ;
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
qcCount = rs.getInt(1);
}
System.out.println("qcCount.........................."+qcCount);
//System.out.println("qcCount.........................."+qcCount);
rs.close();
rs =null;
pstmt.close();
......@@ -5491,7 +5491,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+" where site_code = '"+siteCode+"' and loc_code ='"+locCodeFrom+"' "
+" and item_code ='"+itemCode+"' and lot_no ='"+lotNo+"' and lot_sl ='"+lotSl+"' "
+" and status <> 'C' ";
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
upd = pstmt.executeUpdate();
pstmt.close();
......@@ -5504,7 +5504,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+ " and lot_no ='"+lotNo+"' "
+ " and lot_sl is null "
+ " and status <> 'C' " ;
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5521,7 +5521,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+" where site_code = '"+siteCode+"' and loc_code ='"+locCodeFrom+"' "
+" and item_code ='"+itemCode+"' and lot_no ='"+lotNo+"' lot_sl is null "
+" and status <> 'C' ";
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
upd = pstmt.executeUpdate();
pstmt.close();
......@@ -5534,7 +5534,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+" conv__qty_stduom,batch_no, acct_code__inv,cctr_code__inv ,pack_instr,dimension, unit__alt "
+" From stock Where item_code = '"+itemCode+"' and site_code = '"+siteCode+"' And loc_code ='"+locCodeFrom+"' "
+" and lot_no = '"+lotNo+"' And lot_sl = '"+lotSl+"' " ;
System.out.println("sql............................"+sql);
//System.out.println("sql............................"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5573,14 +5573,14 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
String acctCodeIN="";
String cctrCodeIN="";
String acctDetrType = finCommon.getFromAcctDetr(itemCode,"","IN",conn) ;
System.out.println("acctDetrType.....IN........" + acctDetrType);
//System.out.println("acctDetrType.....IN........" + acctDetrType);
if (acctDetrType != null && acctDetrType.trim().length() > 0)
{
acctCodeIN = acctDetrType.substring(0,acctDetrType.indexOf(","));
cctrCodeIN = acctDetrType.substring(acctDetrType.indexOf(",")+1);
}
System.out.println("acctStr.....IN........" + acctCodeIN);
System.out.println("acctStr.....IN........" + cctrCodeIN);
//System.out.println("acctStr.....IN........" + acctCodeIN);
//System.out.println("acctStr.....IN........" + cctrCodeIN);
}
if(effqty == 0 ) continue;
if(! invLink.equalsIgnoreCase("Y"))
......@@ -5588,7 +5588,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
qtyorg = qty;
}
sql ="select overiss from invstat where inv_stat = '"+invstat+"' ";
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5601,12 +5601,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
pstmt = null;
if(effqty > qtyorg && (! overiss.equalsIgnoreCase("Y")))
{
System.out.println("overiss...1111222333......................."+overiss);
//System.out.println("overiss...1111222333......................."+overiss);
errCode = "VTOVERISS1";
return (errCode);
}
itemSer = getItemSer(itemCode, siteCode,tranDate,"","O",conn);
System.out.println("itemSer........................."+itemSer);
//System.out.println("itemSer........................."+itemSer);
if(lotNoTo == null || lotNoTo.trim().length() ==0)
{
lotNoTo =" ";
......@@ -5651,14 +5651,14 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
stkUpdMap.put("remarks",remarks);
String acctDetrType = finCommon.getAcctDetrTtype(itemCode,itemSer,"XFRX", " ",conn) ;
System.out.println("acctDetrType.....XFRX........" + acctDetrType);
//System.out.println("acctDetrType.....XFRX........" + acctDetrType);
if (acctDetrType != null && acctDetrType.trim().length() > 0)
{
acctCodeXFRX = acctDetrType.substring(0,acctDetrType.indexOf(","));
cctrCodeXFRX = acctDetrType.substring(acctDetrType.indexOf(",")+1);
}
System.out.println("acctStr.....XFRX........" + acctCodeXFRX);
System.out.println("acctStr.....XFRX........" + cctrCodeXFRX);
//System.out.println("acctStr.....XFRX........" + acctCodeXFRX);
//System.out.println("acctStr.....XFRX........" + cctrCodeXFRX);
if(cctrCodeXFRX.trim().length() > 0)
{
if ( acctCodeXFRX == null || acctCodeXFRX.trim().length() ==0)
......@@ -5716,15 +5716,16 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
stkUpdMap.put("no_art",Integer.toString(noArt));
StockUpdate stkUpd = new StockUpdate();
errString = stkUpd.updateStock(stkUpdMap,xtraParams,conn);
System.out.println("updateStock................"+errString);
//System.out.println("updateStock................"+errString);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
sql ="select inv_stat from location where loc_code = '"+locCodeTo+"' ";
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5767,10 +5768,10 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
stkUpdMap.put("ref_id__for",refIdFor);
errString = stkUpd.updateStock(stkUpdMap,xtraParams,conn);
System.out.println("updateStock................"+errString);
//System.out.println("updateStock................"+errString);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
......@@ -5795,7 +5796,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
return "";
}
sql = "select fin_entity from site where site_code= '"+ siteCode +"' ";
System.out.println("sql........................"+sql);
//System.out.println("sql........................"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5808,7 +5809,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
pstmt = null;
sql = "select curr_code from finent where fin_entity= '"+ finEntity +"' ";
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5827,7 +5828,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
+" and loc_code = '"+siteCode+"' "
+" and lot_no = '"+siteCode+"' "
+" and lot_sl = '"+siteCode+"' " ;
System.out.println("sql........"+sql);
//System.out.println("sql........"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -5859,12 +5860,12 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
errString = finCommon.glTraceUpdate(glTraceMap,conn);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
// Receipt side credit entry
acctDetrType = finCommon.getAcctDetrTtype(itemCode," ","XFRX", " ",conn) ;
System.out.println("acctDetrType.....XFRX........" + acctDetrType);
//System.out.println("acctDetrType.....XFRX........" + acctDetrType);
if (acctDetrType != null && acctDetrType.trim().length() > 0)
{
macct = acctDetrType.substring(0,acctDetrType.indexOf(","));
......@@ -5874,8 +5875,8 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
{
return "VTSTTRF";
}
System.out.println("macct.....XFRX........" + macct);
System.out.println("mcctr.....XFRX........" + mcctr);
//System.out.println("macct.....XFRX........" + macct);
//System.out.println("mcctr.....XFRX........" + mcctr);
glTraceMap.put("tran_date",tranDate);
glTraceMap.put("eff_date",tranDate);
......@@ -5895,7 +5896,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
errString = finCommon.glTraceUpdate(glTraceMap,conn);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
......@@ -5922,7 +5923,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
errString = finCommon.glTraceUpdate(glTraceMap,conn);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
......@@ -5945,7 +5946,7 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
errString = finCommon.glTraceUpdate(glTraceMap,conn);
if (errString != null && errString.trim().length() > 0 )
{
System.out.println("Returning Result "+errString);
//System.out.println("Returning Result "+errString);
return errString;
}
errString = finCommon.checkGlTranDrCr("XFRX","",conn); ///??????????????????
......@@ -5965,6 +5966,36 @@ public int getNoArt(String siteCode,String custCode,String itemCode , String pac
}
return errString;
}
public String gfCheckTaxenvStatus( String asTaxenv, java.sql.Timestamp adDate, Connection conn ) throws SQLException
{
String lsErrCode = null, lsStatus = null;
lsErrCode = "";
PreparedStatement ps = null;
java.sql.ResultSet rs = null;
String sql = "select (case when status is null then 'A' else status end) ls_status "
+" from taxenv "
+" where tax_env = '" + asTaxenv + "'"
+" and status_date <= ? ";
ps = conn.prepareStatement( sql );
ps.setDate( 1, java.sql.Date.valueOf( adDate.toString() ) );
rs = ps.executeQuery();
if( rs.next() )
{
lsStatus = rs.getString( "ls_status" );
}
if( "C".equalsIgnoreCase( lsStatus ) )
{
lsErrCode = "VTTAXENVCL";
}
return lsErrCode;
}
//added by msalam on 210308
public String gbfSetIntegralQty( String lsItemCode, String lsTranType, double lcQtyOrder, String lsSiteCode, Connection conn )
{
PreparedStatement pstmt = null;
......
......@@ -176,6 +176,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String custItemRef = null;
String strSch = null;
DistCommon distCommon = null;
distCommon = new DistCommon();
try
{
//System.out.println(".....call validate method ....");
......@@ -233,8 +234,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
var_value = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("var_value.." + var_value);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
......@@ -302,8 +303,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
//System.out.println("var_value.." + var_value);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
varValue = Integer.parseInt(var_value);
......@@ -368,8 +369,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
blackListed = rs.getString("black_listed") == null ? " " : rs.getString("black_listed");
}
//System.out.println("blackListed.." + blackListed);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( blackListed!=null && blackListed.equalsIgnoreCase("Y") )
......@@ -391,8 +392,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
stopBusiness = rs.getString("stop_business") == null ? "" : rs.getString("stop_business");
}
//System.out.println("stopBusiness.." + stopBusiness);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( stopBusiness != null && stopBusiness.equalsIgnoreCase("Y") )
......@@ -415,8 +416,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if (cnt == 0)
......@@ -450,8 +451,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1);
}
//System.out.println("cnt.." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(cnt > 0 )
......@@ -476,8 +477,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
disLink = rs.getString(2) == null ? "" : rs.getString(2);
}
//System.out.println("channelPartner.." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( channelPartner == null )
......@@ -494,8 +495,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
disLink = rs.getString(2) == null ? "" : rs.getString(2);
}
//System.out.println("channelPartner.." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -516,8 +517,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
status = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("status.." + status);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( status == null)
......@@ -563,8 +564,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1);
}
//System.out.println("var_value.." + var_value);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( cnt == 0 )
......@@ -672,6 +673,11 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
custCode = genericUtility.getColumnValue("cust_code",dom1);
//System.out.println("custCode ......"+custCode );
custPord = genericUtility.getColumnValue("cust_pord",dom);
orderTypeHdr = genericUtility.getColumnValue("order_type",dom1);
if (orderTypeHdr == null)
{
orderTypeHdr = "";
}
//System.out.println("custPord ......"+custPord );
orderDateStr = genericUtility.getValidDateString(orderDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
OrderDate = java.sql.Timestamp.valueOf(orderDateStr + " 00:00:00.00");
......@@ -685,8 +691,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1);
}
//System.out.println("cnt of item.." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( cnt == 0 )
......@@ -705,8 +711,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
itemSer = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("itemSer.." + itemSer);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
sql = "Select black_listed from customer_series where cust_code ='" + custCode + "'"
......@@ -719,15 +725,15 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
blackListed = rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(blackListed == null)
{
blackListed = "";
}
else if(blackListed.trim().length() > 0)
if(blackListed.trim().length() > 0)
{
if ( blackListed.equalsIgnoreCase("Y") )
{
......@@ -749,8 +755,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
stopBusiness = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("stopBusiness.." + stopBusiness);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( stopBusiness.equalsIgnoreCase("Y") )
......@@ -759,6 +765,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
errString = getErrorString("cust_code",errCode,userId);
break;
}
}
sql = "select channel_partner,dis_link from customer"
+ " where cust_code = ?";
//System.out.println("select channel_partner var_value.." + sql);
......@@ -771,8 +779,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
disLink = rs.getString(2) == null ? "" : rs.getString(2);
}
//System.out.println("disLink.." + disLink);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( ( disLink.equalsIgnoreCase("A") || disLink.equalsIgnoreCase("S") ) && channelPartner.equalsIgnoreCase("Y") )
......@@ -793,8 +801,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if ( cnt == 0 )
......@@ -803,6 +811,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
errString = getErrorString("item_code",errCode,userId);
break;
}
}// if( custPord != null
}//end rs = null;if( ( disLink.equalsIgnoreCase("A")
//System.out.println("itemSerHdr.." + itemSerHdr);
sql = " select oth_series "
+ " from itemser"
......@@ -815,14 +825,15 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
othSeries = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( othSeries == null)
{
othSeries = "N";
}
itemSer1 = distCommon.getItemSer(itemCode,siteCode,OrderDate,custCode,"C",conn);
sql = " select item_ser"
+ " from item_credit_perc"
+ " where item_code = ?"
......@@ -839,8 +850,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
itemSer = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( ( ! itemSer1.equalsIgnoreCase( itemSerHdr ) ) && othSeries.equalsIgnoreCase("G") )
......@@ -857,8 +868,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
itemSerCrpolicyHdr = rs.getString(1) == null ? "" : rs.getString(1);
itemSer = rs.getString(2) == null ? "" : rs.getString(2);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( itemSerCrpolicyHdr == null )
......@@ -877,8 +888,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
itemSerCrpolicy = rs.getString(1) == null ? "" : rs.getString(1);
itemSer = rs.getString(2) == null ? "" : rs.getString(2);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( itemSerCrpolicy == null )
......@@ -894,7 +905,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
else
{
if( "NE".equalsIgnoreCase( orderTypeHdr.trim() ) )
if( "NE".equalsIgnoreCase( orderTypeHdr ) )
{
sql= "select state_code from customer where cust_code = ?";
//System.out.println("select itemSerHdr var_value.." + sql);
......@@ -905,8 +916,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
stateCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
sql = " select a.scheme_code "
......@@ -930,8 +941,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
schemeCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -957,15 +968,12 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
schemeCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}//end else "NE".equalsIgnoreCase
}//end else if( ( disLink.equalsIgnoreCase("A")
}// if( custPord != null
}//end rs = null;if( ( disLink.equalsIgnoreCase("A")
}//end else lackListed.equalsIgnor
}//end item_code
else if (childNodeName.equalsIgnoreCase("item_ser"))
{
......@@ -984,8 +992,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
itemSerItem = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( itemSerHdr != null && itemSerHdr.trim().length() > 0 )
{
......@@ -1002,8 +1010,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
othSeries = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( othSeries == null)
{
......@@ -1033,8 +1041,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0 )
{
......@@ -1113,8 +1121,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
stateCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
sql = " select a.scheme_code"
+ " from scheme_applicability a, scheme_applicability_det b "
......@@ -1137,8 +1145,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
schemeCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
//System.out.println("schemeCode 1 [" + schemeCode + "]");
if( schemeCode == null || schemeCode.trim().length() == 0 )
......@@ -1163,8 +1171,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
schemeCode = rs.getString(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
}
//System.out.println("schemeCode 2 [" + schemeCode + "]");
......@@ -1181,8 +1189,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
batchQty = rs.getDouble(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
flag = false;
for(int i = 0; i < 12; i++)
......@@ -1223,8 +1231,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
integralQty = rs.getDouble(1) ;
restrictUpto = rs.getTimestamp(2) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( integralQty == 0.0)
{
......@@ -1242,8 +1250,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
integralQty = rs.getDouble(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
}
if( integralQty == 0.0)
......@@ -1259,8 +1267,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
integralQty = rs.getDouble(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
}
if( restrictUpto != null )
......@@ -1377,8 +1385,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0)
{
......@@ -1407,8 +1415,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0)
{
......@@ -1433,11 +1441,11 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
if(conn!=null)
{
if(pstmt != null )pstmt.close();
if(rs != null )rs.close();
if(rs1 != null )rs.close();
rs = null;
rs1 = null;
if(pstmt != null )pstmt.close();
pstmt =null;
conn.close();
}
......@@ -1679,8 +1687,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
maxScheduleNo = 12;
}
//System.out.println("maxScheduleNodescr.." + maxScheduleNo);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
switch(currentFormNo)
......@@ -1733,8 +1741,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
loginSiteDescr = rs.getString( "descr" );
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//end getting login site description
......@@ -1755,8 +1763,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
custCode = rs.getString(1) == null ? "" : rs.getString(1);
siteCode = rs.getString(2) == null ? "" : rs.getString(2);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
......@@ -1771,8 +1779,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
count = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( count > 1)
......@@ -1789,8 +1797,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
siteCode = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -1803,8 +1811,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
......@@ -1865,8 +1873,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
countryDescr = rs.getString(9) == null ? "" : rs.getString(9);
orderType = rs.getString(10) == null ? "" : rs.getString(10);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<name>").append("<![CDATA["+custName.trim()+"]]>").append("</name>");
......@@ -1884,8 +1892,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
totAmtAdjAmt = rs.getString(1) == null ? "0.00" : rs.getString(1);
}
//System.out.println("totAmtAdjAmt .." + totAmtAdjAmt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<st_cust_outs>").append("Customer Outstanding : Rs.").append("<![CDATA["+totAmtAdjAmt.trim()+"]]>").append("</st_cust_outs>");
......@@ -1943,8 +1951,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("siteDescr .." + siteDescr);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//valueXmlString.append("<quantity isSrvCallOnChg='1'>").append(pickQty).append("</quantity>");
......@@ -2042,8 +2050,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("siteDescr .." + siteDescr);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<site_descr>").append("<![CDATA["+siteDescr.trim()+"]]>").append("</site_descr>");
......@@ -2078,12 +2086,12 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
stateDescr = rs.getString(8) == null ? "" : rs.getString(8);
countryDescr = rs.getString(9) == null ? "" : rs.getString(9);
orderType = rs.getString(10) == null ? "" : rs.getString(10);
valueXmlString.append("<name>").append("<![CDATA["+custName.trim()+"]]>").append("</name>");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<name>").append("<![CDATA["+custName.trim()+"]]>").append("</name>");
if( transMode != null)
{
valueXmlString.append("<trans_mode>").append("<![CDATA["+transMode.trim()+"]]>").append("</trans_mode>");
......@@ -2098,10 +2106,10 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
totAmtAdjAmt = rs.getString(1) == null ? "0.00" : rs.getString(1);
}
//System.out.println("totAmtAdjAmt .." + totAmtAdjAmt);
pstmt.close();
rs.close();
pstmt = null;
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<st_cust_outs>").append("Customer Outstanding : Rs.").append("<![CDATA["+totAmtAdjAmt.trim()+"]]>").append("</st_cust_outs>");
valueXmlString.append("<customer_addr1>").append("<![CDATA["+addr1.trim()+"]]>").append("</customer_addr1>");
valueXmlString.append("<customer_addr2>").append("<![CDATA["+addr2.trim()+"]]>").append("</customer_addr2>");
......@@ -2125,8 +2133,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("siteDescr .." + siteDescr);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<descr>").append("<![CDATA["+siteDescr.trim()+"]]>").append("</descr>");
......@@ -2312,8 +2320,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("siteDescr .." + siteDescr);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
// 21/03/09 manoharan
......@@ -2323,7 +2331,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
valueXmlString.append("<qty_"+ i + " protect =\"1\">").append("</qty_"+ i + ">");
}*/
for(int i = 1; i <= maxScheduleNo; i++)
for(int i = 1; i <= maxScheduleNo + 1; i++)
{
//if (i <= maxScheduleNo)
//{
......@@ -2380,7 +2388,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
qtyTotal = 0; */
//for(int i = 1; i <= maxScheduleNo; i++)
//for(int i = maxScheduleNo + 1; i <= 12; i++) // 21/03/09 manoharan
for(int i = 1; i < maxScheduleNo; i++)
for(int i = 1; i < maxScheduleNo + 1; i++)
{
//System.out.println("sch["+i+"]..."+sch[i]);
//if (i <= maxScheduleNo)
......@@ -2626,8 +2634,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( priceList == null || priceList.trim().length() == 0)
......@@ -2642,8 +2650,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -2675,8 +2683,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1) ;
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
......@@ -2727,8 +2735,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
maxRefNoStr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("maxRefNo .." + maxRefNo);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("orderDate in db date format " + orderDate.toString());
......@@ -2758,8 +2766,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceListParent = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceListParent .." + priceListParent);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("priceListParent null codition:-" + priceListParent);
......@@ -2795,8 +2803,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1) ;
}
//System.out.println("cnt .." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
......@@ -2849,8 +2857,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
//System.out.println("maxRefNo .." + maxRefNo);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}//end cnt >= 1
......@@ -2908,8 +2916,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteDescr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("siteDescr .." + siteDescr);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<site_descr>").append("<![CDATA["+siteDescr.trim()+"]]>").append("</site_descr>");
......@@ -2944,8 +2952,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(cnt == 0)
......@@ -2959,8 +2967,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
itemSerCrPerc = rs.getString("item_ser") == null ? "" : rs.getString("item_ser");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if (itemSerCrPerc != null && itemSerCrPerc.trim().length()>0 )
......@@ -2975,22 +2983,22 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lsItemSer = rs.getString("item_ser__inv") == null ? "" : rs.getString("item_ser__inv");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
lsItemSer = lsItemSer == null ? "" : lsItemSer;
valueXmlString.append("<item_ser>").append("<![CDATA["+lsItemSer.trim()+"]]>").append("</item_ser>");
valueXmlString.append("<item_ser>").append("<![CDATA["+lsItemSer+"]]>").append("</item_ser>");
}
else
{
valueXmlString.append("<item_ser__prom>").append("<![CDATA["+itemSerProm.trim()+"]]>").append("</item_ser__prom>");
valueXmlString.append("<item_ser__prom>").append("<![CDATA["+itemSerProm+"]]>").append("</item_ser__prom>");
}
}
else
{
valueXmlString.append("<item_ser__prom>").append("<![CDATA["+itemSerProm.trim()+"]]>").append("</item_ser__prom>");
valueXmlString.append("<item_ser__prom>").append("<![CDATA["+itemSerProm+"]]>").append("</item_ser__prom>");
}
if(lsItemSer != null && lsItemSer.length()>0)
......@@ -3007,8 +3015,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
unit = rs.getString("unit") == null ? "" : rs.getString("unit") ;
locType = rs.getString("loc_type") == null ? "" : rs.getString("loc_type") ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("mitemSer...."+mitemSer);
......@@ -3027,8 +3035,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
siteString = rs.getString(1) == null ? "" : rs.getString(1) ;
}
//System.out.println("siteString...."+siteString);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
disparmLoc = distCommon.getDisparams("999999","CURR_LOC_CODE",conn);
......@@ -3056,8 +3064,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lcAvailStk = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -3082,8 +3090,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lcAvailStk = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -3098,8 +3106,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
stateCd = rs.getString("state_code") == null ? "" : rs.getString("state_code");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
lsItemCode = itemCode ;
......@@ -3111,8 +3119,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<st_scheme>").append("<![CDATA[]]>").append("</st_scheme>");
......@@ -3125,8 +3133,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
schemeCode =rs.getString("bom_code") == null ?"" : rs.getString("bom_code");
lsType =rs.getString("item_stru") == null ? "" : rs.getString("item_stru").trim();
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(lsType != "C")
......@@ -3168,10 +3176,10 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
noapplyCustList=scmRs.getString("noapply_cust_list") == null ? "" : scmRs.getString("noapply_cust_list");
applicableordtypes=scmRs.getString("order_type") == null ? "" : scmRs.getString("order_type");
}
scmPStmt.close();
scmPStmt = null;
scmRs.close();
scmRs = null;
scmPStmt.close();
scmPStmt = null;
// if(applicableordtypes.trim() == "NE" && applicableordtypes.trim().length()==0)
//System.out.println("Cust list applicable.....["+applyCustList + "]");
//System.out.println("Cust list non applicable.....["+noapplyCustList + "]");
......@@ -3276,8 +3284,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
else if( llSchcnt > 1 )
schemeCode = lsPrevscheme;
} // end of while
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if (llSchcnt > 1 )
......@@ -3294,8 +3302,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lsItemStru = rs.getString(1) == null ?"" : rs.getString(1).trim();
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("lsItemStru.....["+lsItemStru + "]");
......@@ -3309,8 +3317,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt= rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if(cnt >1)
......@@ -3333,8 +3341,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
mslabOn = rs.getString("slab_on") == null ? "" : rs.getString("slab_on");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("slab on....["+mslabOn + "]");
......@@ -3351,8 +3359,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lsDescr = rs.getString("descr") == null ? "" : rs.getString("descr");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<st_scheme>").append("<![CDATA[Scheme Descr :"+lsDescr+"]]>").append("</st_scheme>");
......@@ -3395,8 +3403,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
valueXmlString.append("<st_scheme>").append("<![CDATA[Integral Quantity :"+integralQty+ "Price List Disc :"+priceList+ " Rate : "+lcRate+ " " +lsType+"]]>").append("</st_scheme>");
valueXmlString.append("<st_scheme>").append("<![CDATA[Integral Quantity :"+integralQty+"]]>").append("</st_scheme>");
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
......@@ -3411,8 +3419,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
lsCustItemCodeRef = rs.getString("item_code__ref")== null ?"" : rs.getString("item_code__ref");;
lsCustItemCodeDescr = rs.getString("descr")== null ?"" : rs.getString("descr");;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if (lsCustItemCodeRef == null)
......@@ -3479,8 +3487,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( priceList == null || priceList.trim().length() == 0)
......@@ -3495,8 +3503,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......@@ -3528,8 +3536,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1) ;
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
......@@ -3580,8 +3588,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
maxRefNoStr = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("maxRefNo .." + maxRefNo);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("orderDate in db date format " + orderDate.toString());
......@@ -3611,8 +3619,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
priceListParent = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceListParent .." + priceListParent);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("priceListParent null codition:-" + priceListParent);
......@@ -3648,8 +3656,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
cnt = rs.getInt(1) ;
}
//System.out.println("cnt .." + cnt);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
......@@ -3702,8 +3710,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
//System.out.println("maxRefNo .." + maxRefNo);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}//end cnt >= 1
......@@ -3784,8 +3792,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
itemCode = rs.getString(1) == null ?"" : rs.getString(1) ;
itemCodeDescr = rs.getString(2) == null ?"" : rs.getString(2) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
valueXmlString.append("<item_code>").append("<![CDATA["+itemCode.trim()+"]]>").append("</item_code>");
sql= "select descr from item where item_code =? ";
......@@ -3797,8 +3805,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
itemDescr = rs.getString(1) == null ?"" : rs.getString(1) ;
}
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
valueXmlString.append("<descr>").append("<![CDATA["+itemDescr.trim()+"]]>").append("</descr>");
}
......@@ -3824,9 +3832,9 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
if(conn!=null)
{
if(pstmt != null)pstmt.close();
if(rs != null)rs.close();
rs = null;
if(pstmt != null)pstmt.close();
pstmt = null;
conn.close();
}
......@@ -3885,8 +3893,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
listType = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
pstmt.close();
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
......
......@@ -67,6 +67,7 @@ public class SOrderFormPostSave extends ValidatorEJB implements SOrderFormPostSa
sql = "update sordform f "
+ " set f.tot_value = (select sum(ORD_VALUE) from sordformdet d where d.tran_id = f.tran_id) "
+ " where f.tran_id = ? ";
System.out.println("SOrderFormPostSavesql [" +sql + "] tran id [" + tranID + "]");
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,tranID);
pstmt.executeUpdate();
......
......@@ -761,7 +761,7 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
}
System.out.println("clStk:"+clStk+":");
valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<item_code isSrvCallOnChg='1'>").append("<![CDATA[").append(itemCode==null?"":itemCode).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode==null?"":itemCode).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<descr isSrvCallOnChg='0'>").append("<![CDATA[").append(itemDescr).append("]]>").append("</descr>\r\n");
valueXmlString.append("<unit isSrvCallOnChg='0'>").append("<![CDATA[").append(unit).append("]]>").append("</unit>\r\n");
valueXmlString.append("<loc_type isSrvCallOnChg='0'>").append("<![CDATA[").append(locType).append("]]>").append("</loc_type>\r\n");
......
package ibase.webitm.ejb.custstock.adv;
package ibase.webitm.ejb.dis.adv;
import java.util.*;
import java.sql.*;
......
package ibase.webitm.ejb.custstock.adv;
package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
......
package ibase.webitm.ejb.custstock.adv;
package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
......
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