Commit 8b53e750 authored by psawant's avatar psawant

1. Changes in Customer Master

- UI related changes in Customer
- Customer Default related itemchange
2. Created new Customer Default Master

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189654 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3efd306e
......@@ -6,31 +6,35 @@
********************************************************/
package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
@Stateless
public class Customer extends ValidatorEJB
implements CustomerLocal, CustomerRemote
{
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
String winName = null;
FinCommon finCommon = null;
ValidatorEJB validator = null;
......@@ -95,16 +99,16 @@ implements CustomerLocal, CustomerRemote
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String commTable = "";//changed by Nasruddin [19/JUL/16 ]
String commTable = "";// changed by Nasruddin [19/JUL/16 ]
String discList = "";
try
{
this.finCommon = new FinCommon();
this.validator = new ValidatorEJB();
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
// Changes and Commented By Bhushan on 09-06-2016 :START
// conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
// Changes and Commented By Bhushan on 09-06-2016 :END
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if ((objContext != null) && (objContext.trim().length() > 0))
{
......@@ -112,7 +116,7 @@ implements CustomerLocal, CustomerRemote
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo)
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
......@@ -122,7 +126,7 @@ implements CustomerLocal, CustomerRemote
int childNodeListLength = childNodeList.getLength();
tranId = checkNull(this.genericUtility.getColumnValue("tran_id", dom));
System.out.println("tran id from boqdet --4-->>>>[" + tranId + "]");
for (ctr = 0; ctr < childNodeListLength; ctr++)
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
......@@ -130,11 +134,10 @@ implements CustomerLocal, CustomerRemote
if (childNodeName.equalsIgnoreCase("cust_code"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
sql = "select key_flag from transetup where tran_window = 'w_customer'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
keyFlag = rs.getString("key_flag");
}
......@@ -155,14 +158,14 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if ("A".equalsIgnoreCase(editFlag))
else if ("A".equalsIgnoreCase(editFlag))
{
cnt = 0;
sql = "select count(*) as ll_count from customer where cust_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("ll_count");
}
......@@ -171,39 +174,39 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt > 0)
if (cnt > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
//Changed by Sneha on 10-11-2016, for validating the field customer priority [Start]
else if (childNodeName.equalsIgnoreCase("cust_priority"))
else if (childNodeName.equalsIgnoreCase("cust_priority"))
{
String custPriority = checkNull(genericUtility.getColumnValue("cust_priority", dom));
/* System.out.println("custPriority======>>"+custPriority);
/* System.out.println("custPriority======>>"+custPriority);
System.out.println("custPriority length======>>"+custPriority.length());*/
if(custPriority.length() > 1)
if (custPriority.length() > 1)
{
//System.out.println("custPriority found larger value--------->>");
// System.out.println("custPriority found larger value--------->>");
errCode = "VMCUSTPRIT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(!custPriority.matches("[0-9A-Za-z-]+"))
{
//System.out.println("Special character found for custPriority ---------");
errCode = "VMCUSTINVD";
errList.add( errCode );
}
else if (!custPriority.matches("[0-9A-Za-z-]+"))
{
// System.out.println("Special character found for custPriority ---------");
errCode = "VMCUSTINVD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
//Changed by Sneha on 10-11-2016, for validating the field customer priority [End]
// Comment By Nkhan [16-SEP-16] START
/* else if (childNodeName.equalsIgnoreCase("cust_name"))
{
......@@ -288,17 +291,17 @@ implements CustomerLocal, CustomerRemote
ignoreCredit = checkNull(genericUtility.getColumnValue("ignore_credit", dom));
cnt = 0;
if (ignoreCredit != null && ignoreCredit.trim().length() > 0)
if (ignoreCredit != null && ignoreCredit.trim().length() > 0)
{
cnt = Integer.parseInt(ignoreCredit.trim());
if (cnt < 0)
if (cnt < 0)
{
errCode = "VMIGCRT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
else
{
errCode = "VMIGCRTNLL";
errList.add(errCode);
......@@ -322,29 +325,29 @@ implements CustomerLocal, CustomerRemote
ignoreDays = checkNull(genericUtility.getColumnValue("ignore_days", dom));
cnt = 0;
if (ignoreDays != null && ignoreDays.trim().length() > 0)
if (ignoreDays != null && ignoreDays.trim().length() > 0)
{
cnt = Integer.parseInt(ignoreDays.trim());
if (cnt < 0)
if (cnt < 0)
{
errCode = "VMCRDYS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("acct_code__adv"))
}
else if (childNodeName.equalsIgnoreCase("acct_code__adv"))
{
acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom));
//if (acctCodeAdv != null)
//{
// if (acctCodeAdv != null)
// {
cnt = 0;
sql = "select count(*) as cnt from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -353,13 +356,13 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt != 0)
if (cnt != 0)
{
sql = "select active from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
active = rs.getString("active");
}
......@@ -375,15 +378,15 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase());
}
}
//Changed By PriyankaC on 09/01/2018..[START]
// Changed By PriyankaC on 09/01/2018..[START]
/*else
{
errCode = "VTACCTCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
// //Changed By PriyankaC on 09/01/2018..[END]
//}
// //Changed By PriyankaC on 09/01/2018..[END]
// }
/* Comment By Nasruddin [16-SEP-16] START
else
{
......@@ -392,7 +395,7 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase());
}
Comment By Nasruddin [16-SEP-16] END*/
}
}
else if (childNodeName.equalsIgnoreCase("cctr_code__adv"))
{
cctrCodeAdv = checkNull(genericUtility.getColumnValue("cctr_code__adv", dom));
......@@ -404,7 +407,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -413,7 +416,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTCCTRCD1";
errList.add(errCode);
......@@ -426,7 +429,7 @@ implements CustomerLocal, CustomerRemote
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
if (groupCode != null && groupCode.trim().length() > 0)
if (groupCode != null && groupCode.trim().length() > 0)
{
if (!groupCode.equalsIgnoreCase(custCode))
{
......@@ -435,7 +438,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, groupCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -447,7 +450,7 @@ implements CustomerLocal, CustomerRemote
sql = "select key_flag from transetup where tran_window = 'w_customer'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
keyFlag = rs.getString("key_flag");
}
......@@ -456,7 +459,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0 && !("A".equalsIgnoreCase(keyFlag)))
if (cnt == 0 && !("A".equalsIgnoreCase(keyFlag)))
{
errCode = "VMCUST1";
errList.add(errCode);
......@@ -470,10 +473,10 @@ implements CustomerLocal, CustomerRemote
errCode = "VMGRPCNULL";// Group Code is null
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("cust_code__bil"))
else if (childNodeName.equalsIgnoreCase("cust_code__bil"))
{
custCodeBil = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
......@@ -497,14 +500,14 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (!custCodeBil.equalsIgnoreCase(custCode))
else if (!custCodeBil.equalsIgnoreCase(custCode))
{
cnt = 0;
sql = "select count(*) as cnt from customer where cust_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeBil);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -513,7 +516,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMBILLTO";
errList.add(errCode);
......@@ -528,8 +531,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase());
}
Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("stan_code"))
}
else if (childNodeName.equalsIgnoreCase("stan_code"))
{
stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom));
cnt = 0;
......@@ -540,7 +543,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -549,13 +552,13 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTSTAN1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
/* Comment By Nasruddin [16-SEP-16] START
else
{
......@@ -565,12 +568,12 @@ implements CustomerLocal, CustomerRemote
}
Comment By Nasruddin [16-SEP-16] END*/
}
}
else if (childNodeName.equalsIgnoreCase("terr_code"))
{
terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom));
if (terrCode != null && terrCode.trim().length() > 0)
if (terrCode != null && terrCode.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as ll_count from territory where terr_code =?";
......@@ -586,7 +589,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTTERRCD";
errList.add(errCode);
......@@ -594,7 +597,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("state_code"))
else if (childNodeName.equalsIgnoreCase("state_code"))
{
stateCode = checkNull(genericUtility.getColumnValue("state_code", dom));
......@@ -614,7 +617,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTSTATE1";
errList.add(errCode);
......@@ -622,18 +625,18 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("count_code"))
else if (childNodeName.equalsIgnoreCase("count_code"))
{
countCode =checkNull( genericUtility.getColumnValue("count_code", dom) );
countCode = checkNull(genericUtility.getColumnValue("count_code", dom));
if (countCode != null && countCode.trim().length() > 0)
if (countCode != null && countCode.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from country where count_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, countCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -642,7 +645,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTCONTCD1";
errList.add(errCode);
......@@ -650,7 +653,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("cr_term"))
else if (childNodeName.equalsIgnoreCase("cr_term"))
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
......@@ -677,8 +680,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("curr_code"))
}
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode = checkNull(genericUtility.getColumnValue("curr_code", dom));
cnt = 0;
......@@ -687,7 +690,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -701,10 +704,10 @@ implements CustomerLocal, CustomerRemote
errCode = "VTCURRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
}
else
{
if (editFlag.equalsIgnoreCase("E"))
if (editFlag.equalsIgnoreCase("E"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
......@@ -712,7 +715,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
currCode1 = rs.getString("curr_code");
}
......@@ -731,7 +734,7 @@ implements CustomerLocal, CustomerRemote
pstmt.setString(1, custCode);
pstmt.setString(2, lsVal3);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("ll_count");
}
......@@ -747,7 +750,7 @@ implements CustomerLocal, CustomerRemote
pstmt.setString(2, lsVal3);
pstmt.setString(3, currCode1);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt1 = rs.getInt("cnt");
}
......@@ -756,7 +759,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt1 != 0 && cnt > 1)
if (cnt1 != 0 && cnt > 1)
{
errCode = "VXCURRCD1";
errList.add(errCode);
......@@ -765,7 +768,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
}
}
else if (childNodeName.equalsIgnoreCase("acct_code__ar"))
{
acctCodeAr = checkNull(genericUtility.getColumnValue("acct_code__ar", dom));
......@@ -777,7 +780,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -792,7 +795,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
active = rs.getString("active");
}
......@@ -816,22 +819,22 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
// //Changed By PriyankaC on 09/01/2018..[END]
//cHANGED By Nasruddin [30-SEP-16] END
// //Changed By PriyankaC on 09/01/2018..[END]
// cHANGED By Nasruddin [30-SEP-16] END
}
}
else if (childNodeName.equalsIgnoreCase("cctr_code__ar"))
{
cctrCodeAr = checkNull(genericUtility.getColumnValue("cctr_code__ar", dom));
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -840,14 +843,14 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTCCTRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
// //Changed By PriyankaC on 09/01/2018..[START]
// //Changed By PriyankaC on 09/01/2018..[START]
/*else
{
acctCodeAr = checkNull(genericUtility.getColumnValue("acct_code__ar", dom));
......@@ -860,12 +863,12 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase());
}
// //Changed By PriyankaC on 09/01/2018..[END]
*/ }
else if (childNodeName.equalsIgnoreCase("tax_class"))
*/ }
else if (childNodeName.equalsIgnoreCase("tax_class"))
{
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
if (taxClass != null && taxClass.trim().length() > 0)
if (taxClass != null && taxClass.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from taxclass where tax_class =?";
......@@ -881,7 +884,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTTAXCLA1";
errList.add(errCode);
......@@ -917,7 +920,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("price_list"))
else if (childNodeName.equalsIgnoreCase("price_list"))
{
priceList = checkNull(genericUtility.getColumnValue("price_list", dom));
......@@ -945,7 +948,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("price_list__clg"))
else if (childNodeName.equalsIgnoreCase("price_list__clg"))
{
priceListClg = checkNull(genericUtility.getColumnValue("price_list__clg", dom));
......@@ -956,7 +959,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, priceListClg);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -965,26 +968,26 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTPLIST1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("sales_pers"))
}
else if (childNodeName.equalsIgnoreCase("sales_pers"))
{
salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom));
if (salesPers != null && salesPers.trim().length() > 0)
if (salesPers != null && salesPers.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -999,7 +1002,7 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
/* Comment By Nasruddin [16-SEP-16] START
else
{
......@@ -1009,17 +1012,17 @@ implements CustomerLocal, CustomerRemote
}
Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("sales_pers__1"))
else if (childNodeName.equalsIgnoreCase("sales_pers__1"))
{
salesPers1 = checkNull(genericUtility.getColumnValue("sales_pers__1", dom));
if (salesPers1 != null && salesPers1.trim().length() > 0)
if (salesPers1 != null && salesPers1.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers1);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1028,25 +1031,25 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMSLPERS1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("sales_pers__2"))
}
else if (childNodeName.equalsIgnoreCase("sales_pers__2"))
{
salesPers2 = checkNull(genericUtility.getColumnValue("sales_pers__2", dom));
if (salesPers2 != null && salesPers2.trim().length() > 0)
if (salesPers2 != null && salesPers2.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, salesPers2);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1055,7 +1058,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMSLPERS1";
errList.add(errCode);
......@@ -1063,18 +1066,18 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("tran_code"))
else if (childNodeName.equalsIgnoreCase("tran_code"))
{
tranCode = checkNull(genericUtility.getColumnValue("tran_code", dom));
if (tranCode != null && tranCode.trim().length() > 0)
if (tranCode != null && tranCode.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from transporter where tran_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1083,7 +1086,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTTRANCD1";
errList.add(errCode);
......@@ -1091,7 +1094,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("site_code__rcp"))
else if (childNodeName.equalsIgnoreCase("site_code__rcp"))
{
siteCodeRcp = checkNull(genericUtility.getColumnValue("site_code__rcp", dom));
......@@ -1102,7 +1105,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeRcp);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1111,7 +1114,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTSITECD1";
errList.add(errCode);
......@@ -1130,8 +1133,8 @@ implements CustomerLocal, CustomerRemote
errCode = "VMSITECD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
}
else
{
//if ("N".equalsIgnoreCase(channelPartner) && (siteCode != null)) Comment By Nasruddin
if ("N".equalsIgnoreCase(channelPartner) && (siteCode.trim().length() > 0))
......@@ -1147,7 +1150,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1164,19 +1167,19 @@ implements CustomerLocal, CustomerRemote
}
}
}
}
}
else if (childNodeName.equalsIgnoreCase("black_listing"))
{
blackListing = checkNull(genericUtility.getColumnValue("black_listing", dom));
if (!"P".equalsIgnoreCase(blackListing))
if (!"P".equalsIgnoreCase(blackListing))
{
errCode = "VMBLACKLIS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("contact_code"))
}
else if (childNodeName.equalsIgnoreCase("contact_code"))
{
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
......@@ -1185,7 +1188,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1194,18 +1197,18 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMCONTCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("bank_code"))
}
else if (childNodeName.equalsIgnoreCase("bank_code"))
{
bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom));
// if (bankCode != null) Comment By Nasruddin [16-SEP-16]
// if (bankCode != null) Comment By Nasruddin [16-SEP-16]
if (bankCode != null && bankCode.trim().length() > 0)
{
cnt = 0;
......@@ -1213,7 +1216,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1222,7 +1225,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt <= 0)
if (cnt <= 0)
{
errCode = "VMBANK1";
errList.add(errCode);
......@@ -1230,7 +1233,7 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("price_list__disc"))
else if (childNodeName.equalsIgnoreCase("price_list__disc"))
{
priceListDisc = checkNull(genericUtility.getColumnValue("price_list__disc", dom));
......@@ -1253,7 +1256,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTPLIST1";
errList.add(errCode);
......@@ -1261,29 +1264,29 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("sales_option"))
else if (childNodeName.equalsIgnoreCase("sales_option"))
{
salesOption = checkNull(genericUtility.getColumnValue("sales_option", dom));
if (salesOption == null || salesOption.trim().length() <= 0)
if (salesOption == null || salesOption.trim().length() <= 0)
{
errCode = "VTSLOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("dlv_term"))
{
dlvTerm = checkNull(genericUtility.getColumnValue("dlv_term", dom));
System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@"+dlvTerm);
if (dlvTerm != null && dlvTerm.trim().length() > 0)
System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@" + dlvTerm);
if (dlvTerm != null && dlvTerm.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from delivery_term where dlv_term =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, dlvTerm);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1292,7 +1295,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMDLVTERM1";
errList.add(errCode);
......@@ -1300,10 +1303,10 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("loss_perc"))
else if (childNodeName.equalsIgnoreCase("loss_perc"))
{
lossPerc = genericUtility.getColumnValue("loss_perc", dom);
if (lossPerc != null && lossPerc.trim().length() > 0)
if (lossPerc != null && lossPerc.trim().length() > 0)
{
cnt1 = Integer.parseInt(lossPerc);
}
......@@ -1313,38 +1316,38 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc"))
}
else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc"))
{
adhocReplPerc = checkNull(genericUtility.getColumnValue("adhoc_repl_perc", dom));
double adhocvalue = 0.00;
if (adhocReplPerc != null && adhocReplPerc.trim().length() > 0)
if (adhocReplPerc != null && adhocReplPerc.trim().length() > 0)
{
adhocvalue = Double.valueOf(adhocReplPerc.trim());
// cnt1=Integer.parseInt(adhocReplPerc.trim());
// if(cnt1<0 || cnt1>100){
if (adhocvalue < 0 || adhocvalue > 100)
if (adhocvalue < 0 || adhocvalue > 100)
{
errCode = "VTADH";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("term_table__no"))
}
else if (childNodeName.equalsIgnoreCase("term_table__no"))
{
termTableNo = checkNull(genericUtility.getColumnValue("term_table__no", dom));
//if( termTableNo != null) Changed By Nasruddin [16-sep-16]
if (termTableNo != null && termTableNo.trim().length() > 0)
// if( termTableNo != null) Changed By Nasruddin [16-sep-16]
if (termTableNo != null && termTableNo.trim().length() > 0)
{
sql = "select count(1) as cnt from sale_term_table where term_table = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, termTableNo);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1353,7 +1356,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMSALETERM";
errList.add(errCode);
......@@ -1361,18 +1364,18 @@ implements CustomerLocal, CustomerRemote
}
}
}
else if (childNodeName.equalsIgnoreCase("emp_code__ord"))
else if (childNodeName.equalsIgnoreCase("emp_code__ord"))
{
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
if (empCodeOrd != null && empCodeOrd.trim().length() > 0)
if (empCodeOrd != null && empCodeOrd.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from employee where emp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1381,7 +1384,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMEMPORD2";
errList.add(errCode);
......@@ -1400,7 +1403,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd1);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1409,14 +1412,14 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMEMPORD2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}//Changed By Nasruddin khan [19/JUL/16] START
} // Changed By Nasruddin khan [19/JUL/16] START
else if( childNodeName.equalsIgnoreCase("comm_table")){
commTable = checkNull(genericUtility.getColumnValue("comm_table", dom));
......@@ -1437,7 +1440,7 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VMCOMMTBCD";
errList.add(errCode);
......@@ -1445,22 +1448,23 @@ implements CustomerLocal, CustomerRemote
}
}
}//Changed By Nasruddin khan [19/JUL/16] END
} // Changed By Nasruddin khan [19/JUL/16] END
//Changed By Nasruddin khan [16/SEP/16] START
else if( childNodeName.equalsIgnoreCase("disc_list"))
// Changed By Nasruddin khan [16/SEP/16] START
else if (childNodeName.equalsIgnoreCase("disc_list"))
{
discList = checkNull(genericUtility.getColumnValue("disc_list", dom));
if( discList != null && discList.trim().length() > 0){
if (discList != null && discList.trim().length() > 0)
{
cnt = 0;
sql = "select count(1) as cnt from disc_list where disc_list = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, discList);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1478,8 +1482,7 @@ implements CustomerLocal, CustomerRemote
}
}
//Changed By Nasruddin khan [16/SEP/16] END
// Changed By Nasruddin khan [16/SEP/16] END
// else if(childNodeName.equalsIgnoreCase("cust_code__pd")){
// custCodePd =
......@@ -1600,7 +1603,7 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
......@@ -1608,14 +1611,14 @@ implements CustomerLocal, CustomerRemote
{
regCode = checkNull(genericUtility.getColumnValue("reg_code", dom));
if (regCode != null && regCode.trim().length() > 0)
if (regCode != null && regCode.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from reg_requirements where reg_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, regCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
cnt = rs.getInt("cnt");
}
......@@ -1624,29 +1627,31 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
if (cnt == 0)
if (cnt == 0)
{
errCode = "VTRCODEXT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
}
else
{
errCode = "VTRCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeName.trim().equalsIgnoreCase("reg_date"))
}
else if (childNodeName.trim().equalsIgnoreCase("reg_date"))
{
regDate = genericUtility.getColumnValue("reg_date", dom);
if (regDate == null)
if (regDate == null)
{
errCode = "VTREGNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeName.trim().equalsIgnoreCase("valid_upto"))
}
else if (childNodeName.trim().equalsIgnoreCase("valid_upto"))
{
validUpto = genericUtility.getColumnValue("valid_upto", dom);
regDate = genericUtility.getColumnValue("reg_date", dom);
......@@ -1655,7 +1660,8 @@ implements CustomerLocal, CustomerRemote
errCode = "VTVALNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (regDate != null)
}
else if (regDate != null)
{
Timestamp validUptoDate = Timestamp.valueOf(genericUtility.getValidDateString(validUpto, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
Timestamp regDateNew = Timestamp.valueOf(genericUtility.getValidDateString(regDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -1674,41 +1680,43 @@ implements CustomerLocal, CustomerRemote
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
if ((errList != null) && (errListSize > 0))
if ((errList != null) && (errListSize > 0))
{
for (cnt = 0; cnt < errListSize; cnt++)
for (cnt = 0; cnt < errListSize; cnt++)
{
errCode = (String) errList.get(cnt);
errFldName = (String) errFields.get(cnt);
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
if (errString.length() > 0)
{
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
errString = "";
}
if (errorType.equalsIgnoreCase("E"))
if (errorType.equalsIgnoreCase("E"))
{
break;
}
}
errStringXml.append("</Errors> </Root> \r\n");
} else
}
else
{
errStringXml = new StringBuffer("");
}
} catch (Exception e)
{
}
catch (Exception e) {
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
} finally
}
finally
{
try
try
{
//Commented and Added by sarita on 13NOV2017
// Commented and Added by sarita on 13NOV2017
/*if (conn != null)
{
if (rs != null)
......@@ -1725,7 +1733,7 @@ implements CustomerLocal, CustomerRemote
conn.close();
}
conn = null;*/
if(conn != null)
if (conn != null)
{
conn.close();
conn = null;
......@@ -1735,12 +1743,13 @@ implements CustomerLocal, CustomerRemote
rs.close();
rs = null;
}
if (pstmt != null)
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} catch (Exception d)
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
......@@ -1760,14 +1769,15 @@ implements CustomerLocal, CustomerRemote
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0)
if (xmlString2.trim().length() > 0)
{
dom2 = parseString(xmlString2);
}
System.out.println("HELLO1 PRINT");
valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
System.out.println("valueXmlString[" + valueXmlString + "]");
} catch (Exception e)
}
catch (Exception e)
{
System.out.println("Exception : [MiscVal][itemChanged( String, String )] :==>\n" + e.getMessage());
throw new ITMException(e);
......@@ -1791,18 +1801,25 @@ implements CustomerLocal, CustomerRemote
ResultSet rs = null;
ResultSet rs1 = null;
ResultSet rs2 = null;
System.out.println("currentColumn [" + currentColumn + "]");
String colName = "", colValue = "", fullName = "", siteCode1 = "";
String custType = "", priceList = "", countCode1 = "", priceList1 = "", siteCodePay = "", partQty = "",
siteCode = "", siteCodeRcp = "", priceListDisc = "";
String resBKList = "", lsDescr = "", lsBKListed = "";
String lsNull = "", nullVarr = "", ldDate = "";
String custCodeBill = "", custCode = "", stanCode = "", currCode = "", countCode = "";
String custCodeBill = "", custCode = "", stanCode = "", currCode = "", countCode = "", currCode2 = "";
String lsStateCode = "", lsCity = "", lsPin = "";
String custName = "", chqName = "", terrCode = "", terrDesc = "", salesPers = "", spName = "", contactCode = "", groupCode = "";
String custName = "", chqName = "", terrCode = "", terrDesc = "", salesPers = "", spName = "", contactCode = "",
groupCode = "";
String bankCode = "", bankName = "";
String channelPartner = "";
String crTerm = "", crDays = "";
String rateRound = "";
String name = "", shName = "", contPers = "", contPfx = "", addr1 = "", addr2 = "", addr3 = "", stateCode = "", tele1 = "", tele2 = "", tele3 = "", teleExt = "", fax = "", emailAddr = "", ediAddr = "";
String name = "", shName = "", contPers = "", contPfx = "", addr1 = "", addr2 = "", addr3 = "", stateCode = "",
tele1 = "", tele2 = "", tele3 = "", teleExt = "", fax = "", emailAddr = "", ediAddr = "";
String contPfx1 = "", contPers1 = "", Add1 = "", emailAddr1 = "", ediAddr1 = "", keyFlag = "";
String regCode = "", regDescr = "", empCodeOrd = "", empFname = "", empLname = "", empCodeOrd1 = "", deptCode = "";
String regCode = "", regDescr = "", empCodeOrd = "", empFname = "", empLname = "", empCodeOrd1 = "",
deptCode = "";
int ctr = 0;
int currentFormNo = 0;
java.util.Date reqDate = null;
......@@ -1812,28 +1829,28 @@ implements CustomerLocal, CustomerRemote
ArrayList errFields = new ArrayList();
SimpleDateFormat sdf;
StringBuffer valueXmlString = new StringBuffer();
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
ConnDriver connDriver = new ConnDriver();
try
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
// Changes and Commented By Bhushan on 09-06-2016 :START
// conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
// Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
this.finCommon = new FinCommon();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if ((objContext != null) && (objContext.trim().length() > 0))
if ((objContext != null) && (objContext.trim().length() > 0))
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo)
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
......@@ -1841,19 +1858,18 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equals(currentColumn))
if (childNodeName.equals(currentColumn))
{
childNode.getFirstChild();
}
ctr++;
} while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println("CURRENT COLUMN [" + currentColumn + "]");
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
......@@ -1869,17 +1885,18 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if (lsBKListed.equalsIgnoreCase("N"))
if (lsBKListed.equalsIgnoreCase("N"))
{
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
} else
}
else
{
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
}
} else if (currentColumn.trim().equalsIgnoreCase("itm_default"))
}
else if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
......@@ -1894,19 +1911,28 @@ implements CustomerLocal, CustomerRemote
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if ("N".equalsIgnoreCase(lsBKListed))
if ("N".equalsIgnoreCase(lsBKListed))
{
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
} else
}
else
{
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
}
} else if (currentColumn.trim().equalsIgnoreCase("cust_code"))
//Change by Pooja S.Start
String sitecode1 = checkNull(genericUtility.getColumnValue("site_code", dom));
if(sitecode1==null || "".equals(sitecode1)||sitecode1.trim().length() == 0)
{
sitecode1 = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.print("value of sitecode " + sitecode1);
valueXmlString.append("<site_code><![CDATA[" + sitecode1 + "]]></site_code>");
}
}
//Change by Pooja S.End
else if (currentColumn.trim().equalsIgnoreCase("cust_code"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
......@@ -1916,8 +1942,8 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<cust_code__bil><![CDATA[" + custCode + "]]></cust_code__bil>");
valueXmlString.append("<group_code><![CDATA[" + custCode + "]]></group_code>");
// }
} else if (currentColumn.trim().equalsIgnoreCase("stan_code"))
}
else if (currentColumn.trim().equalsIgnoreCase("stan_code"))
{
stanCode = checkNull(genericUtility.getColumnValue("stan_code", dom));
sql = "select state_code, city, pin from station where stan_code = ?";
......@@ -1934,7 +1960,6 @@ implements CustomerLocal, CustomerRemote
rs = null;
pstmt.close();
pstmt = null;
if (lsStateCode != null && lsStateCode.trim().length() > 0)
{
sql1 = "select count_code from state where state_code =?";
......@@ -1950,7 +1975,6 @@ implements CustomerLocal, CustomerRemote
pstmt1.close();
pstmt1 = null;
}
if (countCode != null && countCode.trim().length() > 0)
{
sql2 = "select curr_code from country where count_code =?";
......@@ -1966,29 +1990,29 @@ implements CustomerLocal, CustomerRemote
pstmt2.close();
pstmt2 = null;
}
valueXmlString.append("<state_code><![CDATA[" + lsStateCode + "]]></state_code>");
valueXmlString.append("<count_code><![CDATA[" + countCode + "]]></count_code>");
valueXmlString.append("<curr_code><![CDATA[" + currCode + "]]></curr_code>");
} else if (currentColumn.trim().equalsIgnoreCase("cust_name"))
}
else if (currentColumn.trim().equalsIgnoreCase("cust_name"))
{
custName = checkNull(genericUtility.getColumnValue("cust_name", dom));
chqName = checkNull(genericUtility.getColumnValue("chq_name", dom));
if (chqName == null || chqName.trim().length() <= 0)
if (chqName == null || chqName.trim().length() <= 0)
{
valueXmlString.append("<chq_name><![CDATA[" + custName + "]]></chq_name>");
}
} else if (currentColumn.trim().equalsIgnoreCase("terr_code"))
}
else if (currentColumn.trim().equalsIgnoreCase("terr_code"))
{
terrCode = checkNull(genericUtility.getColumnValue("terr_code", dom));
if (terrCode != null && terrCode.trim().length() > 0)
if (terrCode != null && terrCode.trim().length() > 0)
{
sql = "select descr from territory where terr_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, terrCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
terrDesc = checkNull(rs.getString("descr"));
}
......@@ -1997,9 +2021,9 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
}
valueXmlString.append("<territory_descr><![CDATA[" + terrDesc + "]]></territory_descr>");
} else if (currentColumn.trim().equalsIgnoreCase("sales_pers"))
}
else if (currentColumn.trim().equalsIgnoreCase("sales_pers"))
{
salesPers = checkNull(genericUtility.getColumnValue("sales_pers", dom));
sql = "select sp_name from sales_pers where sales_pers=?";
......@@ -2015,7 +2039,8 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
valueXmlString.append("<sp_name><![CDATA[" + spName + "]]></sp_name>");
} else if (currentColumn.trim().equalsIgnoreCase("contact_code"))
}
else if (currentColumn.trim().equalsIgnoreCase("contact_code"))
{
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
......@@ -2023,7 +2048,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
name = checkNull(rs.getString("name"));
shName = checkNull(rs.getString("sh_name"));
......@@ -2059,19 +2084,19 @@ implements CustomerLocal, CustomerRemote
contPfx1 = checkNull(genericUtility.getColumnValue("cont_pfx", dom));
if (contPfx1 == null || contPfx1.trim().length() <= 0)
if (contPfx1 == null || contPfx1.trim().length() <= 0)
{
valueXmlString.append("<cont_pfx><![CDATA[" + contPfx + "]]></cont_pfx>");
}
contPers1 = checkNull(genericUtility.getColumnValue("cont_pers", dom));
if (contPers1 == null || contPers1.trim().length() <= 0)
if (contPers1 == null || contPers1.trim().length() <= 0)
{
valueXmlString.append("<cont_pers><![CDATA[" + contPers + "]]></cont_pers>");
}
Add1 = checkNull(genericUtility.getColumnValue("addr1", dom));
if (Add1 == null || Add1.trim().length() <= 0)
if (Add1 == null || Add1.trim().length() <= 0)
{
valueXmlString.append("<addr1><![CDATA[" + addr1 + "]]></addr1>");
valueXmlString.append("<addr2><![CDATA[" + addr2 + "]]></addr2>");
......@@ -2098,7 +2123,7 @@ implements CustomerLocal, CustomerRemote
}
ediAddr1 = checkNull(genericUtility.getColumnValue("edi_addr", dom));
if (ediAddr1 == null || ediAddr1.trim().length() <= 0)
if (ediAddr1 == null || ediAddr1.trim().length() <= 0)
{
valueXmlString.append("<edi_addr ><![CDATA[" + ediAddr + "]]></edi_addr>");
}
......@@ -2116,14 +2141,14 @@ implements CustomerLocal, CustomerRemote
pstmt2.close();
pstmt2 = null;
if (custCode == null && !(keyFlag.equalsIgnoreCase("A")))
if (custCode == null && !(keyFlag.equalsIgnoreCase("A")))
{
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<cust_code ><![CDATA[" + contactCode + "]]></cust_code>");
}
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
if (custCodeBill == null || custCodeBill.trim().length() <= 0)
if (custCodeBill == null || custCodeBill.trim().length() <= 0)
{
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<cust_code__bil ><![CDATA[" + contactCode + "]]></cust_code__bil>");
......@@ -2132,7 +2157,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
custName = checkNull(rs.getString("cust_name"));
}
......@@ -2148,7 +2173,7 @@ implements CustomerLocal, CustomerRemote
}
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
if (groupCode == null || groupCode.trim().length() <= 0)
if (groupCode == null || groupCode.trim().length() <= 0)
{
contactCode = checkNull(genericUtility.getColumnValue("contact_code", dom));
valueXmlString.append("<group_code ><![CDATA[" + contactCode + "]]></group_code>");
......@@ -2157,7 +2182,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contactCode);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
custName = checkNull(rs.getString("cust_name"));
}
......@@ -2171,7 +2196,8 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>");
}
}
} else if (currentColumn.trim().equalsIgnoreCase("bank_code"))
}
else if (currentColumn.trim().equalsIgnoreCase("bank_code"))
{
bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom));
......@@ -2189,7 +2215,8 @@ implements CustomerLocal, CustomerRemote
pstmt = null;
valueXmlString.append("<bank_name ><![CDATA[" + bankName + "]]></bank_name>");
} else if (currentColumn.trim().equalsIgnoreCase("channel_partner"))
}
else if (currentColumn.trim().equalsIgnoreCase("channel_partner"))
{
channelPartner = checkNull(genericUtility.getColumnValue("channel_partner", dom));
......@@ -2198,18 +2225,20 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<site_code protect = \"0\"><![CDATA[]]></site_code>");
valueXmlString.append("<fin_link protect = \"0\"><![CDATA[]]></fin_link>");
valueXmlString.append("<dis_link protect = \"0\"><![CDATA[]]></dis_link>");
} else
}
else
{
valueXmlString.append("<site_code protect = \"1\"><![CDATA[" + nullVarr + "]]></site_code>");
valueXmlString.append("<fin_link protect = \"1\"><![CDATA[" + nullVarr + "]]></fin_link>");
valueXmlString.append("<dis_link protect = \"1\"><![CDATA[" + nullVarr + "]]></dis_link>");
}
} else if (currentColumn.trim().equalsIgnoreCase("black_listed"))
}
else if (currentColumn.trim().equalsIgnoreCase("black_listed"))
{
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
System.out.println("black_listed :- " + lsBKListed);
if (lsBKListed.equalsIgnoreCase("N"))
if (lsBKListed.equalsIgnoreCase("N"))
{
valueXmlString.append("<black_listed_date protect = \"1\"><![CDATA[" + ldDate + "]]></black_listed_date>");
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
......@@ -2219,7 +2248,8 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<black_listed_date protect = \"0\"><![CDATA[]]></black_listed_date>");
valueXmlString.append("<reas_code__bklist protect = \"0\"><![CDATA[]]></reas_code__bklist>");
}
} else if (currentColumn.trim().equalsIgnoreCase("reas_code__bklist"))
}
else if (currentColumn.trim().equalsIgnoreCase("reas_code__bklist"))
{
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
......@@ -2237,7 +2267,8 @@ implements CustomerLocal, CustomerRemote
pstmt = null;
valueXmlString.append("<bklist_reason >").append("<![CDATA[" + lsDescr + "]]>").append("</bklist_reason>");
} else if (currentColumn.trim().equalsIgnoreCase("cr_term"))
}
else if (currentColumn.trim().equalsIgnoreCase("cr_term"))
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
......@@ -2245,7 +2276,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
crDays = checkNull(rs.getString("cr_days"));
}
......@@ -2255,18 +2286,21 @@ implements CustomerLocal, CustomerRemote
pstmt = null;
valueXmlString.append("<credit_prd ><![CDATA[" + crDays + "]]></credit_prd>");
} else if (currentColumn.trim().equalsIgnoreCase("rate_round"))
}
else if (currentColumn.trim().equalsIgnoreCase("rate_round"))
{
rateRound = checkNull(this.genericUtility.getColumnValue("rate_round", dom));
if (rateRound.equalsIgnoreCase("N"))
if (rateRound.equalsIgnoreCase("N"))
{
valueXmlString.append("<rate_round_to protect = \"1\"><![CDATA[]]></rate_round_to>");
} else
}
else
{
valueXmlString.append("<rate_round_to protect = \"0\"><![CDATA[]]></rate_round_to>");
}
} else if (currentColumn.trim().equalsIgnoreCase("group_code"))
}
else if (currentColumn.trim().equalsIgnoreCase("group_code"))
{
groupCode = checkNull(genericUtility.getColumnValue("group_code", dom));
......@@ -2284,8 +2318,8 @@ implements CustomerLocal, CustomerRemote
pstmt = null;
valueXmlString.append("<customer_cust_name ><![CDATA[" + custName + "]]></customer_cust_name>");
} else if (currentColumn.trim().equalsIgnoreCase("cust_code__bil"))
{
}
else if (currentColumn.trim().equalsIgnoreCase("cust_code__bil")) {
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
sql = "select cust_name from customer where cust_code =?";
......@@ -2302,7 +2336,8 @@ implements CustomerLocal, CustomerRemote
pstmt = null;
valueXmlString.append("<customer_cust_name_1 ><![CDATA[" + custName + "]]></customer_cust_name_1>");
} else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord"))
}
else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord"))
{
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
if (empCodeOrd != null)
......@@ -2311,7 +2346,7 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname"));
......@@ -2326,16 +2361,17 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<emp_lname ><![CDATA[" + empLname + "]]></emp_lname>");
valueXmlString.append("<dept_code ><![CDATA[" + deptCode + "]]></dept_code>");
}
} else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord1"))
}
else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord1"))
{
empCodeOrd1 = checkNull(genericUtility.getColumnValue("emp_code__ord1", dom));
if (empCodeOrd1 != null)
if (empCodeOrd1 != null)
{
sql = "select emp_fname,emp_lname,dept_code from employee where emp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd1);
rs = pstmt.executeQuery();
if (rs.next())
if (rs.next())
{
empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname"));
......@@ -2351,6 +2387,117 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("<dept_code ><![CDATA[" + deptCode + "]]></dept_code>");
}
}
//Added by Pooja S. Start
else if (currentColumn.trim().equalsIgnoreCase("cust_type"))
{
custType = checkNull(genericUtility.getColumnValue("cust_type", dom));
sql = "select * from Customer_default where cust_type = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custType);
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
ResultSet rset = null;
PreparedStatement pstm = null;
while (rs.next())
{
for (int i = 1; i <= columnCount; i++)
{
colName = rsmd.getColumnName(i).toLowerCase();
colValue = checkNull(rs.getString(colName));
if (colName.equals("site_code__pay"))
{
if (colValue == null || colValue.trim().length() == 0)
{
siteCodePay = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodePay + "]]>").append("</" + colName + ">");
}
}
/*else if (colName.equals("part_Qty"))
{
if (colValue == null || colValue.trim().length() == 0)
{
partQty = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + partQty + "]]>").append("</" + colName + ">");
}
}*/
else if (colName.equals("site_code__rcp"))
{
if (colValue == null || colValue.trim().length() == 0)
{
siteCodeRcp = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + siteCodeRcp + "]]>").append("</" + colName + ">");
}
}
else if (colName.equals("curr_code"))
{
if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0)))
{
String countCode2 = checkNull(genericUtility.getColumnValue("count_code", dom));
String stateCode1 = checkNull(genericUtility.getColumnValue("state_code", dom));
sql = "select curr_code from COUNTRY where count_code =? and state_code=?";
pstm = conn.prepareStatement(sql);
pstm.setString(1, countCode2);
pstm.setString(2, stateCode1);
rset = pstm.executeQuery();
if (rset.next())
{
currCode2 = checkNull(rset.getString("curr_code"));
valueXmlString.append("<curr_code ><![CDATA[" + currCode2 + "]]></curr_code>");
}
rset.close();
rset = null;
pstm.close();
pstm = null;
}
}
else if (colName.equals("price_list"))
{
System.out.print("Value colvalue5 \n [" + colValue + "]");
if (colValue == null || (colValue != null && (colValue.equals("") || colValue.trim().length() == 0)))
{
String countCode3 = checkNull(genericUtility.getColumnValue("count_code", dom));
String stateCode1 = checkNull(genericUtility.getColumnValue("state_code", dom));
sql = "select price_list from STATE where count_code =? and state_code=?";
pstm = conn.prepareStatement(sql);
pstm.setString(1, countCode3);
pstm.setString(2, stateCode1);
rset = pstm.executeQuery();
if (rset.next())
{
priceList = checkNull(rset.getString("price_list"));
valueXmlString.append("<price_list ><![CDATA[" + priceList + "]]></price_list>");
valueXmlString.append("<price_list__disc ><![CDATA[" + priceList + "]]></price_list__disc>");
}
rset.close();
rset = null;
pstm.close();
pstm = null;
}
}
else
{
valueXmlString.append("<" + colName + ">").append("<![CDATA[" + colValue + "]]>").append("</" + colName + ">");
}
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if (currentColumn.trim().equalsIgnoreCase("full_name"))
{
String fullName1 = checkNull(genericUtility.getColumnValue("full_name", dom));
if (fullName1 != null)
{
valueXmlString.append("<chq_name ><![CDATA[" + fullName1 + "]]></chq_name>");
valueXmlString.append("<eng_name ><![CDATA[" + fullName1 + "]]></eng_name>");
}
}
//Added by Pooja S. End
valueXmlString.append("</Detail1>");
break;
case 2:
......@@ -2359,8 +2506,7 @@ implements CustomerLocal, CustomerRemote
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength();
do
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
......@@ -2395,16 +2541,18 @@ implements CustomerLocal, CustomerRemote
valueXmlString.append("</Detail2>");
}
valueXmlString.append("</Root>");
} catch (Exception e)
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception ::" + e.getMessage());
throw new ITMException(e);
} finally
}
finally
{
try
try
{
if (conn != null)
if (conn != null)
{
if (pstmt != null)
pstmt.close();
......@@ -2415,7 +2563,8 @@ implements CustomerLocal, CustomerRemote
conn.close();
conn = null;
}
} catch (Exception d)
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
......@@ -2424,28 +2573,29 @@ implements CustomerLocal, CustomerRemote
return valueXmlString.toString();
}
private String checkNull(String str)
private String checkNull(String str)
{
if (str == null)
{
return "";
} else
}
else
{
return str;
}
}
private double checkDoubleNull(String str)
private double checkDoubleNull(String str)
{
if (str == null || str.trim().length() == 0)
{
return 0.0;
} else
}
else
{
return Double.parseDouble(str);
}
}
private String errorType(Connection conn, String errorCode) throws ITMException
{
......@@ -2458,16 +2608,16 @@ implements CustomerLocal, CustomerRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
while (rs.next())
while (rs.next())
{
msgType = rs.getString("MSG_TYPE");
}
} catch (Exception ex)
}
catch (Exception ex)
{
ex.printStackTrace();
try
{
if (rs != null)
try {
if (rs != null)
{
rs.close();
rs = null;
......@@ -2477,21 +2627,22 @@ implements CustomerLocal, CustomerRemote
pstmt.close();
pstmt = null;
}
} catch (Exception e)
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
} finally
}
finally
{
try
try
{
if (rs != null)
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
if (pstmt != null)
{
pstmt.close();
pstmt = null;
......@@ -2504,4 +2655,4 @@ implements CustomerLocal, CustomerRemote
}
return msgType;
}
}
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.utility.GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
/**
* Session Bean implementation class CustomerDefaultEJB
*/
@Stateless
public class CustomerDefaultEJB extends ValidatorEJB implements CustomerDefaultRemote, CustomerDefaultLocal {
private GenericUtility genericUtility = GenericUtility.getInstance();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
String errString = "";
Document dom = null;
Document dom1 = null;
Document dom2 = null;
try {
if (xmlString != null && xmlString.trim().length() > 0) {
dom = parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() > 0) {
dom1 = parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length() > 0) {
dom2 = parseString("<Root>" + xmlString2 + "</Root>");
}
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
} catch (Exception e) {
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
StringBuffer valueXmlString = new StringBuffer();
String userId = "";
String sql = "";
String errCode = "";
String errorType = "";
String errString = "";
String tranId = "";
String custCode = "", ignoreCredit = "", ignoreDays = "", acctCodeAdv = "", cctrCodeAdv = "", groupCode = "",
custCodeBil = "", stanCode = "", terrCode = "";
String stateCode = "", countCode = "", crTerm = "", currCode = "", currCode1 = "", acctCodeAr = "",
cctrCodeAr = "", taxClass = "", taxChap = "", priceList = "";
String salesPers = "", tranCode = "", siteCodeRcp = "", siteCode = "", channelPartner = "", blackListing = "",
contactCode = "", bankCode = "", priceListDisc = "";
String salesOption = "", dlvTerm = "", lossPerc = "", adhocReplPerc = "", termTableNo = "", priceListClg = "",
salesPers1 = "", salesPers2 = "";
String keyFlag = "", active = "", lsVal3 = "", empCodeOrd = "", empCodeOrd1 = "", custCodePd = "",
custCodeDisc = "", sgroupCode = "", custCodeAr = "", currCodeFrt = "";
String blankVar = "", custName = "", shName = "", availableYn = "", creditLmt = "", round = "", roundTo = "",
currCodeIns = "";
String regCode = "", validUpto = "", regDate = "";
int ctr = 0;
int currentFormNo = 0;
int cnt = 0, cnt1 = 0;
ArrayList errList = new ArrayList();
ArrayList errFields = new ArrayList();
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String commTable = "";// changed by Nasruddin [19/JUL/16 ]
String discList = "";
try {
// Changes and Commented By Bhushan on 09-06-2016 :START
// conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
// Changes and Commented By Bhushan on 09-06-2016 :END
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if ((objContext != null) && (objContext.trim().length() > 0)) {
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
int childNodeListLength = childNodeList.getLength();
tranId = checkNull(this.genericUtility.getColumnValue("tran_id", dom));
System.out.println("tran id from boqdet --4-->>>>[" + tranId + "]");
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("cust_priority"))
{
String custPriority = checkNull(genericUtility.getColumnValue("cust_priority", dom));
/*
* System.out.println("custPriority======>>"+custPriority);
* System.out.println("custPriority length======>>"+custPriority.length());
*/
if (custPriority.length() > 1)
{
// System.out.println("custPriority found larger value--------->>");
errCode = "VMCUSTPRIT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (!custPriority.matches("[0-9A-Za-z-]+"))
{
// System.out.println("Special character found for custPriority ---------");
errCode = "VMCUSTINVD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
else if (childNodeName.equalsIgnoreCase("ignore_credit"))
{
ignoreCredit = checkNull(genericUtility.getColumnValue("ignore_credit", dom));
cnt = 0;
if (ignoreCredit != null && ignoreCredit.trim().length() > 0)
{
cnt = Integer.parseInt(ignoreCredit.trim());
if (cnt < 0)
{
errCode = "VMIGCRT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
{
errCode = "VMIGCRTNLL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("ignore_days"))
{
ignoreDays = checkNull(genericUtility.getColumnValue("ignore_days", dom));
cnt = 0;
if (ignoreDays != null && ignoreDays.trim().length() > 0)
{
cnt = Integer.parseInt(ignoreDays.trim());
if (cnt < 0)
{
errCode = "VMCRDYS";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("acct_code__adv"))
{
acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom));
// if (acctCodeAdv != null)
// {
cnt = 0;
sql = "select count(*) as cnt from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt != 0)
{
sql = "select active from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
{
active = rs.getString("active");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (!active.equalsIgnoreCase("Y"))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("cctr_code__adv"))
{
cctrCodeAdv = checkNull(genericUtility.getColumnValue("cctr_code__adv", dom));
cnt = 0;
if (cctrCodeAdv != null && cctrCodeAdv.trim().length() > 0)
{
sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAdv);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTCCTRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("cr_term"))
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
if (crTerm != null && crTerm.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from crterm where cr_term =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTCRTERM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("curr_code"))
{
currCode = checkNull(genericUtility.getColumnValue("curr_code", dom));
cnt = 0;
sql = "select count(*) as cnt from currency where curr_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTCURRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if (editFlag.equalsIgnoreCase("E"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
sql = "select curr_code from customer where cust_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next())
{
currCode1 = rs.getString("curr_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (!currCode.equalsIgnoreCase(currCode1) && currCode1 != null)
{
lsVal3 = "C";
cnt = 0;
sql = "select count(distinct curr_code__ac) as ll_count from sundrybal"
+ " where sundry_code =?" + " and sundry_type =?"
+ " and (dr_amt != 0 or cr_amt != 0)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, lsVal3);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("ll_count");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
cnt1 = 0;
sql = "select count(*) as cnt from sundrybal" + " where sundry_code = ?"
+ " and sundry_type = ?" + " and (dr_amt != 0 or cr_amt != 0)"
+ " and curr_code__ac = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, lsVal3);
pstmt.setString(3, currCode1);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt1 = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt1 != 0 && cnt > 1)
{
errCode = "VXCURRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
}
else if (childNodeName.equalsIgnoreCase("acct_code__ar"))
{
acctCodeAr = checkNull(genericUtility.getColumnValue("acct_code__ar", dom));
if (acctCodeAr != null && acctCodeAr.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from accounts where acct_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt != 0)
{
sql = "select active from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
{
active = rs.getString("active");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (!"Y".equalsIgnoreCase(active))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if (childNodeName.equalsIgnoreCase("cctr_code__ar"))
{
cctrCodeAr = checkNull(genericUtility.getColumnValue("cctr_code__ar", dom));
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAr);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTCCTRCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("tax_class"))
{
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
if (taxClass != null && taxClass.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from taxclass where tax_class =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxClass);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTTAXCLA1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("tax_chap"))
{
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
if (taxChap != null && taxChap.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from taxchap where tax_chap =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxChap);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTTAXCHAP1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("price_list"))
{
priceList = checkNull(genericUtility.getColumnValue("price_list", dom));
if (priceList != null && priceList.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from pricelist_mst where price_list =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, priceList);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTPLIST1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("price_list__clg"))
{
priceListClg = checkNull(genericUtility.getColumnValue("price_list__clg", dom));
if (priceListClg != null && priceListClg.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from pricelist_mst where price_list =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, priceListClg);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTPLIST1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("tran_code"))
{
tranCode = checkNull(genericUtility.getColumnValue("tran_code", dom));
if (tranCode != null && tranCode.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from transporter where tran_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTTRANCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("site_code__rcp"))
{
siteCodeRcp = checkNull(genericUtility.getColumnValue("site_code__rcp", dom));
if (siteCodeRcp != null && siteCodeRcp.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from site where site_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeRcp);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTSITECD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("sales_option"))
{
salesOption = checkNull(genericUtility.getColumnValue("sales_option", dom));
if (salesOption == null || salesOption.trim().length() <= 0)
{
errCode = "VTSLOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("dlv_term"))
{
dlvTerm = checkNull(genericUtility.getColumnValue("dlv_term", dom));
System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@" + dlvTerm);
if (dlvTerm != null && dlvTerm.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from delivery_term where dlv_term =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, dlvTerm);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VMDLVTERM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc"))
{
adhocReplPerc = checkNull(genericUtility.getColumnValue("adhoc_repl_perc", dom));
double adhocvalue = 0.00;
if (adhocReplPerc != null && adhocReplPerc.trim().length() > 0)
{
adhocvalue = Double.valueOf(adhocReplPerc.trim());
// cnt1=Integer.parseInt(adhocReplPerc.trim());
// if(cnt1<0 || cnt1>100){
if (adhocvalue < 0 || adhocvalue > 100)
{
errCode = "VTADH";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("term_table__no"))
{
termTableNo = checkNull(genericUtility.getColumnValue("term_table__no", dom));
// if( termTableNo != null) Changed By Nasruddin [16-sep-16]
if (termTableNo != null && termTableNo.trim().length() > 0)
{
sql = "select count(1) as cnt from sale_term_table where term_table = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, termTableNo);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VMSALETERM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("emp_code__ord"))
{
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
if (empCodeOrd != null && empCodeOrd.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from employee where emp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VMEMPORD2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("emp_code__ord1"))
{
empCodeOrd1 = checkNull(genericUtility.getColumnValue("emp_code__ord1", dom));
if (empCodeOrd1 != null && empCodeOrd1.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from employee where emp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeOrd1);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VMEMPORD2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
valueXmlString.append("</Detail1>");
break;
}
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
if ((errList != null) && (errListSize > 0))
{
for (cnt = 0; cnt < errListSize; cnt++)
{
errCode = (String) errList.get(cnt);
errFldName = (String) errFields.get(cnt);
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
{
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8,
errString.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8,
errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
errString = "";
}
if (errorType.equalsIgnoreCase("E"))
{
break;
}
}
errStringXml.append("</Errors> </Root> \r\n");
}
else
{
errStringXml = new StringBuffer("");
}
}
catch (Exception e) {
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
try
{
if (conn != null)
{
conn.close();
conn = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
errString = errStringXml.toString();
return errString;
}
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0)
{
dom2 = parseString(xmlString2);
}
System.out.println("HELLO1 PRINT");
valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
System.out.println("valueXmlString[" + valueXmlString + "]");
}
catch (Exception e)
{
System.out.println("Exception : [MiscVal][itemChanged( String, String )] :==>\n" + e.getMessage());
throw new ITMException(e);
}
System.out.println("VALUE HELLO PRINTA[" + valueXmlString + "]");
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
String sql = "", sql1 = "", sql2 = "";
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
PreparedStatement pstmt2 = null;
ResultSet rs = null;
ResultSet rs1 = null;
ResultSet rs2 = null;
System.out.println("currentColumn [" + currentColumn + "]");
String colName = "", colValue = "", fullName = "", siteCode1 = "";
String custType = "", priceList = "", countCode1 = "", priceList1 = "", siteCodePay = "", partQty = "",
siteCode = "", siteCodeRcp = "", priceListDisc = "";
String resBKList = "", lsDescr = "", lsBKListed = "";
String lsNull = "", nullVarr = "", ldDate = "";
String custCodeBill = "", custCode = "", stanCode = "", currCode = "", countCode = "", currCode2 = "";
String lsStateCode = "", lsCity = "", lsPin = "";
String custName = "", chqName = "", terrCode = "", terrDesc = "", salesPers = "", spName = "", contactCode = "",
groupCode = "";
String bankCode = "", bankName = "";
String channelPartner = "";
String crTerm = "", crDays = "";
String rateRound = "";
String name = "", shName = "", contPers = "", contPfx = "", addr1 = "", addr2 = "", addr3 = "", stateCode = "",
tele1 = "", tele2 = "", tele3 = "", teleExt = "", fax = "", emailAddr = "", ediAddr = "";
String contPfx1 = "", contPers1 = "", Add1 = "", emailAddr1 = "", ediAddr1 = "", keyFlag = "";
String regCode = "", regDescr = "", empCodeOrd = "", empFname = "", empLname = "", empCodeOrd1 = "",
deptCode = "";
int ctr = 0;
int currentFormNo = 0;
java.util.Date reqDate = null;
int childNodeListLength = 0;
java.util.Date statusDate = null;
ArrayList errList = new ArrayList();
ArrayList errFields = new ArrayList();
SimpleDateFormat sdf;
StringBuffer valueXmlString = new StringBuffer();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
ConnDriver connDriver = new ConnDriver();
try
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
// Changes and Commented By Bhushan on 09-06-2016 :START
// conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
// Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if ((objContext != null) && (objContext.trim().length() > 0))
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equals(currentColumn))
{
childNode.getFirstChild();
}
ctr++;
} while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println("CURRENT COLUMN [" + currentColumn + "]");
if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, resBKList);
rs = pstmt.executeQuery();
if (rs.next())
{
lsDescr = checkNull(rs.getString("descr"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if (lsBKListed.equalsIgnoreCase("N"))
{
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
}
else
{
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
}
}
else if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{
resBKList = checkNull(genericUtility.getColumnValue("reas_code__bklist", dom));
sql = "select descr from gencodes where fld_name = 'REAS_CODE__BKLIST' " + "and fld_value = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, resBKList);
rs = pstmt.executeQuery();
if (rs.next())
{
lsDescr = checkNull(rs.getString("descr"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<bklist_reason ><![CDATA[" + lsDescr + "]]></bklist_reason>");
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
if ("N".equalsIgnoreCase(lsBKListed))
{
valueXmlString.append("<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString.append("<bklist_reason ><![CDATA[" + lsNull + "]]></bklist_reason>");
}
else
{
valueXmlString.append("<reas_code__bklist><![CDATA[" + lsNull + "]]></reas_code__bklist>");
}
}
else if (currentColumn.trim().equalsIgnoreCase("channel_partner"))
{
channelPartner = checkNull(genericUtility.getColumnValue("channel_partner", dom));
if (channelPartner.equalsIgnoreCase("Y"))
{
valueXmlString.append("<site_code protect = \"0\"><![CDATA[]]></site_code>");
valueXmlString.append("<fin_link protect = \"0\"><![CDATA[]]></fin_link>");
valueXmlString.append("<dis_link protect = \"0\"><![CDATA[]]></dis_link>");
}
else
{
valueXmlString.append("<site_code protect = \"1\"><![CDATA[" + nullVarr + "]]></site_code>");
valueXmlString.append("<fin_link protect = \"1\"><![CDATA[" + nullVarr + "]]></fin_link>");
valueXmlString.append("<dis_link protect = \"1\"><![CDATA[" + nullVarr + "]]></dis_link>");
}
}
else if (currentColumn.trim().equalsIgnoreCase("black_listed"))
{
lsBKListed = checkNull(genericUtility.getColumnValue("black_listed", dom));
System.out.println("black_listed :- " + lsBKListed);
if (lsBKListed.equalsIgnoreCase("N"))
{
valueXmlString.append(
"<black_listed_date protect = \"1\"><![CDATA[" + ldDate + "]]></black_listed_date>");
valueXmlString.append(
"<reas_code__bklist protect = \"1\"><![CDATA[" + lsNull + "]]></reas_code__bklist>");
valueXmlString
.append("<bklist_reason protect = \"1\"><![CDATA[" + lsNull + "]]></bklist_reason>");
}
else
{
valueXmlString.append("<black_listed_date protect = \"0\"><![CDATA[]]></black_listed_date>");
valueXmlString.append("<reas_code__bklist protect = \"0\"><![CDATA[]]></reas_code__bklist>");
}
}
else if (currentColumn.trim().equalsIgnoreCase("cr_term"))
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
sql = "select cr_days from crterm where cr_term =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, crTerm);
rs = pstmt.executeQuery();
if (rs.next())
{
crDays = checkNull(rs.getString("cr_days"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<credit_prd ><![CDATA[" + crDays + "]]></credit_prd>");
}
else if (currentColumn.trim().equalsIgnoreCase("rate_round"))
{
rateRound = checkNull(this.genericUtility.getColumnValue("rate_round", dom));
if (rateRound.equalsIgnoreCase("N"))
{
valueXmlString.append("<rate_round_to protect = \"1\"><![CDATA[]]></rate_round_to>");
}
else
{
valueXmlString.append("<rate_round_to protect = \"0\"><![CDATA[]]></rate_round_to>");
}
}
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception ::" + e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if (conn != null)
{
if (pstmt != null)
pstmt.close();
if (rs != null)
rs.close();
rs = null;
pstmt = null;
conn.close();
conn = null;
}
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
return valueXmlString.toString();
}
private String checkNull(String str)
{
if (str == null)
{
return "";
}
else
{
return str;
}
}
private double checkDoubleNull(String str)
{
if (str == null || str.trim().length() == 0)
{
return 0.0;
}
else
{
return Double.parseDouble(str);
}
}
private String errorType(Connection conn, String errorCode) throws ITMException
{
String msgType = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
String sql = "SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
while (rs.next())
{
msgType = rs.getString("MSG_TYPE");
}
}
catch (Exception ex)
{
ex.printStackTrace();
try {
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return msgType;
}
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface CustomerDefaultLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlStringHdr, String xmlStringAll, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document domHdr, Document domAll, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlStringHdr, String xmlStringAll, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
}
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface CustomerDefaultRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlStringHdr, String xmlStringAll, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document domHdr, Document domAll, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlStringHdr, String xmlStringAll, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
}
-- 1) obj_forms
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,SCAN_DELIMITER,AUTO_ACCEPT_WEIGHDATA,ASSISTED_MODE,PARENT_KEY_COL,FORM_TYPE,DISP_METADATA,SELECTION_MODE,DEFAULT_VIEW,STORAGE_KEY_METADATA,QTY_COL,RATE_COL,AUTO_ADDON_ENTRY,FREEZE_COL_POS,DEFAULT_ROW_CNT,IS_MANDATORY,TRAN_ID_COL,SELECTION_OPT,KEY_INFO,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,FORM_NAME,FORM_ICON,FORM_VIEW_OPTS,DUPLICATE_ADD,Y_COLUMN,X_COLUMN)
values ('w_customer_default','Customer default',null,null,null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
-- 2) Obj_Action entries
INSERT INTO OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE)
VALUES ('customer_default',1,'A','a','a','Add New Customer','Add','add~normal.gif','1','1','1','S');
INSERT INTO OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE)
VALUES ('customer_default',2,'E','a','a','Edit Details','Edit','edit~normal.gif','1','1','1','S');
-- 3)obj_itemchange
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','black_listed',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','channel_partner',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','itm_defaultedit',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','rate_round',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer_default','1','cr_term',null);
-- 4)Itm2menu
INSERT INTO itm2menu (application,level_1,level_2,level_3,level_4,level_5,win_name,descr, comments,menu_path,icon_path,obj_type) values('DIS',2,4,11,0,0,'w_customer_default','Customer default','Customer default','DIS.2.4.11.0.0','e12_logo.gif','T');
--5)SYSTEM_EVENTS
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('customer_default','post_item_change','1','poic_default_ejb',null,'0',to_date('15-07-18','DD-MM-RR'),'base ','base','2','JB','ibase.webitm.ejb.dis.CustomerDefaultEJB',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('customer_default','pre_validate','1','prv_default_ejb',null,'0',to_date('15-07-18','DD-MM-RR'),'base ','base','2','JB','ibase.webitm.ejb.dis.CustomerDefaultEJB',null);
-- 6)SYSTEM_EVENT_SERVICES
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('poic_default_ejb',null,'http://localhost:9090/axis/services/ValidatorService',null,'itemChanged','String','S',null,null,to_date('01-06-12','DD-MM-RR'),'Subrata ','Subu',null,null,null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('prv_default_ejb',null,'http://localhost:9090/axis/services/ProcessService',null,'wfValData','String','S',null,null,to_date('01-06-12','DD-MM-RR'),'Subrata ','Subu',null,null,null);
-- 7)SYSTEM_SERVICE_ARGS
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,null,null,null,'JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',3,'XML_DATA','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',4,'XML_DATA_1','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',7,'FOCUSED_COLUMN','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',8,'EDIT_FLAG','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',9,'XTRA_PARAMS','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar','JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',3,'XML_DATA','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',4,'XML_DATA_1','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',7,'EDIT_FLAG','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',8,'XTRA_PARAMS','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
--8)pophelp
Insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION,POPUP_XSL_NAME,AUTO_FILL_LEN,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,AUTO_MIN_LENGTH,OBJ_NAME__DS,DATA_MODEL_NAME,VALIDATE_DATA,ITEM_CHANGE,MSG_NO,LAYOUT,FILTER_EXPR) values ('ORDER_TYPE','W_CUSTOMER_DEFAULT','select order_type ,descr from sordertype',null,'Order Type',0,0,sysdate,'ES001 ','localhost.local','0',null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION,POPUP_XSL_NAME,AUTO_FILL_LEN,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,AUTO_MIN_LENGTH,OBJ_NAME__DS,DATA_MODEL_NAME,VALIDATE_DATA,ITEM_CHANGE,MSG_NO,LAYOUT,FILTER_EXPR) values ('REAS_CODE__BKLIST','W_CUSTOMER_DEFAULT','select fld_value,descr from gencodes where fld_name = ''REAS_CODE__BKLIST'' and mod_name=''W_CUSTOMER''',null,'REASON CODE ',0,0,to_date('18-03-16','DD-MM-RR'),'EA001 ','localhost.local','0',null,null,1,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
......@@ -2,17 +2,17 @@
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', comp_type = 'EJB', COMP_NAME = 'TaxBaseIC' where OBJ_NAME = 'taxbase' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', comp_type = 'EJB', COMP_NAME = 'TaxBaseIC' where OBJ_NAME = 'taxbase' and EVENT_CODE = 'pre_validate';
insert into obj_itemchange (obj_name,form_no,field_name,mandatory) values ('taxbase','2 ','itm_defaultedit',null);
commit;
commit;
--tax environment--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', comp_type = 'EJB', COMP_NAME = 'TaxEnvIC' where OBJ_NAME = 'taxenv' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', comp_type = 'EJB', COMP_NAME = 'TaxEnvIC' where OBJ_NAME = 'taxenv' and EVENT_CODE = 'pre_validate';
commit;
commit;
--insurance agent--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', comp_type = 'EJB', COMP_NAME = 'InsuranceAgentIC' where OBJ_NAME = 'insurance_agent' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', comp_type = 'EJB', COMP_NAME = 'InsuranceAgentIC' where OBJ_NAME = 'insurance_agent' and EVENT_CODE = 'pre_validate';
commit;
commit;
---tax deferment---
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', comp_type = 'EJB', COMP_NAME = 'TaxDefermentIC' where OBJ_NAME = 'tax_deferment' and EVENT_CODE = 'post_item_change';
......@@ -21,40 +21,40 @@ insert into obj_itemchange (obj_name,form_no,field_name,mandatory) values ('tax_
commit;
---transporter mode--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'TransporterModeIC' where OBJ_NAME = 'transporter_mode' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'TransporterModeIC' where OBJ_NAME = 'transporter_mode' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', comp_type = 'EJB', COMP_NAME = 'TransporterModeIC' where OBJ_NAME = 'transporter_mode' and EVENT_CODE = 'pre_validate';
insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION,POPUP_XSL_NAME) values ('TRAN_CODE','W_TRANSPORTER_MODE','select tran_code,tran_name from transporter',null,'Transporters Code',0,0,sysdate,'SUN','HDP','1',null,null,null,null,null,null,null,null,null,'1',null);
commit;
commit;
--distribution order type--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'DistributionOrderTypeIC' where OBJ_NAME = 'distorder_type_mst' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'DistributionOrderTypeIC' where OBJ_NAME = 'distorder_type_mst' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'DistributionOrderTypeIC' where OBJ_NAME = 'distorder_type_mst' and EVENT_CODE = 'pre_validate';
commit;
commit;
--specification master--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'SpecificationMasterIC' where OBJ_NAME = 'spec_master' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'SpecificationMasterIC' where OBJ_NAME = 'spec_master' and EVENT_CODE = 'pre_validate';
commit;
commit;
--unit of measure--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'UnitOfMeasureIC' where OBJ_NAME = 'unit' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'UnitOfMeasureIC' where OBJ_NAME = 'unit' and EVENT_CODE = 'pre_validate';
commit;
commit;
--purchase terms--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PurchaseTermsIC' where OBJ_NAME = 'pur_term' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PurchaseTermsIC' where OBJ_NAME = 'pur_term' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PurchaseTermsIC' where OBJ_NAME = 'pur_term' and EVENT_CODE = 'pre_validate';
commit;
commit;
--sales return reason--
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'SalesReturnReasonIC' where OBJ_NAME = 'sreturn_reason' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'SalesReturnReasonIC' where OBJ_NAME = 'sreturn_reason' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'SalesReturnReasonIC' where OBJ_NAME = 'sreturn_reason' and EVENT_CODE = 'pre_validate';
insert into POPHELP (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGHT,CHG_DATE,CHG_USER,CHG_TERM,DIST_OPT,FILTER_STRING,SQL_INPUT,DEFAULT_COL,POP_ALIGN,QUERY_MODE,PAGE_CONTEXT,POPHELP_COLS,POPHELP_SOURCE,MULTI_OPT,HELP_OPTION,POPUP_XSL_NAME,AUTO_FILL_LEN) values ('REASON_CODE','W_SRETURN_REASON','SELECT REASON_CODE, REASON_DESCR FROM SRETURN_REASON',null,'Reason Master',0,0,TO_TIMESTAMP('02-MAY-16','DD-MON-RR HH.MI.SSXFF AM'),'BASE ','BASE ','0',null,null,null,null,null,null,null,null,null,'1',null,null);
commit;
commit;
--pricelist generation--
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PriceListTranIC' where OBJ_NAME = 'pricelist_tran' and EVENT_CODE = 'pre_validate';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PriceListTranIC' where OBJ_NAME = 'pricelist_tran' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prv_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PriceListTranIC' where OBJ_NAME = 'pricelist_tran' and EVENT_CODE = 'pre_validate';
update SYSTEM_EVENTS set SERVICE_CODE = 'poic_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PriceListTranIC' where OBJ_NAME = 'pricelist_tran' and EVENT_CODE = 'post_item_change';
update SYSTEM_EVENTS set SERVICE_CODE = 'prcm_default_ejb', COMP_TYPE = 'EJB', COMP_NAME = 'PriceListTranConf' where OBJ_NAME = 'pricelist_tran' and EVENT_CODE = 'pre_confirm';
commit;
......@@ -95,3 +95,7 @@ UPDATE TRANSETUP SET CANCEL_COL = 'status', CANCEL_VAL='C' WHERE TRAN_WINDOW='w_
commit;
---Transetup entry to show red tag after indent cancellation---[END]
---Customer master---[START] added by Pooja S on 23/08/18
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('customer','1','cust_type',null);
---Customer master---[END] added by Pooja S on 23/08/18
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