Commit 9c40a986 authored by Mohammed Dohadwala's avatar Mohammed Dohadwala

Show Stockist and Distributor names on Stockist code selection; fetch...

Show Stockist and Distributor names on Stockist code selection; fetch cust_code from Detail1 and populate it in Detail3.
parent b7955738
......@@ -1502,17 +1502,22 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val
}
while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
BaseLogger.log("3", getUserInfo(), null, "CURRENT COLUMN ["+currentColumn+"]");
BaseLogger.log("3", getUserInfo(), null, "CURRENT COLUMN ["+currentColumn+"]");
if(currentColumn.equalsIgnoreCase("cust_code__stk"))
{
String custCodeStk = "";
String custCodeDist = "";
String stockistName = "";
String distributorName = "";
custCodeStk = checkNull(genericUtility.getColumnValue("cust_code__stk", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom1));
BaseLogger.log("3", getUserInfo(), null, "cust_code from Detail1 [" + custCode + "]");
valueXmlString.append("<cust_code>")
.append("<![CDATA["+custCode+"]]>")
.append("</cust_code>");
BaseLogger.log("3", getUserInfo(), null, "custCodeStk [" + custCodeStk + "]");
BaseLogger.log("3", getUserInfo(), null, "custCode [" + custCode + "]");
......@@ -1546,6 +1551,64 @@ public class SalesQuotationIC extends ValidatorEJB implements ValidatorLocal,Val
valueXmlString.append("<cust_code__dist>")
.append("<![CDATA["+custCodeDist+"]]>")
.append("</cust_code__dist>");
/* -------- NAME LOGIC -------- */
if(custCodeStk.trim().length() > 0)
{
sql = "select cust_name from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeStk);
rs = pstmt.executeQuery();
if(rs.next())
{
stockistName = rs.getString("cust_name");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
valueXmlString.append("<stockist_name>")
.append("<![CDATA["+stockistName+"]]>")
.append("</stockist_name>");
if(custCodeDist.trim().length() > 0)
{
sql = "select cust_name from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCodeDist);
rs = pstmt.executeQuery();
if(rs.next())
{
distributorName = rs.getString("cust_name");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
valueXmlString.append("<distributor_name>")
.append("<![CDATA["+distributorName+"]]>")
.append("</distributor_name>");
}
valueXmlString.append("</Detail3>");
......
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