Commit f2901d21 authored by mnair's avatar mnair

Updated changes in ItemAcctDetrIC

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183974 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d70a454e
package ibase.webitm.ejb.fin;
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -19,881 +19,238 @@ import ibase.webitm.utility.ITMException; ...@@ -19,881 +19,238 @@ import ibase.webitm.utility.ITMException;
@Stateless @Stateless
public class ItemAcctDetrIC extends ValidatorEJB implements public class ItemAcctDetrIC extends ValidatorEJB implements
ItemAcctDetrICLocal, ItemAcctDetrICRemote ItemAcctDetrICLocal, ItemAcctDetrICRemote
{ {
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String retString = "";
try{
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
dom2 = genericUtility.parseString(xmlString2);
}
retString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
System.out.println("retString:::"+retString);
}
catch(Exception e){
System.out.println("Exception : ItemAcctDetrIC.java : wfValData(String xmlString) : ==>\n"+e.getMessage());
throw new ITMException(e);
}
return retString;
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
int cnt=0,ctr=0,childNodeLength = 0;
int currentFormNo=0;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node childNode = null;
String childNodeName = "",itemSer="",itemCode="",grpCode="",finEntity="",active="",tranCat="",cctrCode="",acctCode="",sql="";
String errString="",errCode="",errorType="",userId="";
ArrayList <String> errList = new ArrayList<String>();
ArrayList <String>errFields = new ArrayList <String> ();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try{
conn = getConnection();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("user ID form XtraParam : "+userId +"Edit Flag -->>: "+editFlag);
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
System.out.println("currentFormNo:::"+currentFormNo);
switch(currentFormNo)
{
case 1:{
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
System.out.println("childNodeLength>>"+childNodeLength);
for(ctr = 0; ctr < childNodeLength; ctr++)
{
System.out.println("childNode>>"+childNode);
childNode = childNodeList.item(ctr);
System.out.println("childNode>>"+childNode);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName>>"+childNodeName);
//Item_ser
if("item_ser".equalsIgnoreCase(childNodeName))
{
itemSer = genericUtility.getColumnValue("item_ser",dom).trim();
System.out.println("item_ser>>>>>"+itemSer);
if(itemSer == null || (itemSer.trim().length() == 0))
{
System.out.println("NULL ITEM SER!");
errCode = "VMNULLSER";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
sql ="select count(*) as cnt from itemser where item_ser=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSer);
System.out.println("itemSer"+itemSer);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
System.out.println("Item ser entered does not exist, please enter valid item ser !");
errCode = "VITEMSER";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//end of else
}// end of if block for item_ser
//Item_code
else if("item_code".equalsIgnoreCase(childNodeName))
{
itemCode = genericUtility.getColumnValue("item_code",dom).trim();
System.out.println("item_code>>>>>"+itemCode);
if(itemCode != null && itemCode.trim().length() > 0)
{
sql = "select count(*) as cnt from item where item_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(cnt == 0)
{
errCode = "VMITEM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//Grp_Code
else if("grp_code".equalsIgnoreCase(childNodeName))
{
grpCode = genericUtility.getColumnValue("grp_code",dom).trim();
System.out.println("grp_code>>>>>"+grpCode);
if(grpCode == null || grpCode.trim().length() == 0)
{
System.out.println("NULL GROUP CODE!");
errCode = "NULLGRPCODE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//Acct_Code
else if("acct_code__sal".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__sal",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__sal["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__dis".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__dis",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__dis["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__depr".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__depr",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__depr["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__acc_depr".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__acc_depr",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__acc_depr["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__depr_wb".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__depr_wb",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__depr_wb["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__fa".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__fa",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__fa["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__pl".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__pl",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__pl["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__in".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__in",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__in["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__pr".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__pr",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__pr["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__ph".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__ph",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__ph["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__ap".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__ap",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__ap["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__reco".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__reco",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__reco["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__wp".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__wp",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__wp["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__oh".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__oh",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__oh["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__ciss".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__ciss",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__ciss["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__wp_rcp".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__wp_rcp",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__wp_rcp["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__qc_sample".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__qc_sample",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__qc_sample["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__yld_loss".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__yld_loss",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__yld_loss["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__yld_gain".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__yld_gain",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__yld_gain["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__arev".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__arev",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__arev["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__crrev".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__crrev",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__crrev["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__tot_ar".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__tot_ar",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__tot_ar["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("acct_code__inrev".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__inrev",dom).trim();
if(acctCode != null && acctCode.trim().length() > 0)
{
cnt = getAccountDetail(acctCode,conn);
System.out.println("acct_code__inrev["+cnt+"]");
if(cnt == 0)
{
errCode = "VMACCT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//Cctr_Code
else if("cctr_code__sal".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__sal",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__sal["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__dis".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__dis",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__dis["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__depr".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__depr",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__depr["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__acc_depr".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__acc_depr",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__acc_depr["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__depr_wb".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__depr_wb",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__depr_wb["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__fa".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__fa",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__fa["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__pl".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__pl",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__pl["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__in".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__in",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__in["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if("cctr_code__pr".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__pr",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); Document dom = null;
System.out.println("cctr_code__pr["+cnt+"]"); Document dom1 = null;
if(cnt == 0) Document dom2 = null;
String retString = "";
try{
if(xmlString != null && xmlString.trim().length() > 0)
{ {
errCode = "VMCCTR"; dom = genericUtility.parseString(xmlString);
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__ph".equalsIgnoreCase(childNodeName)) if(xmlString1 != null && xmlString1.trim().length() > 0)
{
cctrCode=genericUtility.getColumnValue("cctr_code__ph",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__ph["+cnt+"]");
if(cnt == 0)
{ {
errCode = "VMCCTR"; dom1 = genericUtility.parseString(xmlString1);
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__ap".equalsIgnoreCase(childNodeName)) if(xmlString2 != null && xmlString2.trim().length() > 0)
{
cctrCode=genericUtility.getColumnValue("cctr_code__ap",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__ap["+cnt+"]");
if(cnt == 0)
{ {
errCode = "VMCCTR"; dom2 = genericUtility.parseString(xmlString2);
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__recp".equalsIgnoreCase(childNodeName)) retString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
{ System.out.println("retString:::"+retString);
cctrCode=genericUtility.getColumnValue("cctr_code__recp",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__recp["+cnt+"]");
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
catch(Exception e){
System.out.println("Exception : ItemAcctDetrIC.java : wfValData(String xmlString) : ==>\n"+e.getMessage());
throw new ITMException(e);
} }
return retString;
} }
else if("cctr_code__wp".equalsIgnoreCase(childNodeName))
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
cctrCode=genericUtility.getColumnValue("cctr_code__wp",dom).trim(); Connection conn = null;
if(cctrCode != null && cctrCode.trim().length() > 0) PreparedStatement pstmt = null;
ResultSet rs = null ;
int cnt=0,ctr=0,childNodeLength = 0;
int currentFormNo=0;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node childNode = null;
String childNodeName = "",itemSer="",itemCode="",grpCode="",finEntity="",active="",tranCat="",cctrCode="",acctCode="",sql="";
String errString="",errCode="",errorType="",userId="";
ArrayList <String> errList = new ArrayList<String>();
ArrayList <String>errFields = new ArrayList <String> ();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try{
conn = getConnection();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("user ID form XtraParam : "+userId +"Edit Flag -->>: "+editFlag);
if(objContext != null && objContext.trim().length()>0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); currentFormNo = Integer.parseInt(objContext);
System.out.println("cctr_code__wp["+cnt+"]"); System.out.println("currentFormNo:::"+currentFormNo);
if(cnt == 0)
switch(currentFormNo)
{ {
errCode = "VMCCTR"; case 1:{
errList.add(errCode); parentNodeList = dom.getElementsByTagName("Detail1");
errFields.add(childNodeName.toLowerCase()); parentNode = parentNodeList.item(0);
} childNodeList = parentNode.getChildNodes();
} childNodeLength = childNodeList.getLength();
} System.out.println("childNodeLength>>"+childNodeLength);
else if("cctr_code__oh".equalsIgnoreCase(childNodeName))
for(ctr = 0; ctr < childNodeLength; ctr++)
{ {
cctrCode=genericUtility.getColumnValue("cctr_code__oh",dom).trim(); System.out.println("childNode>>"+childNode);
if(cctrCode != null && cctrCode.trim().length() > 0) childNode = childNodeList.item(ctr);
System.out.println("childNode>>"+childNode);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName>>"+childNodeName);
//Item_ser
if("item_ser".equalsIgnoreCase(childNodeName))
{ {
cnt = getCostCtrDetail(cctrCode,conn); itemSer = genericUtility.getColumnValue("item_ser",dom);
System.out.println("cctr_code__oh["+cnt+"]"); System.out.println("item_ser>>>>>"+itemSer);
if(cnt == 0)
if(itemSer == null || itemSer.trim().length() == 0)
{ {
errCode = "VMCCTR"; itemSer = " ";
errList.add(errCode); System.out.println("Item ser["+itemSer+"]");
errFields.add(childNodeName.toLowerCase());
}
} }
} else
else if("cctr_code__ciss".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__ciss",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); sql ="select count(*) as cnt from itemser where item_ser = ?";
System.out.println("cctr_code__ciss["+cnt+"]");
if(cnt == 0) pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
System.out.println("Item ser["+itemSer+"]");
if (rs.next())
{ {
errCode = "VMCCTR"; cnt = rs.getInt("cnt");
errList.add(errCode); System.out.println("Count["+cnt+"]");
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("ctr_code__wp_rcp".equalsIgnoreCase(childNodeName)) rs.close();
{ rs = null;
cctrCode=genericUtility.getColumnValue("ctr_code__wp_rcp",dom).trim(); pstmt.close();
if(cctrCode != null && cctrCode.trim().length() > 0) pstmt = null;
{
cnt = getCostCtrDetail(cctrCode,conn); if (cnt == 0)
System.out.println("ctr_code__wp_rcp["+cnt+"]");
if(cnt == 0)
{ {
errCode = "VMCCTR"; System.out.println("Item ser entered does not exist, please enter valid item ser !");
errCode = "VITEMSER";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }//end of else if
} }// end of if block for item_ser
else if("cctr_code__qc_sample".equalsIgnoreCase(childNodeName))
//Item_code
else if("item_code".equalsIgnoreCase(childNodeName))
{ {
cctrCode=genericUtility.getColumnValue("cctr_code__qc_sample",dom).trim(); itemCode = genericUtility.getColumnValue("item_code",dom);
if(cctrCode != null && cctrCode.trim().length() > 0) System.out.println("item_code>>>>>"+itemCode);
if(itemCode != null && itemCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); sql = "select count(*) as cnt from item where item_code =?";
System.out.println("cctr_code__qc_sample["+cnt+"]"); pstmt = conn.prepareStatement(sql);
if(cnt == 0) pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
System.out.println("Item code["+itemCode+"]");
if (rs.next())
{ {
errCode = "VMCCTR"; cnt = rs.getInt("cnt");
errList.add(errCode); System.out.println("Count["+cnt+"]");
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__yld_loss".equalsIgnoreCase(childNodeName)) if(pstmt != null)
{
cctrCode=genericUtility.getColumnValue("cctr_code__yld_loss",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__yld_loss["+cnt+"]");
if(cnt == 0)
{ {
errCode = "VMCCTR"; pstmt.close();
errList.add(errCode); pstmt = null;
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__yld_gain".equalsIgnoreCase(childNodeName)) if(rs != null)
{
cctrCode=genericUtility.getColumnValue("cctr_code__yld_gain",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__yld_gain["+cnt+"]");
if(cnt == 0)
{ {
errCode = "VMCCTR"; rs.close();
errList.add(errCode); rs = null;
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("cctr_code__arev".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__arev",dom).trim();
if(cctrCode != null && cctrCode.trim().length() > 0)
{
cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__arev["+cnt+"]");
if(cnt == 0) if(cnt == 0)
{ {
errCode = "VMCCTR"; System.out.println("Item code entered does not exist, please enter valid item code !");
errCode = "VMITEM1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if("cctr_code__crrev".equalsIgnoreCase(childNodeName))
{ //Grp_Code
cctrCode=genericUtility.getColumnValue("cctr_code__crrev",dom).trim(); else if("grp_code".equalsIgnoreCase(childNodeName))
if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); grpCode = genericUtility.getColumnValue("grp_code",dom);
System.out.println("cctr_code__crrev["+cnt+"]"); System.out.println("grp_code>>>>>"+grpCode);
if(cnt == 0)
if(grpCode == null || grpCode.trim().length() == 0)
{ {
errCode = "VMCCTR"; grpCode = " ";
errList.add(errCode); System.out.println("Group code["+grpCode+"]");
errFields.add(childNodeName.toLowerCase());
} }
} }
}
else if("cctr_code__tot_ar".equalsIgnoreCase(childNodeName)) //Acct_Code
{ else if("acct_code__sal".equalsIgnoreCase(childNodeName) || "acct_code__dis".equalsIgnoreCase(childNodeName)
cctrCode=genericUtility.getColumnValue("cctr_code__tot_ar",dom).trim(); ||"acct_code__depr".equalsIgnoreCase(childNodeName) || "acct_code__acc_depr".equalsIgnoreCase(childNodeName)
if(cctrCode != null && cctrCode.trim().length() > 0) ||"acct_code__depr_wb".equalsIgnoreCase(childNodeName) || " acct_code__fa".equalsIgnoreCase(childNodeName)
||"acct_code__pl".equalsIgnoreCase(childNodeName) || "acct_code__in".equalsIgnoreCase(childNodeName)
||"acct_code__pr".equalsIgnoreCase(childNodeName) || "acct_code__ph".equalsIgnoreCase(childNodeName)
||"acct_code__ap".equalsIgnoreCase(childNodeName) || "acct_code__reco".equalsIgnoreCase(childNodeName)
||"acct_code__wp".equalsIgnoreCase(childNodeName) || "acct_code__oh".equalsIgnoreCase(childNodeName)
||"acct_code__ciss".equalsIgnoreCase(childNodeName) || "acct_code__wp_rcp".equalsIgnoreCase(childNodeName)
||"acct_code__qc_sample".equalsIgnoreCase(childNodeName) || "acct_code__yld_loss".equalsIgnoreCase(childNodeName)
||"acct_code__yld_gain".equalsIgnoreCase(childNodeName) || "acct_code__arev".equalsIgnoreCase(childNodeName)
||"acct_code__crrev".equalsIgnoreCase(childNodeName) || "acct_code__tot_ar".equalsIgnoreCase(childNodeName)
||"acct_code__inrev".equalsIgnoreCase(childNodeName))
{
acctCode=genericUtility.getColumnValue("acct_code__sal",dom);
System.out.println("Account code>>>>>"+acctCode);
if(acctCode != null && acctCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); cnt = getAccountDetail(acctCode,conn);
System.out.println("cctr_code__tot_ar["+cnt+"]"); System.out.println("Count["+cnt+"]");
if(cnt == 0) if(cnt == 0)
{ {
errCode = "VMCCTR"; System.out.println("Account code entered does not exist, please enter valid account code !");
errCode = "VMACCT1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if("cctr_code__inrev".equalsIgnoreCase(childNodeName))
{ //Cctr_Code
cctrCode=genericUtility.getColumnValue("cctr_code__inrev",dom).trim(); else if("cctr_code__sal".equalsIgnoreCase(childNodeName) || "cctr_code__dis".equalsIgnoreCase(childNodeName)
||"cctr_code__depr".equalsIgnoreCase(childNodeName) || "cctr_code__acc_depr".equalsIgnoreCase(childNodeName)
||"cctr_code__depr_wb".equalsIgnoreCase(childNodeName) || " cctr_code__fa".equalsIgnoreCase(childNodeName)
||"cctr_code__pl".equalsIgnoreCase(childNodeName) || "cctr_code__in".equalsIgnoreCase(childNodeName)
||"cctr_code__pr".equalsIgnoreCase(childNodeName) || "cctr_code__ph".equalsIgnoreCase(childNodeName)
||"cctr_code__ap".equalsIgnoreCase(childNodeName) || "cctr_code__reco".equalsIgnoreCase(childNodeName)
||"cctr_code__wp".equalsIgnoreCase(childNodeName) || "cctr_code__oh".equalsIgnoreCase(childNodeName)
||"cctr_code__ciss".equalsIgnoreCase(childNodeName) || "ctr_code__wp_rcp".equalsIgnoreCase(childNodeName)
||"cctr_code__qc_sample".equalsIgnoreCase(childNodeName) || "cctr_code__yld_loss".equalsIgnoreCase(childNodeName)
||"cctr_code__yld_gain".equalsIgnoreCase(childNodeName) || "cctr_code__arev".equalsIgnoreCase(childNodeName)
||"cctr_code__crrev".equalsIgnoreCase(childNodeName) || "cctr_code__tot_ar".equalsIgnoreCase(childNodeName)
||"cctr_code__inrev".equalsIgnoreCase(childNodeName))
{
cctrCode=genericUtility.getColumnValue("cctr_code__sal",dom);
System.out.println("CostCenter code>>>>>"+cctrCode);
if(cctrCode != null && cctrCode.trim().length() > 0) if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
cnt = getCostCtrDetail(cctrCode,conn); cnt = getCostCtrDetail(cctrCode,conn);
System.out.println("cctr_code__inrev["+cnt+"]"); System.out.println("Count["+cnt+"]");
if(cnt == 0) if(cnt == 0)
{ {
System.out.println("CostCenter code entered does not exist, please enter valid CostCenter code !");
errCode = "VMCCTR"; errCode = "VMCCTR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
...@@ -901,7 +258,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -901,7 +258,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
//Fin_entity //Fin_entity
else if("fin_entity".equalsIgnoreCase(childNodeName)) else if("fin_entity".equalsIgnoreCase(childNodeName))
{ {
finEntity = genericUtility.getColumnValue("fin_entity",dom).trim(); finEntity = genericUtility.getColumnValue("fin_entity",dom);
System.out.println("fin_entity>>>>>"+finEntity); System.out.println("fin_entity>>>>>"+finEntity);
if(finEntity != null && finEntity.trim().length() > 0) if(finEntity != null && finEntity.trim().length() > 0)
...@@ -910,10 +267,12 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -910,10 +267,12 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,finEntity); pstmt.setString(1,finEntity);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
System.out.println("Fin Entity["+finEntity+"]");
if(rs.next()) if(rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
System.out.println("Count["+cnt+"]");
} }
if(rs!=null) if(rs!=null)
...@@ -930,6 +289,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -930,6 +289,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
if(cnt == 0) if(cnt == 0)
{ {
System.out.println("Finance entity entered does not exist, please enter valid Finance entity!");
errCode="VMFENTY1"; errCode="VMFENTY1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -939,7 +299,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -939,7 +299,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
//Tran_cat //Tran_cat
else if("tran_cat".equalsIgnoreCase(childNodeName)) else if("tran_cat".equalsIgnoreCase(childNodeName))
{ {
tranCat = genericUtility.getColumnValue("tran_cat",dom).trim(); tranCat = genericUtility.getColumnValue("tran_cat",dom);
System.out.println("tran_cat>>>>>"+tranCat); System.out.println("tran_cat>>>>>"+tranCat);
if(tranCat != null && tranCat.trim().length()>0) if(tranCat != null && tranCat.trim().length()>0)
...@@ -948,12 +308,16 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -948,12 +308,16 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranCat); pstmt.setString(1,tranCat);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
System.out.println("Tran Cat["+tranCat+"]");
if(rs.next()) if(rs.next())
{ {
cnt=rs.getInt("cnt"); cnt=rs.getInt("cnt");
System.out.println("Count["+cnt+"]");
if(cnt == 0) if(cnt == 0)
{ {
System.out.println("Entered Transaction Category not found in Transaction Cat master!!");
errCode="VMTRNCAT"; errCode="VMTRNCAT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -964,6 +328,8 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -964,6 +328,8 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranCat); pstmt.setString(1,tranCat);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
System.out.println("Tran Cat["+tranCat+"]");
if(rs.next()) if(rs.next())
{ {
active = rs.getString("active"); active = rs.getString("active");
...@@ -971,18 +337,19 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -971,18 +337,19 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
if("N".equalsIgnoreCase(active)) if("N".equalsIgnoreCase(active))
{ {
System.out.println("Entered Transaction Category not active in Transaction Category master!!");
errCode="VMTRNCAT1"; errCode="VMTRNCAT1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}//end of else }
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}//end of if }
}//end of tran cat }//end of tran cat
}//end of for loop }//end of for loop
}//end of case 1 }//end of case 1
...@@ -1111,7 +478,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1111,7 +478,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
try{ try{
conn = getConnection(); conn = getConnection();
//sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if(objContext != null && objContext.trim().length()>0) if(objContext != null && objContext.trim().length()>0)
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
...@@ -1139,8 +506,9 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1139,8 +506,9 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
ctr ++; ctr ++;
}while(ctr < childNodeListLength && ! childNodeName.equals(currentColumn)); }while(ctr < childNodeListLength && ! childNodeName.equals(currentColumn));
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{ {
System.out.println("INSIDE itm_default : ");
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom)); itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
grpCode = checkNull(genericUtility.getColumnValue("group_code", dom)); grpCode = checkNull(genericUtility.getColumnValue("group_code", dom));
tranType = checkNull(genericUtility.getColumnValue("tran_type", dom)); tranType = checkNull(genericUtility.getColumnValue("tran_type", dom));
...@@ -1149,8 +517,9 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1149,8 +517,9 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
valueXmlString.append("<tran_type protect='0'>").append("<![CDATA["+ tranType + " ]]>").append("</tran_type>"); valueXmlString.append("<tran_type protect='0'>").append("<![CDATA["+ tranType + " ]]>").append("</tran_type>");
} }
if(currentColumn.trim().equalsIgnoreCase("itm_default_edit")) if("itm_default_edit".equalsIgnoreCase(currentColumn.trim()))
{ {
System.out.println("INSIDE itm_default_edit : ");
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom)); itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
grpCode = checkNull(genericUtility.getColumnValue("group_code", dom)); grpCode = checkNull(genericUtility.getColumnValue("group_code", dom));
tranType = checkNull(genericUtility.getColumnValue("tran_type", dom)); tranType = checkNull(genericUtility.getColumnValue("tran_type", dom));
...@@ -1159,89 +528,94 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1159,89 +528,94 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
valueXmlString.append("<tran_type protect='1'>").append("<![CDATA["+ tranType + " ]]>").append("</tran_type>"); valueXmlString.append("<tran_type protect='1'>").append("<![CDATA["+ tranType + " ]]>").append("</tran_type>");
} }
if( currentColumn.trim().equalsIgnoreCase( "item_ser" ) ) if("item_ser".equalsIgnoreCase(currentColumn.trim()))
{ {
sql ="select descr from itemser where item_ser=?"; itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
sql ="select descr from itemser where item_ser = ?";
pstmt =conn.prepareStatement(sql); pstmt =conn.prepareStatement(sql);
pstmt.setString(1, descr); pstmt.setString(1, itemSer);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
itemSer=rs.getString("item_ser"); descr=rs.getString("descr");
System.out.println("Item ser>>>>>>"+itemSer); System.out.println("Item ser descr>>>>>>"+descr);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
valueXmlString.append("<item_ser>").append("<![CDATA[" + itemSer + "]]>").append("</item_ser>"); //valueXmlString.append("<item_ser>").append("<![CDATA[" + itemSer + "]]>").append("</item_ser>");
valueXmlString.append("<itemser_descr>").append("<![CDATA[" + descr + "]]>").append("</itemser_descr>");
} }
if( currentColumn.trim().equalsIgnoreCase( "item_code" ) ) if("item_code".equalsIgnoreCase(currentColumn.trim()))
{ {
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
sql ="select descr from item where item_code=?"; sql ="select descr from item where item_code=?";
pstmt =conn.prepareStatement(sql); pstmt =conn.prepareStatement(sql);
pstmt.setString(1, descr); pstmt.setString(1, itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
itemCode=rs.getString("item_code"); descr=rs.getString("descr");
System.out.println("Item code>>>>>>"+itemCode); System.out.println("Item code descr>>>>>>"+descr);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>"); //valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[" + descr + "]]>").append("</item_descr>");
} }
//acct_code__sal is not present in the accounts table
if( currentColumn.trim().equalsIgnoreCase( "acct_code__sal" ) ) if("acct_code__sal".equalsIgnoreCase(currentColumn.trim()))
{ {
sql ="select descr from accounts where acct_code__sal=?"; acctCodeSal = checkNull(genericUtility.getColumnValue("acct_code__sal", dom));
sql ="select descr from accounts where acct_code=?";
pstmt =conn.prepareStatement(sql); pstmt =conn.prepareStatement(sql);
pstmt.setString(1, descr); pstmt.setString(1, acctCodeSal);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
acctCodeSal=rs.getString("acct_code__sal"); descr=rs.getString("descr");
System.out.println("Acct Code sal>>>>>>"+acctCodeSal); System.out.println("Acct Code sal descr>>>>>>"+descr);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
valueXmlString.append("<acct_code__sal>").append("<![CDATA[" + acctCodeSal + "]]>").append("</acct_code__sal>"); //valueXmlString.append("<acct_code__sal>").append("<![CDATA[" + acctCodeSal + "]]>").append("</acct_code__sal>");
valueXmlString.append("<accounts_descr>").append("<![CDATA[" + descr + "]]>").append("</accounts_descr>");
} }
//acct_code__dis is not present in the accounts table
if( currentColumn.trim().equalsIgnoreCase( "acct_code__dis" ) ) if("acct_code__dis".equalsIgnoreCase(currentColumn.trim()))
{ {
sql ="select descr from accounts where acct_code__dis=?"; acctCodeDis = checkNull(genericUtility.getColumnValue("acct_code__sal", dom));
sql ="select descr from accounts where acct_code=?";
pstmt =conn.prepareStatement(sql); pstmt =conn.prepareStatement(sql);
pstmt.setString(1, descr); pstmt.setString(1, acctCodeDis);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
acctCodeDis=rs.getString("acct_code__dis"); descr=rs.getString("descr");
System.out.println("Acct Code Dis>>>>>>"+acctCodeDis); System.out.println("Acct Code Dis descr>>>>>>"+descr);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
valueXmlString.append("<acct_code__dis>").append("<![CDATA[" + acctCodeDis + "]]>").append("</acct_code__dis>"); //valueXmlString.append("<acct_code__dis>").append("<![CDATA[" + acctCodeDis + "]]>").append("</acct_code__dis>");
valueXmlString.append("<descr>").append("<![CDATA[" + descr + "]]>").append("</descr>");
} }
}//end of case 1 }//end of case 1
...@@ -1349,7 +723,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1349,7 +723,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
ResultSet rs = null; ResultSet rs = null;
String sql=""; String sql="";
int count=0; int count=0;
System.out.println("Inside getAccountDetail method!!!!!!!!!!!!!!");
try{ try{
sql ="select count(*) as cnt from accounts where acct_code= ? "; sql ="select count(*) as cnt from accounts where acct_code= ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1406,7 +780,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote ...@@ -1406,7 +780,7 @@ ItemAcctDetrICLocal, ItemAcctDetrICRemote
ResultSet rs = null; ResultSet rs = null;
String sql=""; String sql="";
int count=0; int count=0;
System.out.println("Inside getCostCtrDetail method!!!!!!!!!!!!!!");
try{ try{
if(cctrCode != null && cctrCode.trim().length() > 0) if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
......
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