Commit e2abd8b9 authored by awarekar's avatar awarekar

sales budget wizard related implementation

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198607 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dcd0a043
package ibase.webitm.ejb.fin;
import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
import java.sql.*;
import ibase.utility.UserInfoBean;
import javax.servlet.http.HttpSession;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.*;
import ibase.webitm.utility.*;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
public class SalesBudgetCustWizBean implements Serializable
public class SalesBudgetCustWizBean
{
private ibase.utility.UserInfoBean userInfo = null;
private HttpSession sessionCtx = null;
private String objName = "";
private String user_lang ="en";
private String user_lang ="en";
private String user_country = "US";
public SalesBudgetCustWizBean( String objName, HttpSession sessionCtx ) throws ITMException
{
try
{
this.objName = objName;
this.sessionCtx = sessionCtx;
this.userInfo = ( ibase.utility.UserInfoBean ) this.sessionCtx.getAttribute("USER_INFO");
}
catch (Exception e)
{
throw new ITMException(e);
}
}
public SalesBudgetCustWizBean( String objName) throws ITMException
private E12GenericUtility genericUtility = new E12GenericUtility();
public SalesBudgetCustWizBean( String objName, UserInfoBean userInfo ) throws ITMException
{
try
{
this.objName = objName;
this.userInfo = userInfo;
}
catch (Exception e)
{
......@@ -51,30 +32,24 @@ public class SalesBudgetCustWizBean implements Serializable
}
}
public SalesBudgetCustWizBean() throws ITMException
{
System.out.println("==>x AM SalesBudgetCustWizBean constructor");
}
public UserInfoBean getUserInfo()
{
return this.userInfo;
}
public void setUserInfo(UserInfoBean userInfo)
{
this.userInfo = userInfo;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getCustCode( String selectedposCode) throws ITMException
{
String custCode= "";
Connection connectionObject = null;
try
{
connectionObject = getConnection();
custCode = getCusCode( selectedposCode); //sales_budget_cust_wiz1_wiz_en_US_A
custCode = getCusCode( selectedposCode ); //sales_budget_cust_wiz1_wiz_en_US_A
String xslFileName = getXSLFileName( "sales_budget_cust_custmr_code_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
custCode = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, custCode, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
custCode = genericUtility.transformToString( xslFileName, custCode, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
......@@ -82,40 +57,40 @@ public class SalesBudgetCustWizBean implements Serializable
}
finally
{
}
return custCode;
}
public String getCusCode( String selectedcusCode ) throws ITMException
private String getCusCode( String selectedCustCode ) throws ITMException
{
String csCode = selectedcusCode.toUpperCase();
String sql = "",custCode="";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
connectionObject = getConnection();
sql = "SELECT CUST_CODE,CUST_NAME FROM CUSTOMER WHERE CUST_NAME LIKE '"+csCode+"%' ";
selectedCustCode = (selectedCustCode != null) ? selectedCustCode.trim().toUpperCase() : selectedCustCode;
//sql = "SELECT CUST_CODE,CUST_NAME FROM CUSTOMER WHERE CUST_NAME LIKE '"+csCode+"%' ";
String sql = "SELECT CUST_CODE,CUST_NAME FROM CUSTOMER "
+ "WHERE (UPPER(CUST_CODE) LIKE UPPER('"+selectedCustCode+"%') OR UPPER(CUST_NAME) LIKE UPPER('"+selectedCustCode+"%'))";
pstmt = connectionObject.prepareStatement(sql);
//pstmt.setString( 1, custCode );
rs = pstmt.executeQuery();
int num = 1;
while (rs.next())
{
String cusCode = rs.getString("CUST_CODE");
String cusDescr = rs.getString("CUST_NAME");
csCode = (csCode != null) ? csCode.trim() : csCode;
cusCode = (cusCode != null) ? cusCode.trim() : cusCode;
cusDescr = (cusDescr != null) ? cusDescr.trim() : cusDescr;
if ( csCode.equals( cusCode ) )
String customerCode = rs.getString("CUST_CODE");
String custDescr = rs.getString("CUST_NAME");
customerCode = (customerCode != null) ? customerCode.trim() : customerCode;
custDescr = (custDescr != null) ? custDescr.trim() : custDescr;
if ( selectedCustCode.equals( customerCode ) )
{
valueXmlString.append("<CUSTOMER domID='" + num + "' selected = 'Y'>\r\n");
}
......@@ -124,11 +99,21 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("<CUSTOMER domID='" + num + "' selected = 'N'>\r\n");
}
valueXmlString.append("<CUST_CODE><![CDATA[").append( cusCode ).append("]]></CUST_CODE>\r\n");
valueXmlString.append("<CUST_NAME><![CDATA[").append( cusDescr ).append("]]></CUST_NAME>\r\n");
valueXmlString.append("<CUST_CODE><![CDATA[").append( customerCode ).append("]]></CUST_CODE>\r\n");
valueXmlString.append("<CUST_NAME><![CDATA[").append( custDescr ).append("]]></CUST_NAME>\r\n");
valueXmlString.append("</CUSTOMER>\r\n");
num++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
......@@ -139,12 +124,22 @@ public class SalesBudgetCustWizBean implements Serializable
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (connectionObject != null && !connectionObject.isClosed())
{
{
connectionObject.close();
connectionObject = null;
}
}
}
catch (Exception e)
{
throw new ITMException(e);
......@@ -153,19 +148,15 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</Root>\r\n");
return valueXmlString.toString();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getPosCode( String selectedposCode) throws ITMException
public String getPosCode( String selectedPosCode) throws ITMException
{
String posCode= "";
Connection connectionObject = null;
try
{
connectionObject = getConnection();
posCode = getPOS( selectedposCode); //sales_budget_cust_wiz1_wiz_en_US_A
posCode = getPOS( selectedPosCode); //sales_budget_cust_wiz1_wiz_en_US_A
String xslFileName = getXSLFileName( "sales_budget_cust_pos_code_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
posCode = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, posCode, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
posCode = genericUtility.transformToString( xslFileName, posCode, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
......@@ -173,21 +164,22 @@ public class SalesBudgetCustWizBean implements Serializable
}
finally
{
}
return posCode;
}
public String getPOS( String selectedposCode ) throws ITMException
private String getPOS( String selectedPosCode ) throws ITMException
{
String sql = "";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
selectedPosCode = (selectedPosCode != null) ? selectedPosCode.trim() : selectedPosCode;
connectionObject = getConnection();
sql="select pos_code,descr from org_structure where active = ?";
pstmt = connectionObject.prepareStatement(sql);
......@@ -198,18 +190,17 @@ public class SalesBudgetCustWizBean implements Serializable
{
String posCode = rs.getString("POS_CODE");
String posDescr = rs.getString("DESCR");
selectedposCode = (selectedposCode != null) ? selectedposCode.trim() : selectedposCode;
posCode = (posCode != null) ? posCode.trim() : posCode;
posDescr = (posDescr != null) ? posDescr.trim() : posDescr;
if ( selectedposCode.equals( posCode ) )
if ( selectedPosCode.equals( posCode ) )
{
valueXmlString.append("<ORG_STRUCTURE domID='" + num + "' selected = 'Y'>\r\n");
valueXmlString.append("<ORG_STRUCTURE domID='" + num + "' selected = 'Y'>\r\n");
}
else
{
valueXmlString.append("<ORG_STRUCTURE domID='" + num + "' selected = 'N'>\r\n");
valueXmlString.append("<ORG_STRUCTURE domID='" + num + "' selected = 'N'>\r\n");
}
valueXmlString.append("<POS_CODE><![CDATA[").append( posCode ).append("]]></POS_CODE>\r\n");
......@@ -217,6 +208,16 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</ORG_STRUCTURE>\r\n");
num++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
......@@ -227,6 +228,16 @@ public class SalesBudgetCustWizBean implements Serializable
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (connectionObject != null && !connectionObject.isClosed())
{
connectionObject.close();
......@@ -241,23 +252,15 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</Root>\r\n");
return valueXmlString.toString();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getPriceList( String selecteditemSeries) throws ITMException
public String getPriceList( String selectedItemSeries ) throws ITMException
{
String priceList= "";
Connection connectionObject = null;
try
{
connectionObject = getConnection();
priceList = getPricList( selecteditemSeries); //sales_budget_cust_wiz1_wiz_en_US_A
priceList = getPricList( selectedItemSeries); //sales_budget_cust_wiz1_wiz_en_US_A
String xslFileName = getXSLFileName( "sales_budget_cust_price_list_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
priceList = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, priceList, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
priceList = genericUtility.transformToString( xslFileName, priceList, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
......@@ -265,24 +268,23 @@ public class SalesBudgetCustWizBean implements Serializable
}
finally
{
}
return priceList;
}
public String getPricList( String selectedPriceList ) throws ITMException
private String getPricList( String selectedPriceList ) throws ITMException
{
String sql = "";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
selectedPriceList = (selectedPriceList != null) ? selectedPriceList.trim() : selectedPriceList;
connectionObject = getConnection();
//sql = "SELECT CODE, DESCR FROM PERIOD ";
sql = "SELECT PRICE_LIST,DESCR FROM PRICELIST_MST";
pstmt = connectionObject.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -291,18 +293,17 @@ public class SalesBudgetCustWizBean implements Serializable
{
String prcList = rs.getString("PRICE_LIST");
String prcDescr = rs.getString("DESCR");
selectedPriceList = (selectedPriceList != null) ? selectedPriceList.trim() : selectedPriceList;
prcList = (prcList != null) ? prcList.trim() : prcList;
prcDescr = (prcDescr != null) ? prcDescr.trim() : prcDescr;
if ( selectedPriceList.equals( prcList ) )
{
valueXmlString.append("<PRICELIST_MST domID='" + num + "' selected = 'Y'>\r\n");
valueXmlString.append("<PRICELIST_MST domID='" + num + "' selected = 'Y'>\r\n");
}
else
{
valueXmlString.append("<PRICELIST_MST domID='" + num + "' selected = 'N'>\r\n");
valueXmlString.append("<PRICELIST_MST domID='" + num + "' selected = 'N'>\r\n");
}
valueXmlString.append("<PRICE_LIST><![CDATA[").append( prcList ).append("]]></PRICE_LIST>\r\n");
......@@ -310,6 +311,16 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</PRICELIST_MST>\r\n");
num++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
......@@ -320,6 +331,16 @@ public class SalesBudgetCustWizBean implements Serializable
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (connectionObject != null && !connectionObject.isClosed())
{
connectionObject.close();
......@@ -334,19 +355,15 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</Root>\r\n");
return valueXmlString.toString();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getItmSeries( String selecteditemSeries) throws ITMException
public String getItmSeries( String selectedItemSeries) throws ITMException
{
String itmSeries= "";
Connection connectionObject = null;
try
{
connectionObject = getConnection();
itmSeries = getItemSeries( selecteditemSeries); //sales_budget_cust_wiz1_wiz_en_US_A
itmSeries = getItemSeries( selectedItemSeries); //sales_budget_cust_wiz1_wiz_en_US_A
String xslFileName = getXSLFileName( "sales_budget_cust_item_series_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
itmSeries = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, itmSeries, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
itmSeries = genericUtility.transformToString( xslFileName, itmSeries, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
......@@ -354,21 +371,22 @@ public class SalesBudgetCustWizBean implements Serializable
}
finally
{
}
return itmSeries;
}
public String getItemSeries( String selecteditemSeries ) throws ITMException
private String getItemSeries( String selectedItemSeries ) throws ITMException
{
String sql = "";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
selectedItemSeries = (selectedItemSeries != null) ? selectedItemSeries.trim() : selectedItemSeries;
connectionObject = getConnection();
sql="SELECT ITEM_SER,DESCR FROM ITEMSER";
pstmt = connectionObject.prepareStatement(sql);
......@@ -378,12 +396,11 @@ public class SalesBudgetCustWizBean implements Serializable
{
String itmSeries = rs.getString("ITEM_SER");
String itmSeriesDescr = rs.getString("DESCR");
selecteditemSeries = (selecteditemSeries != null) ? selecteditemSeries.trim() : selecteditemSeries;
itmSeries = (itmSeries != null) ? itmSeries.trim() : itmSeries;
itmSeriesDescr = (itmSeriesDescr != null) ? itmSeriesDescr.trim() : itmSeriesDescr;
if ( selecteditemSeries.equals( itmSeries ) )
if ( selectedItemSeries.equals( itmSeries ) )
{
valueXmlString.append("<ITEMSER domID='" + num + "' selected = 'Y'>\r\n");
}
......@@ -397,6 +414,16 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</ITEMSER>\r\n");
num++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
......@@ -407,6 +434,16 @@ public class SalesBudgetCustWizBean implements Serializable
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (connectionObject != null && !connectionObject.isClosed())
{
connectionObject.close();
......@@ -421,19 +458,15 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</Root>\r\n");
return valueXmlString.toString();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getAcctPrd( String selectedAcctPrd) throws ITMException
{
String acctPrd= "";
Connection connectionObject = null;
try
{
connectionObject = getConnection();
acctPrd = getActPrd( selectedAcctPrd); //sales_budget_cust_wiz1_wiz_en_US_A
String xslFileName = getXSLFileName( "sales_budget_cust_acct_prd_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
acctPrd = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, acctPrd, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
acctPrd = genericUtility.transformToString( xslFileName, acctPrd, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
......@@ -441,24 +474,23 @@ public class SalesBudgetCustWizBean implements Serializable
}
finally
{
}
return acctPrd;
}
public String getActPrd( String selectedAcctPrd ) throws ITMException
private String getActPrd( String selectedAcctPrd ) throws ITMException
{
String sql = "";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
selectedAcctPrd = (selectedAcctPrd != null) ? selectedAcctPrd.trim() : selectedAcctPrd;
connectionObject = getConnection();
//sql = "SELECT CODE, DESCR FROM PERIOD ";
sql = "SELECT CODE,DESCR FROM ACCTPRD ORDER BY CODE ASC";
pstmt = connectionObject.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -467,13 +499,10 @@ public class SalesBudgetCustWizBean implements Serializable
{
String accCode = checkNull( rs.getString("CODE") );
String accDescr = checkNull( rs.getString("DESCR") );
//String acctFrom = checkNull(rs.getString("FR_DATE"));
//String acctTo = checkNull(rs.getString("TO_DATE"));
selectedAcctPrd = (selectedAcctPrd != null) ? selectedAcctPrd.trim() : selectedAcctPrd;
accCode = (accCode != null) ? accCode.trim() : accCode;
accDescr = (accDescr != null) ? accDescr.trim() : accDescr;
if ( selectedAcctPrd.equals( accCode ) )
{
valueXmlString.append("<ACCTPRD domID='" + num + "' selected = 'Y'>\r\n");
......@@ -482,15 +511,21 @@ public class SalesBudgetCustWizBean implements Serializable
{
valueXmlString.append("<ACCTPRD domID='" + num + "' selected = 'N'>\r\n");
}
//acctFrom = acctFrom.substring(0, acctFrom.indexOf(" "));
//acctTo = acctTo.substring(0, acctTo.indexOf(" "));
valueXmlString.append("<CODE><![CDATA[").append( accCode ).append("]]></CODE>\r\n");
valueXmlString.append("<DESCR><![CDATA[").append( accDescr ).append("]]></DESCR>\r\n");
//valueXmlString.append("<FR_DATE><![CDATA[").append( acctFrom ).append("]]></FR_DATE>\r\n");
//valueXmlString.append("<TO_DATE><![CDATA[").append( acctTo ).append("]]></TO_DATE>\r\n");
valueXmlString.append("</ACCTPRD>\r\n");
num++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
......@@ -501,6 +536,16 @@ public class SalesBudgetCustWizBean implements Serializable
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (connectionObject != null && !connectionObject.isClosed())
{
connectionObject.close();
......@@ -515,7 +560,7 @@ public class SalesBudgetCustWizBean implements Serializable
valueXmlString.append("</Root>\r\n");
return valueXmlString.toString();
}
private String getXSLFileName( String xslFileName )throws ITMException
{
String retFileName = null;
......@@ -552,49 +597,36 @@ public class SalesBudgetCustWizBean implements Serializable
return retFileName;
}
public String checkNull( String input )
private String checkNull( String input )
{
if (input == null || "null".equalsIgnoreCase(input))
{
if (input == null || "null".equalsIgnoreCase(input))
{
input= "";
}
return input.trim();
input= "";
}
// added by rupali on 16/08/8 foe multi-tenancy related changes [start]
public Connection getConnection()
return input.trim();
}
// added by rupali on 16/08/8 foe multi-tenancy related changes [start]
private Connection getConnection()
{
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try
{
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try
if(this.userInfo != null)
{
if(this.userInfo != null)
{
String transDB = this.userInfo.getTransDB();
if( transDB != null && transDB.trim().length() > 0 && !"null".equalsIgnoreCase(transDB))
{
conn = connDriver.getConnectDB(transDB);
connDriver = null;
}
else
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
}
}
else
String transDB = this.userInfo.getTransDB();
if( transDB != null && transDB.trim().length() > 0 && !"null".equalsIgnoreCase(transDB))
{
conn = connDriver.getConnectDB("DriverITM");
conn = connDriver.getConnectDB(transDB);
connDriver = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
return conn;
}
catch(Exception e)
{
e.printStackTrace();
}
return conn;
}
}
package ibase.webitm.ejb.fin;
import java.net.InetAddress;
import java.rmi.RemoteException;
import java.sql.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import ibase.utility.UserInfoBean;
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.ITMDBAccessEJB;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class SalesBudgetCustWizEJB extends ValidatorEJB
{
E12GenericUtility genericUtility = new E12GenericUtility();
public SalesBudgetCustWizEJB()
{
System.out.println("<== AMEY ==>");
}
public String wfValData() throws RemoteException,ITMException
{
return "";
}
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("wfValData 1 ==>]");
Document dom = null;
Document dom1 = null;
Document dom2 = null;
......@@ -50,27 +38,14 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
{
dom = parseString(xmlString);
}
else
{
System.out.println("xmlstring is null");
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
dom1 = parseString(xmlString1);
}
else
{
System.out.println("xmlstring1 is null");
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
dom2 = parseString(xmlString2);
}
else
{
System.out.println("xmlstring2 is null");
}
System.out.println("Before call valdata");
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
}
catch(Exception e)
......@@ -82,9 +57,6 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("wfValData 2 ==>]");
E12GenericUtility genericUtility = new ibase.utility.E12GenericUtility();
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
String errString = "";
......@@ -97,15 +69,11 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
PreparedStatement pstmt = null;
ResultSet rSet = null ;
ITMDBAccessEJB itmDBAccessLocal = null;
StringBuffer valueXmlString = new StringBuffer();
try
{
connectionObject = getConnection();
itmDBAccessLocal = new ITMDBAccessEJB();
System.out.println("call valdata");
System.out.println("wfValData objContext ["+objContext+"]");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
......@@ -114,262 +82,226 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
switch (currentFormNo)
{
case 1:
ResultSet rs = null;
NodeList parentNodeList = null;
NodeList childNodeList = null;
int ctr = 0;
String errCode="";
System.out.println("x==> in wfvalData 2 - > case 1");
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
int childNodeLength1 = childNodeList.getLength();
valueXmlString.append("<Detail1>");
for (ctr = 0; ctr < childNodeLength1; ctr++)
case 1:
ResultSet rs = null;
NodeList parentNodeList = null;
NodeList childNodeList = null;
int ctr = 0;
String errCode="";
System.out.println("x==> in wfvalData 2 - > case 1");
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
int childNodeLength1 = childNodeList.getLength();
valueXmlString.append("<Detail1>");
for (ctr = 0; ctr < childNodeLength1; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("x==> childNodeName now "+childNodeName);
if ("cust_code".equalsIgnoreCase( childNodeName ))
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("x==> childNodeName now "+childNodeName);
if ("cust_code".equalsIgnoreCase( childNodeName ))
String cusCode = checkNull(genericUtility.getColumnValue("cust_code", dom)).trim();
if ( cusCode.length() == 0 || cusCode == null )
{
String cusCode = checkNull(genericUtility.getColumnValue("cust_code", dom)).trim();
if ( cusCode.length() == 0 || cusCode == null )
errCode = "VTCUSTNEX";
errString = getErrorString("cusCode", errCode, userId);
break;
}
else
{
String sql = "SELECT CUST_CODE,CUST_NAME FROM CUSTOMER WHERE CUST_CODE = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, cusCode);
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTCUSTNEX";
errString = getErrorString("cusCode", errCode, userId);
errCode = "VTCUSTNEX ";
errString = getErrorString("cust_code", errCode, userId);
break;
}
else
{
String sql = "SELECT CUST_CODE,CUST_NAME FROM CUSTOMER WHERE CUST_CODE = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, cusCode);
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTCUSTNEX ";
errString = getErrorString("cust_code", errCode, userId);
break;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if ("pos_code".equalsIgnoreCase( childNodeName ))
}
else if ("pos_code".equalsIgnoreCase( childNodeName ))
{
String posCode = checkNull(genericUtility.getColumnValue("pos_code", dom)).trim();
if ( posCode.length() == 0 || posCode == null )
{
String posCode = checkNull(genericUtility.getColumnValue("pos_code", dom)).trim();
if ( posCode.length() == 0 || posCode == null )
errCode = "INVPOSCODE";
errString = getErrorString("pos_code", errCode, userId);
break;
}
else
{
String sql = "select pos_code,descr from org_structure where active = ? and POS_CODE = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, "Y");
pstmt.setString(2, posCode);
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "INVPOSCODE";
errString = getErrorString("pos_code", errCode, userId);
break;
}
else
{
String sql = "select pos_code,descr from org_structure where active = ? and POS_CODE = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, "Y");
pstmt.setString(2, posCode);
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "INVPOSCODE";
errString = getErrorString("pos_code", errCode, userId);
break;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if ("item_ser".equalsIgnoreCase( childNodeName ))
}
else if ("item_ser".equalsIgnoreCase( childNodeName ))
{
String itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom)).trim();
if (itemSer.length() == 0 || itemSer == null)
{
String itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom)).trim();
if (itemSer.length() == 0 || itemSer == null)
errCode = "NULITEMSER";
errString = getErrorString("item_ser", errCode, userId);
break;
}
else
{
String sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_SER = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, itemSer );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "NULITEMSER";
errCode = "VTITEMSER1";
errString = getErrorString("item_ser", errCode, userId);
break;
}
else
{
String sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_SER = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, itemSer );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTITEMSER1";
errString = getErrorString("item_ser", errCode, userId);
break;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if ("price_list".equalsIgnoreCase( childNodeName ))
}
else if ("price_list".equalsIgnoreCase( childNodeName ))
{
String priceList = checkNull(genericUtility.getColumnValue("price_list", dom)).trim();
if (priceList.length() == 0 || priceList == null)
{
String priceList = checkNull(genericUtility.getColumnValue("price_list", dom)).trim();
if (priceList.length() == 0 || priceList == null)
errCode = "VTINVPLIST";
errString = getErrorString("price_list", errCode, userId);
break;
}
else
{
String sql = "SELECT PRICE_LIST FROM PRICELIST_MST WHERE PRICE_LIST = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, priceList );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTINVPLIST";
errString = getErrorString("price_list", errCode, userId);
break;
}
else
{
String sql = "SELECT PRICE_LIST FROM PRICELIST_MST WHERE PRICE_LIST = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, priceList );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTINVPLIST";
errString = getErrorString("price_list", errCode, userId);
break;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else if ("acct_prd".equalsIgnoreCase( childNodeName ))
}
else if ("acct_prd".equalsIgnoreCase( childNodeName ))
{
String acctPrd = checkNull(genericUtility.getColumnValue("acct_prd", dom)).trim();
if (acctPrd.length() == 0 || acctPrd == null)
{
String acctPrd = checkNull(genericUtility.getColumnValue("acct_prd", dom)).trim();
if (acctPrd.length() == 0 || acctPrd == null)
errCode = "VTNULLPRD ";
errString = getErrorString("acct_prd", errCode, userId);
break;
}
else
{
//String sql = "SELECT CODE FROM PERIOD WHERE ACCT_PRD = ?";
String sql = "SELECT CODE FROM ACCTPRD WHERE CODE = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, acctPrd );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTNULLPRD ";
errCode = "VTITXPRC03";
errString = getErrorString("acct_prd", errCode, userId);
break;
}
else
{
String sql = "SELECT CODE FROM PERIOD WHERE ACCT_PRD = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString( 1, acctPrd );
rs = pstmt.executeQuery();
if(!rs.next())
{
errCode = "VTITXPRC03";
errString = getErrorString("acct_prd", errCode, userId);
break;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
valueXmlString.append("</Detail1>");
break;
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
int childNodeLength = childNodeList.getLength();
String quantity="";
int qty=0;
valueXmlString.append("<Detail2>");
for (ctr = 0; ctr < childNodeLength; ctr++)
}
valueXmlString.append("</Detail1>");
break;
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
int childNodeLength = childNodeList.getLength();
String quantity="";
int qty=0;
valueXmlString.append("<Detail2>");
for (ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if ( childNodeName.equalsIgnoreCase("quantity") )
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if ( childNodeName.equalsIgnoreCase("quantity") )
quantity = checkNull(genericUtility.getColumnValue("quantity", dom));
if( quantity.length() == 0 )
{
errString = getErrorString("quantity", "BLNKQUAN", userId);
break;
}
else
{
quantity = checkNull(genericUtility.getColumnValue("quantity", dom)).trim();
if( quantity.length() == 0 || quantity == null || quantity == "")
qty = Integer.valueOf(quantity);
if( qty < 0 )
{
errString = getErrorString("quantity", "BLNKQUAN", userId);
errString = getErrorString("quantity", "VTTOTQTNG", userId);
break;
}
else
{
qty = Integer.valueOf(quantity);
if( qty < 0 )
{
errString = getErrorString("quantity", "VTTOTQTNG", userId);
break;
}
}
}
}
valueXmlString.append("</Detail2>");
System.out.println("x==> in wfvalData 2 - > case 2 //END");
break;
}
}
valueXmlString.append("</Detail2>");
System.out.println("x==> in wfvalData 2 - > case 2 //END");
break;
}
}
catch(Exception e)
{
System.out.println("wfValdata::Exception:" + getClass().getSimpleName() + ":::" + e.getMessage());
e.printStackTrace();
/*e.printStackTrace();
errString = "";
errString = genericUtility.createErrorString( e ) ;
String messageValue="",message = "";
if( errString.indexOf("<Errors>")!=-1 )
{
if( errString.length() > 0 )
{
String msgDescr = errString.substring(errString.indexOf("<description>")+("<description>").length(),errString.indexOf("</description>"));
messageValue = msgDescr.substring(msgDescr.indexOf("<![CDATA[")+("<![CDATA[").length(),msgDescr.indexOf("]"));
String messageDescr = errString.substring(errString.indexOf("<message>")+("<message>").length(),errString.indexOf("</message>"));
message = messageDescr.substring(messageDescr.indexOf("<![CDATA[")+("<![CDATA[").length(),messageDescr.indexOf("]"));
System.out.println("errorMessage==>"+messageValue);
StringBuffer valueXmlErrorString = new StringBuffer( "<?xmlversion=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<Errors>\r\n" );
valueXmlErrorString.append("<error id=\"INVDATA\" type=\"E\" column_name=\"\">");
valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n");
valueXmlErrorString.append("<description><![CDATA[").append(messageValue).append("]]></description>\r\n");
valueXmlErrorString.append("<type>E</type>\r\n");
valueXmlErrorString.append("<option></option>\r\n");
valueXmlErrorString.append("<time></time>\r\n");
valueXmlErrorString.append("<alarm></alarm>\r\n");
valueXmlErrorString.append("<source></source>\r\n");
valueXmlErrorString.append("<trace>Error : NO DATA</trace>\r\n");
valueXmlErrorString.append("<redirect>1</redirect>\r\n");
valueXmlErrorString.append("</error>\r\n");
valueXmlErrorString.append("</Errors>\r\n");
valueXmlErrorString.append("</Header>\r\n");
valueXmlErrorString.append( "</Root>\r\n" );
System.out.println( "\n****valueXmlErrorString :" + valueXmlErrorString.toString() + ":********" );
errString =valueXmlErrorString.toString();
}
}*/
/*Ended By Dipak*/
}
finally
{
......@@ -393,56 +325,13 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
}
catch (Exception e)
{
System.out.println("Exception in EJB["
+ getClass().getSimpleName() + "]::wfValData::finally catch ["
+ e.getMessage() + "]");
System.out.println("Exception in EJB[" + getClass().getSimpleName() + "]::wfValData::finally catch [" + e.getMessage() + "]");
}
/*catch(Exception e)
{
System.out.println( "Exception :defaultDataWiz :==>\n"+e.getMessage());
errString = "";
errString = genericUtility.createErrorString( e ) ;
System.out.println( "errString ::" +errString + ":" );
String messageValue="",message = "";
if( errString.indexOf("<Errors>")!=-1 )
{
if( errString.length() > 0 )
{
String msgDescr = errString.substring(errString.indexOf("<description>")+("<description>").length(),errString.indexOf("</description>"));
messageValue = msgDescr.substring(msgDescr.indexOf("<![CDATA[")+("<![CDATA[").length(),msgDescr.indexOf("]"));
String messageDescr = errString.substring(errString.indexOf("<message>")+("<message>").length(),errString.indexOf("</message>"));
message = messageDescr.substring(messageDescr.indexOf("<![CDATA[")+("<![CDATA[").length(),messageDescr.indexOf("]"));
System.out.println("errorMessage==>"+messageValue);
StringBuffer valueXmlErrorString = new StringBuffer( "<?xmlversion=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<Errors>\r\n" );
valueXmlErrorString.append("<error id=\"INVDATA\" type=\"E\" column_name=\"\">");
valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n");
valueXmlErrorString.append("<description><![CDATA[").append(messageValue).append("]]></description>\r\n");
valueXmlErrorString.append("<type>E</type>\r\n");
valueXmlErrorString.append("<option></option>\r\n");
valueXmlErrorString.append("<time></time>\r\n");
valueXmlErrorString.append("<alarm></alarm>\r\n");
valueXmlErrorString.append("<source></source>\r\n");
valueXmlErrorString.append("<trace>Error : NO DATA</trace>\r\n");
valueXmlErrorString.append("<redirect>1</redirect>\r\n");
valueXmlErrorString.append("</error>\r\n");
valueXmlErrorString.append("</Errors>\r\n");
valueXmlErrorString.append("</Header>\r\n");
valueXmlErrorString.append( "</Root>\r\n" );
System.out.println( "\n****valueXmlErrorString :" + valueXmlErrorString.toString() + ":********" );
errString =valueXmlErrorString.toString();
}
}
}*/
}
System.out.println("errString ["+errString+"]");
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;
......@@ -455,7 +344,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
System.out.println ( "xmlString :" + xmlString);
System.out.println ( "xmlString1 :" + xmlString1);
System.out.println ( "xmlString2 :" + xmlString2);
if (xmlString != null && xmlString.trim().length()!=0)
{
dom = genericUtility.parseString(xmlString);
......@@ -499,20 +388,13 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("x==> itemChanged called");
System.out.println("x==> DOM "+dom);
System.out.println("x==> DOM1 "+dom1);
System.out.println("x==> DOM2 "+dom2);
System.out.println("x==> objContext "+objContext);
System.out.println("x==> currentColumn "+currentColumn);
int currentFormNo= 0;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt2 = null;
ResultSet rs2 = null;
StringBuffer valueXmlString = new StringBuffer();
NodeList parentNodeList = null;
NodeList childNodeList = null;
......@@ -525,43 +407,35 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
ArrayList<String> acctPrdlist=new ArrayList<String>();
try
{
conn = getConnection();
//returnStr = defaultDataWiz(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("Driver");
InetAddress ownIP=InetAddress.getLocalHost();
chgTerm = ownIP.getHostAddress();
//connectionObject = getConnection();
UserInfoBean userInfo = getUserInfo();
siteCode = userInfo.getSiteCode();
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
//chgTerm = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgTerm" );
DateFormat dtFormat = new SimpleDateFormat(getApplDateFormat());
java.util.Date date = Calendar.getInstance().getTime();
currDate = dtFormat.format( date );
Calendar cal = Calendar.getInstance();
/*Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
Date result = cal.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String prevPrd = String.valueOf(sdf.format(result));
String curPrd = String.valueOf(sdf.format(date));
prevPrd = prevPrd.substring(0,prevPrd.length()-2);
curPrd = curPrd.substring(0,curPrd.length()-2);
curPrd = curPrd.substring(0,curPrd.length()-2);*/
if ((objContext != null) && (objContext.trim().length() > 0))
{
currentFormNo = Integer.parseInt(objContext);
}
System.out.println("[" + getClass().getSimpleName()+ "AMEY NOW currentFormNo:" + currentFormNo);
System.out.println("AMM x==> IC currentColumn:::::" + currentColumn);
valueXmlString = new StringBuffer("<?xml version=\"1.0\" encoding=''?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
switch (currentFormNo)
{
......@@ -571,7 +445,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
{
......@@ -587,20 +461,37 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
System.out.println("AMM x==> IC CURRENT COLUMN 111 " + currentColumn + "]");
//valueXmlString.append("<Detail1>\r\n");
valueXmlString.append( "<Detail1 domID='" + count + "'>");
if ("itm_default".equalsIgnoreCase( currentColumn ))
if ( "itm_default".equalsIgnoreCase( currentColumn ) )
{
valueXmlString.append( "<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\"/>\r\n");
valueXmlString.append( "<tran_date><![CDATA[").append( currDate ).append( "]]></tran_date>\r\n" );
valueXmlString.append( "<chg_date><![CDATA[" ).append( currDate ).append( "]]></chg_date>\r\n" );
/*valueXmlString.append( "<chg_date><![CDATA[" ).append( currDate ).append( "]]></chg_date>\r\n" );
valueXmlString.append( "<chg_user><![CDATA[" ).append( userId ).append( "]]></chg_user>\r\n" );
valueXmlString.append( "<chg_term><![CDATA[" ).append( chgTerm ).append( "]]></chg_term>\r\n" );
valueXmlString.append( "<chg_term><![CDATA[" ).append( chgTerm ).append( "]]></chg_term>\r\n" );*/
valueXmlString.append( "<site_code><![CDATA[" ).append( siteCode ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<cust_code><![CDATA[" ).append( nullVar ).append( "]]></cust_code>\r\n" );
valueXmlString.append( "<cust_descr><![CDATA[" ).append( nullVar ).append( "]]></cust_descr>\r\n" );
valueXmlString.append( "<pos_code><![CDATA[" ).append( nullVar ).append( "]]></pos_code>\r\n" );
valueXmlString.append( "<pos_descr><![CDATA[" ).append( nullVar ).append( "]]></pos_descr>\r\n" );
valueXmlString.append( "<item_ser><![CDATA[" ).append( nullVar ).append( "]]></item_ser>\r\n" );
valueXmlString.append( "<itm_descr><![CDATA[" ).append( nullVar ).append( "]]></itm_descr>\r\n" );
valueXmlString.append( "<price_list><![CDATA[" ).append( nullVar ).append( "]]></price_list>\r\n" );
valueXmlString.append( "<prc_descr><![CDATA[" ).append( nullVar ).append( "]]></prc_descr>\r\n" );
valueXmlString.append( "<acct_prd><![CDATA[" ).append( nullVar ).append( "]]></acct_prd>\r\n" );
valueXmlString.append( "<remarks><![CDATA[" ).append( nullVar ).append( "]]></remarks>\r\n" );
//count ++;
}
else if (currentColumn.trim().equalsIgnoreCase("cust_code"))
{
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom)).trim();
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
if( custCode != null && custCode.trim().length()!=0 )
{
......@@ -614,7 +505,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
posCode = checkNull(rs.getString("POS_CODE"));
posD = checkNull(rs.getString("DESCR"));
}
String sql2= "SELECT CUST_NAME FROM CUSTOMER WHERE CUST_CODE = ?";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1, custCode);
......@@ -623,7 +514,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
{
custName = checkNull(rs2.getString("CUST_NAME"));
}
rs.close();
rs = null;
pstmt.close();
......@@ -634,19 +525,18 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
pstmt2 = null;
}
valueXmlString.append("<pos_code><![CDATA[" + posCode + "]]></pos_code>");
valueXmlString.append("<pos_descr><![CDATA[" + posD + "]]></pos_descr>");
valueXmlString.append("<cus_descr><![CDATA[" + custName + "]]></cus_descr>");
valueXmlString.append("<pos_code><![CDATA[" + posCode + "]]></pos_code>");
valueXmlString.append("<pos_descr><![CDATA[" + posD + "]]></pos_descr>");
valueXmlString.append("<cust_descr><![CDATA[" + custName + "]]></cust_descr>");
}
else if(currentColumn.trim().equalsIgnoreCase("pos_code"))
{
String posCode2 = checkNull(genericUtility.getColumnValue("pos_code", dom)).trim();
String posCode2 = checkNull(genericUtility.getColumnValue("pos_code", dom));
if( posCode2 != null && posCode2.trim().length()!=0 )
{
String sql3="select descr from org_structure where pos_code=? and active = ?";
pstmt = conn.prepareStatement(sql3);
pstmt.setString(1, posCode2);
pstmt.setString(2, "Y");
......@@ -660,18 +550,17 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
pstmt.close();
pstmt = null;
}
valueXmlString.append("<pos_descr><![CDATA[" + posDescr + "]]></pos_descr>");
valueXmlString.append("<pos_descr><![CDATA[" + posDescr + "]]></pos_descr>");
}
else if(currentColumn.trim().equalsIgnoreCase("item_ser")) //itm_descr
{
String itmSer2 = checkNull(genericUtility.getColumnValue("item_ser", dom)).trim();
String itmSer2 = checkNull(genericUtility.getColumnValue("item_ser", dom));
if( itmSer2 != null && itmSer2.trim().length()!=0 )
{
String sql3="SELECT DESCR FROM ITEMSER WHERE ITEM_SER = ?";
pstmt = conn.prepareStatement(sql3);
pstmt.setString(1, itmSer2);
rs = pstmt.executeQuery();
......@@ -684,18 +573,16 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
pstmt.close();
pstmt = null;
}
valueXmlString.append("<itm_descr><![CDATA[" + itmDes + "]]></itm_descr>");
valueXmlString.append("<itm_descr><![CDATA[" + itmDes + "]]></itm_descr>");
}
else if(currentColumn.trim().equalsIgnoreCase("price_list"))
{
String prcList2 = checkNull(genericUtility.getColumnValue("price_list", dom)).trim();
String prcList2 = checkNull(genericUtility.getColumnValue("price_list", dom));
if( prcList2 != null && prcList2.trim().length()!=0 )
{
String sql3="SELECT DESCR FROM PRICELIST_MST WHERE PRICE_LIST = ?";
pstmt = conn.prepareStatement(sql3);
pstmt.setString(1, prcList2);
rs = pstmt.executeQuery();
......@@ -708,17 +595,18 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
pstmt.close();
pstmt = null;
}
valueXmlString.append("<prc_descr><![CDATA[" + priceDesc + "]]></prc_descr>");
valueXmlString.append("<prc_descr><![CDATA[" + priceDesc + "]]></prc_descr>");
}
valueXmlString.append("</Detail1>");
break;
case 2:
System.out.println("IC switch case 2");
String sql="";
String priclist="";
int initialQnty = 0;
String itemSer="",acctPrd="";
System.out.println("itemChanged:currentFormNo:" + currentFormNo);
parentNodeList = dom.getElementsByTagName("Detail2");
......@@ -738,7 +626,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
}
while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println("IC CURRENT COLUMN 333 " + currentColumn + "]");
if ("itm_default".equalsIgnoreCase( currentColumn ))
{
if( currentColumn.equalsIgnoreCase("itm_default") )
......@@ -747,7 +635,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom1));
acctPrd = checkNull(genericUtility.getColumnValue("acct_prd", dom1));
//String lineNo = genericUtility.getColumnValue("line_no", dom);
//Period Code
String sql3 = "SELECT CODE FROM PERIOD WHERE ACCT_PRD = ? ORDER BY CODE";
pstmt = conn.prepareStatement(sql3);
......@@ -761,8 +649,8 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
rs = null;
pstmt.close();
pstmt = null;
//Item
String sql2 = "SELECT ITEM_CODE, UNIT FROM ITEM WHERE ITEM_SER = ?";
pstmt = conn.prepareStatement( sql2 );
......@@ -786,7 +674,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
rs2 = null;
pstmt2.close();
pstmt2 = null;
for( int i=0; i < acctPrdlist.size(); i++ )
{
valueXmlString.append("<Detail2 domID='" + count + "' objContext = '"+currentFormNo+"' selected=\"Y\" >\r\n");
......@@ -794,6 +682,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
valueXmlString.append("<prd_code><![CDATA[" + acctPrdlist.get(i) + "]]></prd_code>");
valueXmlString.append("<item_code><![CDATA[" + itemCode + "]]></item_code>");
valueXmlString.append("<item_ser><![CDATA[" + itemSer + "]]></item_ser>");
valueXmlString.append("<quantity><![CDATA[" + initialQnty + "]]></quantity>");
valueXmlString.append("<unit><![CDATA[" + itemUnit + "]]></unit>");
valueXmlString.append("<line_no><![CDATA[" + count + "]]></line_no>");
valueXmlString.append("<rate><![CDATA[" + rate + "]]></rate>");
......@@ -806,10 +695,10 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
rs = null;
pstmt.close();
pstmt = null;
}
}
break;
break;
}
valueXmlString.append("</Root>");
}
......@@ -817,10 +706,10 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
e.printStackTrace();
}
return valueXmlString.toString();
//return returnStr;
}
private String checkNull(String input) {
return input == null ? "" : input.trim();
private String checkNull(String input)
{
return E12GenericUtility.checkNull( input );
}
}
......@@ -135,13 +135,13 @@ border: 1px solid #E7E7E7 !important;
<TR>
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:16px;" width="2%" >
Salses Budget Wizard
Salses Budget
</TD>
</TR>
</TABLE>
<table id="errorActivityTable" width="100%" class="tableClass" style="margin: 0px 0px 0px 0px;position: relative;width: calc(literal('100% - 15px'));width: -moz-calc(literal('100% - 15px'));padding-right:0px; padding-left:5xp; width: -webkit-calc(literal('100% - 15px'));box-shadow: 3px 3px 3px gray;-moz-box-shadow:3px 3px 3px gray;-webkit-box-shadow: 3px 3px 3px gray;-o-box-shadow: 3px 3px 3px gray;background: rgba(255, 204, 0, 0.66);min-height: 50px;bottom:10px" border="1" cellspacing="0" cellpadding="0">
<table id="errorActivityTable" width="100%" class="tableClass" style="margin: 0px 0px 0px 0px;position: relative;width: calc(literal('100% - 15px'));width: -moz-calc(literal('100% - 15px'));padding-right:0px; padding-left:5xp; width: -webkit-calc(literal('100% - 15px'));box-shadow: 3px 3px 3px gray;-moz-box-shadow:3px 3px 3px gray;-webkit-box-shadow: 3px 3px 3px gray;-o-box-shadow: 3px 3px 3px gray;background: rgba(255, 204, 0, 0.66);min-height: 50px;bottom:10px" border="0" cellspacing="0" cellpadding="0">
<!--Changed by Dhiraj 30/09/10 [WS01SUN007] .end-->
<xsl:for-each select="//error">
......@@ -203,12 +203,16 @@ border: 1px solid #E7E7E7 !important;
<xsl:for-each select="//Detail1">
<xsl:variable name="tran_id"><xsl:value-of select="tran_id"/></xsl:variable>
<xsl:variable name="cust_code"><xsl:value-of select="cust_code"/></xsl:variable>
<xsl:variable name="cust_descr"><xsl:value-of select="cust_descr"/></xsl:variable>
<xsl:variable name="pos_code"><xsl:value-of select="pos_code"/></xsl:variable>
<xsl:variable name="pos_descr"><xsl:value-of select="pos_descr"/></xsl:variable>
<xsl:variable name="acct_prd"><xsl:value-of select="acct_prd"/></xsl:variable>
<xsl:variable name="item_ser"><xsl:value-of select="item_ser"/></xsl:variable>
<xsl:variable name="itm_descr"><xsl:value-of select="itm_descr"/></xsl:variable>
<xsl:variable name="net_amt"><xsl:value-of select="net_amt"/></xsl:variable>
<xsl:variable name="remarks"><xsl:value-of select="remarks"/></xsl:variable>
<xsl:variable name="price_list"><xsl:value-of select="price_list"/></xsl:variable>
<xsl:variable name="prc_descr"><xsl:value-of select="prc_descr"/></xsl:variable>
<xsl:variable name="site_code"><xsl:value-of select="site_code"/></xsl:variable>
<xsl:variable name="tran_date"><xsl:value-of select="tran_date"/></xsl:variable>
<xsl:variable name="chg_date"><xsl:value-of select="chg_date"/></xsl:variable>
......@@ -232,9 +236,9 @@ border: 1px solid #E7E7E7 !important;
<strong>Customer code: </strong>
</td>
<td class="td_leftAlign" >
<input type="text" value="{$cust_code}" class="input_editable" name="Detail1.{normalize-space($dbID)}.cust_code" id="Detail1.{normalize-space($dbID)}.cust_code" maxlength="10" onchange="callItemChange('{normalize-space($dbID)}', 'cust_code');" ISCHANGED="false"/>
<input type="text" value="{$cust_code}" class="input_editable" name="Detail1.{normalize-space($dbID)}.cust_code" id="Detail1.{normalize-space($dbID)}.cust_code" placeholder="Enter Customer code" maxlength="10" onchange="callItemChange('{normalize-space($dbID)}', 'cust_code');" ISCHANGED="false"/>
<a href="javascript:callCustCode( '{normalize-space($dbID)}','{normalize-space($cust_code)}' );"> <img src="/ibase/webitm/images/pophelp.png" border="0"/> </a>
<input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.cus_descr" id="Detail1.{normalize-space($dbID)}.cus_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
<input type="text" value="{$cust_descr}" class="input_editable" name="Detail1.{normalize-space($dbID)}.cust_descr" id="Detail1.{normalize-space($dbID)}.cust_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
</td>
</tr>
......@@ -246,7 +250,7 @@ border: 1px solid #E7E7E7 !important;
<td class="td_leftAlign" >
<input type="text" class="input_editable" value="{$pos_code}" name="Detail1.{normalize-space($dbID)}.pos_code" id="Detail1.{normalize-space($dbID)}.pos_code" placeholder="Enter POS code" maxlength="10" onchange="callItemChange('{normalize-space($dbID)}', 'pos_code');" ISCHANGED="false"/>
<a href="javascript:callPosCode( '{normalize-space($dbID)}','{normalize-space($pos_code)}' );"> <img src="/ibase/webitm/images/pophelp.png" border="0"/> </a>
<input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.pos_descr" id="Detail1.{normalize-space($dbID)}.pos_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
<input type="text" value="{$pos_descr}" class="input_editable" name="Detail1.{normalize-space($dbID)}.pos_descr" id="Detail1.{normalize-space($dbID)}.pos_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
</td>
</tr>
......@@ -258,7 +262,7 @@ border: 1px solid #E7E7E7 !important;
<td class="td_leftAlign" >
<input type="text" class="input_editable" value="{$item_ser}" name="Detail1.{normalize-space($dbID)}.item_ser" id="Detail1.{normalize-space($dbID)}.item_ser" placeholder="Enter Item series" maxlength="5" onchange="callItemChange('{normalize-space($dbID)}', 'item_ser');" ISCHANGED="false"/>
<a href="javascript:callItemSeries( '{normalize-space($dbID)}','{normalize-space($item_ser)}' );"> <img src="/ibase/webitm/images/pophelp.png" border="0"/> </a>
<input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.itm_descr" id="Detail1.{normalize-space($dbID)}.itm_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
<input type="text" value="{$itm_descr}" class="input_editable" name="Detail1.{normalize-space($dbID)}.itm_descr" id="Detail1.{normalize-space($dbID)}.itm_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
</td>
</tr>
......@@ -270,7 +274,7 @@ border: 1px solid #E7E7E7 !important;
<td class="td_leftAlign" >
<input type="text" value="{$price_list}" class="input_editable" name="Detail1.{normalize-space($dbID)}.price_list" id="Detail1.{normalize-space($dbID)}.price_list" placeholder="Enter Price List" maxlength="200" onchange="callItemChange('{normalize-space($dbID)}', 'price_list');" ISCHANGED="false" />
<a href="javascript:callPriceList( '{normalize-space($dbID)}','{normalize-space($price_list)}' );"> <img src="/ibase/webitm/images/pophelp.png" border="0"/> </a>
<input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.prc_descr" id="Detail1.{normalize-space($dbID)}.prc_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
<input type="text" value="{$prc_descr}" class="input_editable" name="Detail1.{normalize-space($dbID)}.prc_descr" id="Detail1.{normalize-space($dbID)}.prc_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
</td>
</tr>
......
......@@ -144,13 +144,13 @@ border: 1px solid #E7E7E7 !important;
<TR>
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:16px;" width="2%" >
Salses Budget Wizard Detail
Salses Budget
</TD>
</TR>
</TABLE>
<table id="errorActivityTable" width="100%" class="tableClass" style="margin: 0px 0px 0px 0px;position: relative;width: calc(literal('100% - 15px'));width: -moz-calc(literal('100% - 15px'));padding-right:0px; padding-left:5xp; width: -webkit-calc(literal('100% - 15px'));box-shadow: 3px 3px 3px gray;-moz-box-shadow:3px 3px 3px gray;-webkit-box-shadow: 3px 3px 3px gray;-o-box-shadow: 3px 3px 3px gray;background: rgba(255, 204, 0, 0.66);min-height: 50px;bottom:10px" border="1" cellspacing="0" cellpadding="0">
<table id="errorActivityTable" width="100%" class="tableClass" style="margin: 0px 0px 0px 0px;position: relative;width: calc(literal('100% - 15px'));width: -moz-calc(literal('100% - 15px'));padding-right:0px; padding-left:5xp; width: -webkit-calc(literal('100% - 15px'));box-shadow: 3px 3px 3px gray;-moz-box-shadow:3px 3px 3px gray;-webkit-box-shadow: 3px 3px 3px gray;-o-box-shadow: 3px 3px 3px gray;background: rgba(255, 204, 0, 0.66);min-height: 50px;bottom:10px" border="0" cellspacing="0" cellpadding="0">
<xsl:for-each select="//error">
<xsl:if test="position() = 1">
......
......@@ -15,7 +15,7 @@ function callCustCode( dbID, custCode )
function callItemSeries( dbID, itmSeries )
{
var selectedItmSeries = document.getElementById("Detail1."+dbID+".item_ser").value;
var url = '/ibase/webitm/jsp/SalesBudgetCustWiz.jsp?DBID='+dbID+'&SELECTED_ITM_SERIES='+selectedItmSeries+'&FIELD_NAME=ITEM_SER';
var url = '/ibase/webitm/jsp/SalesBudgetCustWiz.jsp?DBID='+dbID+'&SELECTED_ITM_SERIES='+selectedItmSeries+'&FIELD_NAME=ITEM_SER';
var win = window.open( url, 'ItemSeries', 'toolbar=no,status=yes,resizable=no,scrollbars=yes,left=100,top=50,width=500,height=406' );
}
......@@ -40,28 +40,32 @@ function callPriceList( dbID, prcList )
var win = window.open( url, 'PriceList', 'toolbar=no,status=yes,resizable=no,scrollbars=yes,left=100,top=50,width=500,height=406' );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// DISPLAY DESCRIPTION ////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////DISPLAY DESCRIPTION ////////////////////////////////////////////////////
function displayCustActivity( cusCode, cusDescr )
{
if (document.getElementById("Detail1..cust_code") != null)
{
document.getElementById("Detail1..cust_code").value = cusCode;
document.getElementById("Detail1..cus_descr").value = cusDescr;
document.getElementById("Detail1..cust_descr").value = cusDescr;
callItemChange('', 'cust_code');
}
else if(document.getElementById("Detail1.1.cust_code") != null)
{
document.getElementById("Detail1.1.cust_code").value = cusCode;
document.getElementById("Detail1.1.cus_descr").value = cusDescr;
document.getElementById("Detail1.1.cust_descr").value = cusDescr;
callItemChange('1', 'cust_code');
}
}
function displayPosActivity( posCode, posDescr )
{
if (document.getElementById("Detail1..pos_code") != null)
{
document.getElementById("Detail1..pos_code").value = posCode;
......@@ -76,7 +80,7 @@ function displayPosActivity( posCode, posDescr )
function displayItemActivity( itmCode, itmDescr )
{
if (document.getElementById("Detail1..item_ser") != null)
{
document.getElementById("Detail1..item_ser").value = itmCode;
......@@ -91,7 +95,7 @@ function displayItemActivity( itmCode, itmDescr )
function displayPriceActivity( prcList, prcDescr )
{
if (document.getElementById("Detail1..price_list") != null)
{
document.getElementById("Detail1..price_list").value = prcList;
......@@ -106,7 +110,7 @@ function displayPriceActivity( prcList, prcDescr )
function displayPrdActivity( prdCode, prdDescr )
{
if (document.getElementById("Detail1..acct_prd") != null)
{
document.getElementById("Detail1..acct_prd").value = prdCode;
......@@ -119,83 +123,90 @@ function displayPrdActivity( prdCode, prdDescr )
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// NET AMOUNT ////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////NET AMOUNT ////////////////////////////////////////////////////
function validateFirstFormData( value )
{
console.log('In setActionVal validation.validateFirstFormData..');
var csCode = document.getElementById("Detail1..cust_code").value;
var psCode = document.getElementById("Detail1..pos_code").value;
var iteSer = document.getElementById("Detail1..item_ser").value;
var prcList = document.getElementById("Detail1..price_list").value;
var actPrd = document.getElementById("Detail1..acct_prd").value
if ( csCode == null || csCode == "" )
{
alert("Please enter the value for Customer code");
return false;
}
else if ( psCode == null || psCode == "" )
{
alert("Please enter the value for Position code");
return false;
}
else if ( iteSer == null || iteSer == "" )
{
alert("Please enter the value for Item Series");
return false;
}
else if ( prcList == null || prcList == "" )
{
alert("Please enter the value for Price List");
return false;
}
else if ( actPrd == null || actPrd == "" )
{
alert("Please enter the Account Period");
return false;
}
else
{
console.log('Successfull in else 1');
setActionVal( value );
}
console.log('In setActionVal validation.validateFirstFormData..');
var csCode = document.getElementById("Detail1.1.cust_code").value;
var psCode = document.getElementById("Detail1.1.pos_code").value;
var iteSer = document.getElementById("Detail1.1.item_ser").value;
var prcList = document.getElementById("Detail1.1.price_list").value;
var actPrd = document.getElementById("Detail1.1.acct_prd").value
if ( csCode == null || csCode == "" )
{
console.log('cust_code');
alert("Please enter the value for Customer code");
return false;
}
if ( csCode.length < 3 )
{
console.log('cust_code');
alert("Please enter Minimum 3 characters of value for customer Name");
return false;
}
if ( psCode == null || psCode == "" )
{
alert("Please enter the value for Position code");
return false;
}
if ( iteSer == null || iteSer == "" )
{
alert("Please enter the value for Item Series");
return false;
}
if ( prcList == null || prcList == "" )
{
alert("Please enter the value for Price List");
return false;
}
if ( actPrd == null || actPrd == "" )
{
alert("Please enter the Account Period");
return false;
}
else
{
console.log('Successfull in else 1');
setActionVal( value );
}
}
function validateSecondFormData( value )
{
console.log('In setActionVal validation.validateSecondFormData..');
//var qnty = document.getElementById("Detail2.1.quantity").value;
var qnty = document.getElementById("Detail2."+dbId+".quantity").value;
console.log('qnty= '+qnty);
if ( qnty == null || qnty == "" )
{
alert("Please enter the Quantity");
return false;
}
if( qnty < 0 )
{
alert("Quantity can't be Negative! Please enter valid Quantity");
return false;
}
else
{
console.log('Successfull in else 2');
setActionVal( value );
}
console.log('In setActionVal validation.validateSecondFormData..');
var qnty = document.getElementById("Detail2."+dbId+".quantity").value;
console.log('qnty= '+qnty);
if ( qnty == null || qnty == "" )
{
alert("Please enter the Quantity");
return false;
}
if( qnty < 0 )
{
alert("Quantity can't be Negative! Please enter valid Quantity");
return false;
}
else
{
console.log('Successfull in else 2');
setActionVal( value );
}
}
function setActionVal( value )
{
console.log('Successfull in setActionVal');
document.getElementById("action").value = value;
return true;
console.log('Successfull in setActionVal');
document.getElementById("action").value = value;
return true;
}
function doHideMsg(str)
{
document.getElementById(str).style.display = 'none';
document.getElementById(str).style.display = 'none';
}
function disableButtons(formNo)
......@@ -216,22 +227,27 @@ function disableButtons(formNo)
function setNetAmount( dbId )
{
qty = document.getElementById("Detail2."+dbId+".quantity").value;
console.log('qty= '+qty);
if ( qty == null || qty == "" )
{
alert("Please enter the Quantity");
}
if( qty < 0 )
{
alert("Quantity can't be Negative! Please enter valid Quantity");
}
obj1 = document.getElementById("Detail2."+dbId+".rate");
var rate = trims(obj1.value);
var amt = qty * rate ;
if(document.getElementById("Detail2."+dbId+".net_amt") != null)
console.log('qty= '+qty);
if ( qty == null || qty == "" )
{
alert("Please enter the Quantity");
document.getElementById("Detail2."+dbId+".quantity").focus();
}
else if( qty < 0 )
{
alert("Quantity can't be Negative! Please enter valid Quantity");
document.getElementById("Detail2."+dbId+".quantity").focus();
}
else
{
document.getElementById("Detail2."+dbId+".net_amt").value = amt;
obj1 = document.getElementById("Detail2."+dbId+".rate");
var rate = trims(obj1.value);
var amt = qty * rate ;
if(document.getElementById("Detail2."+dbId+".net_amt") != null)
{
document.getElementById("Detail2."+dbId+".net_amt").value = amt;
}
}
}
......@@ -255,24 +271,24 @@ function trims(sVal)
return sTrimmed;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// ITEM CHANGE ////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////ITEM CHANGE ////////////////////////////////////////////////////
var wizard_obj_name = "";
function buildDataString( colName )
{
var objCtx = colName.substring("Detail".length, colName.indexOf( "." ) );
local_dom_id = colName.substring(colName.indexOf( "." )+1, colName.lastIndexOf( "." ) );
colName = (colName.indexOf( "." ) != -1 ) ? colName.substring( colName.lastIndexOf( "." )+1 , colName.length ) : colName;
var dataString = "<?xml version='1.0' encoding='UTF-8'?>"
+"<DocumentRoot>"
+"<description>Datawindow Root</description>"
+"<group0>"
+"<description>Group0 description</description>"
+"<Header0>"
+"<description>Header0 members</description>";
+"<DocumentRoot>"
+"<description>Datawindow Root</description>"
+"<group0>"
+"<description>Group0 description</description>"
+"<Header0>"
+"<description>Header0 members</description>";
var currEditForm = document.forms[0];
if ( currEditForm != undefined )
......@@ -280,19 +296,19 @@ function buildDataString( colName )
for( formCtr = 1; formCtr <= parseInt(objCtx); formCtr++ )
{
var prev_dom_id = -1;//Gulzar on 21/03/15
var dataElements = "";
for( ctr = 0; ctr < currEditForm.elements.length; ctr++ )
{
var obj = currEditForm.elements[ctr];
var columnName = obj.name;
var objectCtx = columnName.substring("Detail".length, columnName.indexOf( "." ) );
if(parseInt(objectCtx) == formCtr)
{
var curr_dom_id = columnName.substring(columnName.indexOf( "." )+1, columnName.lastIndexOf( "." ) );
if( curr_dom_id != prev_dom_id)
{
if(prev_dom_id != -1)
......@@ -300,10 +316,10 @@ function buildDataString( colName )
dataString += "</Detail" + formCtr + ">";
}
dataString += "<Detail" + objectCtx + " id='2' dbID='' domID='" + curr_dom_id + "' "
+ "objName='" + wizard_obj_name + "' objContext='" + objectCtx + "'>"
+ "<attribute pkNames='' status='O' updateFlag='N' selected='N'/>";
+ "objName='" + wizard_obj_name + "' objContext='" + objectCtx + "'>"
+ "<attribute pkNames='' status='O' updateFlag='N' selected='N'/>";
}
if( obj.name != undefined && obj.name.indexOf( "Detail" ) == 0 && obj.value != undefined )
{
......@@ -323,10 +339,10 @@ function buildDataString( colName )
}
}
}
dataString += "</Header0>"
+ "</group0>"
+ "</DocumentRoot>";
+ "</group0>"
+ "</DocumentRoot>";
return dataString;
}
......@@ -336,7 +352,7 @@ function getSaveString( colName )
local_dom_id = colName.substring(colName.indexOf( "." )+1, colName.lastIndexOf( "." ) );
global_obj_context = objCtx;
var saveString = "";
var isChange = false;
var changeColString = "";
......@@ -376,7 +392,7 @@ function getSaveString( colName )
if( obj.ISCHANGED == "true" )
{
isChange = true;
var colName = obj.name;
if( colName.indexOf( "." ) != -1 )
{
......@@ -399,8 +415,8 @@ function getSaveString( colName )
changeColString += "</Detail>";
}
saveString = "<?xml version='1.0' encoding='utf-8'?>"
+ "<Root>"
+ getHeaderString( colName, objCtx, local_dom_id );
+ "<Root>"
+ getHeaderString( colName, objCtx, local_dom_id );
if(isChange)
{
......@@ -412,52 +428,58 @@ function getSaveString( colName )
function getHeaderString( colName, objCtx, local_dom_id )
{
var obj_name = "sales_budget_cust_wiz";
var obj_name = "sales_budget_cust_wiz";
colName = (colName.indexOf( "." ) != -1 ) ? colName.substring( colName.lastIndexOf( "." )+1 , colName.length ) : colName ;
return "<header>"
+ "<objName><![CDATA["+obj_name+"]]></objName>"
+ "<pageContext><![CDATA[2]]></pageContext>"
+ "<objContext><![CDATA["+objCtx+"]]></objContext>"
+ "<editFlag><![CDATA["+local_edit_mode+"]]></editFlag>"
+ "<focusedColumn><![CDATA[" + colName + "]]></focusedColumn>"
+ "<elementName><![CDATA[" + arguments[1] + "]]></elementName>"
+ "<keyValue><![CDATA[" + ( local_dom_id ) + "]]></keyValue>"
+ "<taxKeyValue><![CDATA[" + ( ( global_obj_context == "1" ) ? "1" : local_dom_id ) + "]]></taxKeyValue>"
+ "<saveLevel><![CDATA[0]]></saveLevel>"
+ "<forcedSave><![CDATA[" + global_forced_save + "]]></forcedSave>"
+ "<taxInFocus><![CDATA[false]]></taxInFocus>"
+ "</header>";
+ "<objName><![CDATA["+obj_name+"]]></objName>"
+ "<pageContext><![CDATA[2]]></pageContext>"
+ "<objContext><![CDATA["+objCtx+"]]></objContext>"
+ "<editFlag><![CDATA["+local_edit_mode+"]]></editFlag>"
+ "<focusedColumn><![CDATA[" + colName + "]]></focusedColumn>"
+ "<elementName><![CDATA[" + arguments[1] + "]]></elementName>"
+ "<keyValue><![CDATA[" + ( local_dom_id ) + "]]></keyValue>"
+ "<taxKeyValue><![CDATA[" + ( ( global_obj_context == "1" ) ? "1" : local_dom_id ) + "]]></taxKeyValue>"
+ "<saveLevel><![CDATA[0]]></saveLevel>"
+ "<forcedSave><![CDATA[" + global_forced_save + "]]></forcedSave>"
+ "<taxInFocus><![CDATA[false]]></taxInFocus>"
+ "</header>";
}
function callItemChange( dbId, fieldName )
{
var obj = document.getElementById("OBJ_NAME");
var obj = document.getElementById("OBJ_NAME");
var objName = obj.value;
wizard_obj_name = objName;
wizard_obj_name = objName;
var action = "post_item_change";
var detailFieldName = document.getElementById("Detail1."+dbId+"."+fieldName).name;
var detailFieldName = document.getElementById("Detail1."+dbId+"."+fieldName).name;
var saveString = getSaveString( detailFieldName );
console.log(saveString);
var saveString = getSaveString( detailFieldName );
console.log(saveString);
var dataString = buildDataString( detailFieldName );
console.log(dataString);
console.log(dataString);
local_dom_id = ( detailFieldName ).substring( ( detailFieldName ).indexOf( "." )+1, ( detailFieldName ).lastIndexOf( "." ) );
console.log(local_dom_id);
console.log(local_dom_id);
if( saveString != "" )
{
var url = "/ibase/WebITMStatelessItemChangeServlet?OBJ_NAME="+objName+"&ACTION=post_item_change&TRANS_DOM="+encodeURIComponent(saveString)+"&DETAIL_DOM="+encodeURIComponent(dataString)+"&DOM_ID="+local_dom_id;
makeRequestWizard( url, fieldName);
makeRequestWizard( url, fieldName);
//var argArr = new Array();
//argArr[0] = "signItemChange";
//makeRequestWizard( url, setColumnValuesWizard );
}
}
function setPosCodeVal(xmldoc)
{
console.log("amey "+xmldoc);
if (window.DOMParser)
console.log("amey "+xmldoc);
if (window.DOMParser)
{
parser=new DOMParser();
try
......@@ -481,73 +503,64 @@ function setPosCodeVal(xmldoc)
if(xmldoc != null )
{
//if(objFormName === 'doctor')
//{
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
{
var detail = detailElement[i];
var posCod="";
var posDes = "";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("pos_code")[0] != null && detail.getElementsByTagName("pos_code")[0].childNodes[0] != null )
{
var detail = detailElement[i];
var posCod="";
var posDes = "";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("pos_code")[0] != null && detail.getElementsByTagName("pos_code")[0].childNodes[0] != null )
{
posCod = detail.getElementsByTagName("pos_code")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..pos_code").value = posCod;
if (document.getElementById("Detail1..pos_code") != null)
{
document.getElementById("Detail1..pos_code").value = posCod;
}
else if(document.getElementById("Detail1.1.pos_code") != null)
{
document.getElementById("Detail1.1.pos_code").value = posCod;
}
}
if( detail.getElementsByTagName("pos_descr")[0] != null && detail.getElementsByTagName("pos_descr")[0].childNodes[0] != null )
{
posDes = detail.getElementsByTagName("pos_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..pos_descr").value = posDes;
if (document.getElementById("Detail1..pos_descr") != null)
{
document.getElementById("Detail1..pos_descr").value = posDes;
}
else if(document.getElementById("Detail1.1.pos_descr") != null)
{
document.getElementById("Detail1.1.pos_descr").value = posDes;
}
}
if( detail.getElementsByTagName("cus_descr")[0] != null && detail.getElementsByTagName("cus_descr")[0].childNodes[0] != null )
{
custName = detail.getElementsByTagName("cus_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..cus_descr").value = custName;
if (document.getElementById("Detail1..cus_descr") != null)
{
document.getElementById("Detail1..cus_descr").value = custName;
}
else if(document.getElementById("Detail1.1.cus_descr") != null)
{
document.getElementById("Detail1.1.cus_descr").value = custName;
}
}
}
//}
}
posCod = detail.getElementsByTagName("pos_code")[0].childNodes[0].nodeValue;
}
if (document.getElementById("Detail1..pos_code") != null)
{
document.getElementById("Detail1..pos_code").value = posCod;
}
else if(document.getElementById("Detail1.1.pos_code") != null)
{
document.getElementById("Detail1.1.pos_code").value = posCod;
}
if( detail.getElementsByTagName("pos_descr")[0] != null && detail.getElementsByTagName("pos_descr")[0].childNodes[0] != null )
{
posDes = detail.getElementsByTagName("pos_descr")[0].childNodes[0].nodeValue;
}
if (document.getElementById("Detail1..pos_descr") != null)
{
document.getElementById("Detail1..pos_descr").value = posDes;
}
else if(document.getElementById("Detail1.1.pos_descr") != null)
{
document.getElementById("Detail1.1.pos_descr").value = posDes;
}
if( detail.getElementsByTagName("cust_descr")[0] != null && detail.getElementsByTagName("cust_descr")[0].childNodes[0] != null )
{
custName = detail.getElementsByTagName("cust_descr")[0].childNodes[0].nodeValue;
}
if (document.getElementById("Detail1..cust_descr") != null)
{
document.getElementById("Detail1..cust_descr").value = custName;
}
else if(document.getElementById("Detail1.1.cust_descr") != null)
{
document.getElementById("Detail1.1.cust_descr").value = custName;
}
}
}
}
function setPosDescrVal(xmldoc)
{
console.log("amey "+xmldoc);
if (window.DOMParser)
console.log("amey "+xmldoc);
if (window.DOMParser)
{
parser=new DOMParser();
try
......@@ -571,38 +584,37 @@ function setPosDescrVal(xmldoc)
if(xmldoc != null )
{
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
{
var detail = detailElement[i];
var posdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("pos_descr")[0] != null && detail.getElementsByTagName("pos_descr")[0].childNodes[0] != null )
{
var detail = detailElement[i];
var posdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("pos_descr")[0] != null && detail.getElementsByTagName("pos_descr")[0].childNodes[0] != null )
{
posdescr = detail.getElementsByTagName("pos_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..pos_descr").value = posdescr;
if (document.getElementById("Detail1..pos_descr") != null)
{
document.getElementById("Detail1..pos_descr").value = posdescr;
}
else if(document.getElementById("Detail1.1.pos_descr") != null)
{
document.getElementById("Detail1.1.pos_descr").value = posdescr;
}
}
}
}
posdescr = detail.getElementsByTagName("pos_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..pos_descr").value = posdescr;
}
if (document.getElementById("Detail1..pos_descr") != null)
{
document.getElementById("Detail1..pos_descr").value = posdescr;
}
else if(document.getElementById("Detail1.1.pos_descr") != null)
{
document.getElementById("Detail1.1.pos_descr").value = posdescr;
}
}
}
}
function setItmDescrVal(xmldoc)
{
console.log("amey "+xmldoc);
if (window.DOMParser)
console.log("amey "+xmldoc);
if (window.DOMParser)
{
parser=new DOMParser();
try
......@@ -626,38 +638,35 @@ function setItmDescrVal(xmldoc)
if(xmldoc != null )
{
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
{
var detail = detailElement[i];
var itmdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("itm_descr")[0] != null && detail.getElementsByTagName("itm_descr")[0].childNodes[0] != null )
{
var detail = detailElement[i];
var itmdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("itm_descr")[0] != null && detail.getElementsByTagName("itm_descr")[0].childNodes[0] != null )
{
itmdescr = detail.getElementsByTagName("itm_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..itm_descr").value = itmdescr;
if (document.getElementById("Detail1..itm_descr") != null)
{
document.getElementById("Detail1..itm_descr").value = itmdescr;
}
else if(document.getElementById("Detail1.1.itm_descr") != null)
{
document.getElementById("Detail1.1.itm_descr").value = itmdescr;
}
}
}
}
itmdescr = detail.getElementsByTagName("itm_descr")[0].childNodes[0].nodeValue;
}
if (document.getElementById("Detail1..itm_descr") != null)
{
document.getElementById("Detail1..itm_descr").value = itmdescr;
}
else if(document.getElementById("Detail1.1.itm_descr") != null)
{
document.getElementById("Detail1.1.itm_descr").value = itmdescr;
}
}
}
}
function setPrcDescrVal(xmldoc)
{
console.log("amey "+xmldoc);
if (window.DOMParser)
console.log("amey "+xmldoc);
if (window.DOMParser)
{
parser=new DOMParser();
try
......@@ -681,47 +690,43 @@ function setPrcDescrVal(xmldoc)
if(xmldoc != null )
{
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
var detailElement = xmldoc.getElementsByTagName("Detail1");
for (var i = 0; i < detailElement.length; i++)
{
var detail = detailElement[i];
var prcdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("prc_descr")[0] != null && detail.getElementsByTagName("prc_descr")[0].childNodes[0] != null )
{
var detail = detailElement[i];
var prcdescr="";
var custName="";
var strgType="";
var placeRequired="";
if( detail.getElementsByTagName("prc_descr")[0] != null && detail.getElementsByTagName("prc_descr")[0].childNodes[0] != null )
{
prcdescr = detail.getElementsByTagName("prc_descr")[0].childNodes[0].nodeValue;
//document.getElementById("Detail1..prc_descr").value = prcdescr;
if (document.getElementById("Detail1..prc_descr") != null)
{
document.getElementById("Detail1..prc_descr").value = prcdescr;
}
else if(document.getElementById("Detail1.1.prc_descr") != null)
{
document.getElementById("Detail1.1.prc_descr").value = prcdescr;
}
}
}
}
}
if (window.ActiveXObject) /*code for IE6, IE5*/
{
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) /*code for IE7+, Firefox, Chrome, Opera, Safari*/
{
httpRequest = new XMLHttpRequest();
prcdescr = detail.getElementsByTagName("prc_descr")[0].childNodes[0].nodeValue;
}
if (document.getElementById("Detail1..prc_descr") != null)
{
document.getElementById("Detail1..prc_descr").value = prcdescr;
}
else if(document.getElementById("Detail1.1.prc_descr") != null)
{
document.getElementById("Detail1.1.prc_descr").value = prcdescr;
}
}
}
}
if (window.ActiveXObject) /*code for IE6, IE5*/
{
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) /*code for IE7+, Firefox, Chrome, Opera, Safari*/
{
httpRequest = new XMLHttpRequest();
}
function makeRequestWizard( url, setColumnValuesWizard )
{
var sURL = unescape(window.location);
if( ! isServerBusy )
{
isServerBusy = true;
......@@ -750,10 +755,9 @@ function receiveResponseWizard( setColumnValuesWizard )
}
}
function processResponseWizard( setColumnValuesWizard )
{
var returnStr = null;
var returnStr = null;
isProcessOn = false;
if ( window.ActiveXObject )
{
......@@ -764,12 +768,12 @@ function processResponseWizard( setColumnValuesWizard )
{
try
{
var parser = new DOMParser();
xmldoc = httpRequest.responseText;
var parser = new DOMParser();
xmldoc = httpRequest.responseText;
}
catch(e)
{
alert("inside catch:"+e.message);
alert("inside catch:"+e.message);
}
}
//if( ! checkForError( xmldoc ) )
......@@ -777,59 +781,57 @@ function processResponseWizard( setColumnValuesWizard )
// setColumnValuesWizard( xmldoc );
// isServerBusy = false;
//}
console.log('setColumnValuesWizard.['+setColumnValuesWizard+']');
if( ! checkForError( xmldoc ) )
{
if ( setColumnValuesWizard == "cust_code" )
{
console.log('vicky 1.......'+xmldoc);
setPosCodeVal(xmldoc);
}
else if( setColumnValuesWizard == "pos_code" )
{
console.log('vicky 2.......'+xmldoc);
setPosDescrVal(xmldoc);
}
else if( setColumnValuesWizard == "item_ser" )
{
console.log('vicky 3.......'+xmldoc);
setItmDescrVal(xmldoc);
}
else if( setColumnValuesWizard == "price_list" )
{
console.log('vicky 4.......'+xmldoc);
setPrcDescrVal(xmldoc);
}
else
{
setColumnValuesWizard(xmldoc);
}
console.log('setColumnValuesWizard.['+setColumnValuesWizard+']');
if( ! checkForError( xmldoc ) )
{
if ( setColumnValuesWizard == "cust_code" )
{
console.log('vicky 1.......'+xmldoc);
setPosCodeVal(xmldoc);
}
else if( setColumnValuesWizard == "pos_code" )
{
console.log('vicky 2.......'+xmldoc);
setPosDescrVal(xmldoc);
}
else if( setColumnValuesWizard == "item_ser" )
{
console.log('vicky 3.......'+xmldoc);
setItmDescrVal(xmldoc);
}
else if( setColumnValuesWizard == "price_list" )
{
console.log('vicky 4.......'+xmldoc);
setPrcDescrVal(xmldoc);
}
else
{
setColumnValuesWizard(xmldoc);
}
}
isServerBusy = false;
}
function loadXMLString(txt)
{
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
}
else /* code for IE*/
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
return xmlDoc;
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
}
else /* code for IE*/
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
return xmlDoc;
}
function setColumnValuesWizard( retVal )
{
var xmldoc = null;
if (window.ActiveXObject)
{
......@@ -841,7 +843,7 @@ function setColumnValuesWizard( retVal )
var parser = new DOMParser();
xmldoc = parser.parseFromString(retVal,"text/xml" );
xmldoc=httpRequest.responseXML;
}
if( xmldoc.nodeType != 9 )
......@@ -878,7 +880,7 @@ function setColumnValuesWizard( retVal )
}//if (colNode.firstChild != null || colNode.firstChild != undefined)
colNewValue = ( colNewValue == "null" ) ? "" : colNewValue;
var obj = undefined;
if( isDotNotation )
{
//write logic to rebuild colName = colName.formNo.
......@@ -923,8 +925,6 @@ function setColumnValuesWizard( retVal )
}
}
function checkForError( retVal, argArr )
{
console.log("WizardItemchange.js >> checkForError....");
......@@ -934,12 +934,12 @@ function checkForError( retVal, argArr )
}
catch(err){}
if ( retVal.indexOf("<html>") != -1 || retVal.indexOf("<HTML>") != -1 )
{
return false;
return false;
}
var xmldoc = null;
if (window.ActiveXObject)
{
......@@ -951,14 +951,14 @@ function checkForError( retVal, argArr )
var parser = new DOMParser();
xmldoc = parser.parseFromString(retVal,"text/xml" );
if(xmldoc == null || xmldoc == "null" || xmldoc == "")
xmldoc=httpRequest.responseXML;
xmldoc=httpRequest.responseXML;
}
if( xmldoc.nodeType != 9 )
{
return true;;
}
var errorsNode = xmldoc.getElementsByTagName( "Errors" );
var column_name = "";
if( errorsNode.length != 0 )
......@@ -966,84 +966,84 @@ function checkForError( retVal, argArr )
var msg = "";
var toSave = false;
outer:
for(j = 0; j < errorsNode.length; j++) //Errors Node
{
inner:
for(i = 0; i < errorsNode.item(j).childNodes.length; i++) //error node
for(j = 0; j < errorsNode.length; j++) //Errors Node
{
var errorNode = errorsNode.item(j).childNodes.item(i);
var id ;
var type ;
var column_nameNode;
var column_name;
if(errorNode.attributes != null || column_nameNode != undefined)
{
id = errorNode.attributes.getNamedItem("id").value;
type = errorNode.attributes.getNamedItem("type").value;
column_nameNode = errorNode.attributes.getNamedItem("column_name");
if(column_nameNode != null || column_nameNode != undefined)
{
column_name = column_nameNode.value;
}
}
var noOfErrorChilds = errorNode.childNodes.length;
var tagName = new Array();
var tagValue = new Array();
var mesCtr = 0;
var descrCtr = 1;
var traceCtr = 2;
var redirCtr = 3;
for(ctr = 0 ; ctr < noOfErrorChilds; ctr++)
{
var errorChild = errorNode.childNodes.item(ctr);
tagName[ctr] = errorChild.NodeName;
if(errorChild.firstChild != null || errorChild.firstChild != undefined)
{
tagValue[ctr] = errorChild.firstChild.nodeValue;
}
else
{
tagValue[ctr] = "";
}
}
if (type=="E" || type=="X")
{
alert("Exception \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
global_save_level = "0";
toSave = false;
global_forced_save = "false";
break outer;
}
else if (type=="P")
{
alert("Prompt \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
toSave = true;
break outer;
}
else if (type=="W")
{
var Yes_or_No = confirm( "Warning \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
if ( Yes_or_No == 1 )
{
global_forced_save = "true";
toSave = true;
continue;
}
else
inner:
for(i = 0; i < errorsNode.item(j).childNodes.length; i++) //error node
{
global_save_level = "0";
toSave = false;
global_forced_save = "false";
break outer;
}
}//else if (type=="W")
}// for inner:
}//for outer:
var errorNode = errorsNode.item(j).childNodes.item(i);
var id ;
var type ;
var column_nameNode;
var column_name;
if(errorNode.attributes != null || column_nameNode != undefined)
{
id = errorNode.attributes.getNamedItem("id").value;
type = errorNode.attributes.getNamedItem("type").value;
column_nameNode = errorNode.attributes.getNamedItem("column_name");
if(column_nameNode != null || column_nameNode != undefined)
{
column_name = column_nameNode.value;
}
}
var noOfErrorChilds = errorNode.childNodes.length;
var tagName = new Array();
var tagValue = new Array();
var mesCtr = 0;
var descrCtr = 1;
var traceCtr = 2;
var redirCtr = 3;
for(ctr = 0 ; ctr < noOfErrorChilds; ctr++)
{
var errorChild = errorNode.childNodes.item(ctr);
tagName[ctr] = errorChild.NodeName;
if(errorChild.firstChild != null || errorChild.firstChild != undefined)
{
tagValue[ctr] = errorChild.firstChild.nodeValue;
}
else
{
tagValue[ctr] = "";
}
}
if (type=="E" || type=="X")
{
alert("Exception \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
global_save_level = "0";
toSave = false;
global_forced_save = "false";
break outer;
}
else if (type=="P")
{
alert("Prompt \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
toSave = true;
break outer;
}
else if (type=="W")
{
var Yes_or_No = confirm( "Warning \nMessage : " + tagValue[mesCtr] + "\nDescription : " + tagValue[descrCtr] + "\nTrace : " + tagValue[traceCtr] + "\nRedirect : " + tagValue[redirCtr]);
if ( Yes_or_No == 1 )
{
global_forced_save = "true";
toSave = true;
continue;
}
else
{
global_save_level = "0";
toSave = false;
global_forced_save = "false";
break outer;
}
}//else if (type=="W")
}// for inner:
}//for outer:
if (toSave)
{
if( argArr != null && argArr != undefined && argArr.length > 0 )
......@@ -1129,15 +1129,3 @@ function checkForError( retVal, argArr )
}
}
}
......@@ -3,9 +3,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
ibase.utility.UserInfoBean userInfo = ( ibase.utility.UserInfoBean )session.getAttribute( "USER_INFO" );
String itmSeries = "",posCode = "", priceList = "", acctprd = "",custCode = "",htmlData = "", fld_name = "";
System.out.println("@@@@@@@@@ In StrgBrandActPeriodCode.jsp @@@@@@@@@@@@@@@@");
SalesBudgetCustWizBean salesBudgetCustWizBean = new SalesBudgetCustWizBean();
SalesBudgetCustWizBean salesBudgetCustWizBean = new SalesBudgetCustWizBean( "sales_budget_cust_wiz", userInfo );
fld_name = ( String ) request.getParameter("FIELD_NAME");
System.out.println("@@@@@@@@@ In StrgBrandActPeriodCode.jsp FIELD_NAME =" +fld_name);
......@@ -25,15 +26,6 @@
acctprd = ( String ) request.getParameter("SELECTED_ACCT_PRD");
System.out.println("@@@@@@@@@ In StrgBrandActPeriodCode.jsp acctprd =" +acctprd);
ibase.utility.UserInfoBean userInfo = ( ibase.utility.UserInfoBean )session.getAttribute( "USER_INFO" );
System.out.println("@@@@@@@@@ In StrgBrandActPeriodCode.jsp userInfo ::"+userInfo.toString());
if( userInfo != null )
{
salesBudgetCustWizBean.setUserInfo( userInfo );
}
if ( fld_name.equalsIgnoreCase("CUST_CODE") && custCode != null )
{
htmlData = salesBudgetCustWizBean.getCustCode( custCode );
......
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