Commit 75e546ff authored by ssalve's avatar ssalve

Sarita: Done changes to set cr_term on itemchange for cust_code__bill and cust_code on 13 NOV 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192838 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bda029b4
...@@ -6223,6 +6223,47 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6223,6 +6223,47 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
valueXmlString.append("<state_code__dlv>").append("<![CDATA[" + lsStateCode + "]]>") valueXmlString.append("<state_code__dlv>").append("<![CDATA[" + lsStateCode + "]]>")
.append("</state_code__dlv>"); .append("</state_code__dlv>");
} }
//Added by sarita to set cr_term of on basis of cr_term_source is 'B' or 'C' on itemchange of cust_code__bill [START]
String crTermSource = "" , crTerm = "";
orderType = checkNull(genericUtility.getColumnValue("order_type",dom));
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
lsCustCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
System.out.println("On Itemchange of Customer Code Bill::: [orderType <"+orderType+">] \t [custCodeBill<"+custCodeBill+">] \t [lsCustCode<"+lsCustCode+">]");
sql = "select cr_term_source from sordertype where order_type = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType);
rs = pstmt.executeQuery();
if (rs.next())
{
crTermSource = checkNull(rs.getString("cr_term_source"));
}
if(rs != null) {rs.close(); rs = null;}
if(pstmt != null){pstmt.close(); pstmt = null;}
sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
if("B".equalsIgnoreCase(crTermSource))
{
pstmt.setString(1, custCodeBill);
}
else if("C".equalsIgnoreCase(crTermSource))
{
pstmt.setString(1, lsCustCode);
}
rs = pstmt.executeQuery();
if (rs.next())
{
crTerm = checkNull(rs.getString("cr_term"));
}
System.out.println("crTermSource ["+crTermSource+"] \t crTerm ["+crTerm+"]");
if(rs != null) {rs.close(); rs = null;}
if(pstmt != null){pstmt.close(); pstmt = null;}
System.out.println("crTermSource["+crTermSource+"] \t crTerm["+crTerm+"]");
valueXmlString.append("<cr_term>").append("<![CDATA[" + crTerm + "]]>").append("</cr_term>");
//Added by sarita to set cr_term of on basis of cr_term_source is 'B' or 'C' on itemchange of cust_code__bill [END]
} else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord")) { } else if (currentColumn.trim().equalsIgnoreCase("emp_code__ord")) {
String empCodeOrd = "", fname = "", lname = "", deptCode = ""; String empCodeOrd = "", fname = "", lname = "", deptCode = "";
empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom)); empCodeOrd = checkNull(genericUtility.getColumnValue("emp_code__ord", dom));
...@@ -6703,7 +6744,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6703,7 +6744,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
valueXmlString.append( valueXmlString.append(
itmCustCodeNotify(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext, conn)); itmCustCodeNotify(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext, conn));
} else if (currentColumn.trim().equalsIgnoreCase("cust_code")) { } else if (currentColumn.trim().equalsIgnoreCase("cust_code"))
{
System.out.println("--------------Inside itemchange of cust_code------------"); System.out.println("--------------Inside itemchange of cust_code------------");
String custCode = "", custName="", custNameBill = "", tranMode = "", mbillto = "", lsTerrcode = "", mslpers = "", String custCode = "", custName="", custNameBill = "", tranMode = "", mbillto = "", lsTerrcode = "", mslpers = "",
mslPers1 = "", mslPers2 = "", mcrTerm = ""; mslPers1 = "", mslPers2 = "", mcrTerm = "";
...@@ -8031,6 +8073,46 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -8031,6 +8073,46 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
valueXmlString.append("<frt_term>").append("<![CDATA[" + lsFrtterm + "]]>").append("</frt_term>"); valueXmlString.append("<frt_term>").append("<![CDATA[" + lsFrtterm + "]]>").append("</frt_term>");
setNodeValue(dom, "frt_term", getAbsString(lsFrtterm)); setNodeValue(dom, "frt_term", getAbsString(lsFrtterm));
//Added by sarita to set cr_term of on basis of cr_term_source is 'B' or 'C' on itemchange of cust_code [START]
String crTermSource = "" , crTerm = "";
orderType = checkNull(genericUtility.getColumnValue("order_type",dom));
custNameBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom));
custCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
System.out.println("On Itemchange of Customer Code ::: [orderType <"+orderType+">] \t [custNameBill<"+custNameBill+">] \t [custCode<"+custCode+">]");
sql = "select cr_term_source from sordertype where order_type = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType);
rs = pstmt.executeQuery();
if (rs.next())
{
crTermSource = checkNull(rs.getString("cr_term_source"));
}
if(rs != null) {rs.close(); rs = null;}
if(pstmt != null){pstmt.close(); pstmt = null;}
sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
if("B".equalsIgnoreCase(crTermSource))
{
pstmt.setString(1, custNameBill);
}
else if("C".equalsIgnoreCase(crTermSource))
{
pstmt.setString(1, custCode);
}
rs = pstmt.executeQuery();
if (rs.next())
{
crTerm = checkNull(rs.getString("cr_term"));
}
System.out.println("crTermSource ["+crTermSource+"] \t crTerm ["+crTerm+"]");
if(rs != null) {rs.close(); rs = null;}
if(pstmt != null){pstmt.close(); pstmt = null;}
System.out.println("crTermSource["+crTermSource+"] \t crTerm["+crTerm+"]");
valueXmlString.append("<cr_term>").append("<![CDATA[" + crTerm + "]]>").append("</cr_term>");
//Added by sarita to set cr_term of on basis of cr_term_source is 'B' or 'C' on itemchange of cust_code [END]
} else if (currentColumn.trim().equalsIgnoreCase("curr_code__ins")) { } else if (currentColumn.trim().equalsIgnoreCase("curr_code__ins")) {
valueXmlString = (itmCurrCodeIns(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext, valueXmlString = (itmCurrCodeIns(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext,
......
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