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