Commit 437b9cc5 authored by ssalve's avatar ssalve

Sarita : Done changes to set cr_term on 15 NOV 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@193000 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7c1f2b22
...@@ -4114,6 +4114,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -4114,6 +4114,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
String reStr = ""; String reStr = "";
Timestamp ldDueDate = null; Timestamp ldDueDate = null;
String crTermSource = ""; // Added by sarita on 15 NOV 2018
try { try {
// conn = connDriver.getConnectDB("DriverITM"); // conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
...@@ -4394,17 +4395,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -4394,17 +4395,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
valueXmlString.append(reStr); valueXmlString.append(reStr);
} }
sql = "select cust_tax_opt from sordertype where order_type = ? "; //Added and commented by sarita to set cr_term_source on 15 NOV 2018 [START]
//sql = "select cust_tax_opt from sordertype where order_type = ? ";
sql = "select cust_tax_opt,cr_term_source from sordertype where order_type = ? ";
//Added and commented by sarita to set cr_term_source on 15 NOV 2018 [END]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsOrderType); pstmt.setString(1, lsOrderType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
custTaxOpt = checkNull(rs.getString("cust_tax_opt")); custTaxOpt = checkNull(rs.getString("cust_tax_opt"));
//Added by sarita on 15 NOV 2018 [START]
crTermSource = checkNull(rs.getString("cr_term_source"));
//Added by sarita on 15 NOV 2018 [END]
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt)) if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt))
{ {
custTaxOpt = "0"; custTaxOpt = "0";
...@@ -4414,39 +4433,93 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -4414,39 +4433,93 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
sql = "select cr_term__np from customer_series where cust_code =? and item_ser = ? "; sql = "select cr_term__np from customer_series where cust_code =? and item_ser = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //changed by Pavan R on 16aug18 [to set cr_term on billto/dlvto] //pstmt.setString(1, lsCustCode); //changed by Pavan R on 16aug18 [to set cr_term on billto/dlvto]
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill1); pstmt.setString(1, custCodeBill1);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, lsCustCodeDlv); pstmt.setString(1, lsCustCodeDlv);
}*/
if((crTermSource != null ) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
} }
else if((crTermSource != null ) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, lsCustCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTermNp = rs.getString("cr_term__np"); mcrTermNp = rs.getString("cr_term__np");
} }
//Added and commented by sarita on 15 NOV 2018 [START]
/*rs.close();
rs = null;
pstmt.close();
pstmt = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if (mcrTermNp == null || mcrTermNp.trim().length() == 0) { if (mcrTermNp == null || mcrTermNp.trim().length() == 0) {
sql = "select cr_term__np from customer where cust_code = ? "; sql = "select cr_term__np from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //pstmt.setString(1, lsCustCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill1); pstmt.setString(1, custCodeBill1);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, lsCustCodeDlv); pstmt.setString(1, lsCustCodeDlv);
}*/
if((crTermSource != null ) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
}
else if((crTermSource != null ) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, lsCustCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
} }
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTermNp = rs.getString("cr_term__np"); mcrTermNp = rs.getString("cr_term__np");
} }
//Added and commented by sarita on 15 NOV 2018 [START]
/*rs.close();
rs = null;
pstmt.close();
pstmt = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
//Added and commented by sarita on 15 NOV 2018 [END]
}
valueXmlString.append("<cr_term>").append("<![CDATA[" + mcrTermNp + "]]>").append("</cr_term>"); valueXmlString.append("<cr_term>").append("<![CDATA[" + mcrTermNp + "]]>").append("</cr_term>");
setNodeValue(dom, "cr_term", getAbsString(mcrTermNp)); setNodeValue(dom, "cr_term", getAbsString(mcrTermNp));
sql = "select descr from crterm where cr_term = ? "; sql = "select descr from crterm where cr_term = ? ";
...@@ -4484,21 +4557,48 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -4484,21 +4557,48 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
sql = "select cr_term from customer_series where cust_code =? and item_ser =?"; sql = "select cr_term from customer_series where cust_code =? and item_ser =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //pstmt.setString(1, lsCustCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill1); pstmt.setString(1, custCodeBill1);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, lsCustCodeDlv); pstmt.setString(1, lsCustCodeDlv);
}*/
if((crTermSource != null ) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
} }
else if((crTermSource != null ) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, lsCustCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrterm = rs.getString("cr_term"); mcrterm = rs.getString("cr_term");
} }
//Added and commented by sarita on 15 NOV 2018 [START]
/*rs.close();
rs = null;
pstmt.close();
pstmt = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
//Added and commented by sarita on 15 NOV 2018 [END]
}
valueXmlString.append("<cr_term>").append("<![CDATA[" + mcrterm + "]]>").append("</cr_term>"); valueXmlString.append("<cr_term>").append("<![CDATA[" + mcrterm + "]]>").append("</cr_term>");
setNodeValue(dom, "cr_term", getAbsString(mcrterm)); setNodeValue(dom, "cr_term", getAbsString(mcrterm));
...@@ -5810,17 +5910,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -5810,17 +5910,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
siteCodeShip = checkNull(genericUtility.getColumnValue("site_code__ship", dom)); siteCodeShip = checkNull(genericUtility.getColumnValue("site_code__ship", dom));
mItemSer = checkNull(genericUtility.getColumnValue("item_ser", dom)); mItemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
orderType = checkNull(genericUtility.getColumnValue("order_type",dom)); orderType = checkNull(genericUtility.getColumnValue("order_type",dom));
sql = "select cust_tax_opt from sordertype where order_type = ? "; //Commented and Added by sarita to set cr_term_source on 15 NOV 2018 [START]
//sql = "select cust_tax_opt from sordertype where order_type = ? ";
sql = "select cust_tax_opt,cr_term_source from sordertype where order_type = ? ";
//Commented and Added by sarita to set cr_term_source on 15 NOV 2018 [END]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType); pstmt.setString(1, orderType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
custTaxOpt = checkNull(rs.getString("cust_tax_opt")); custTaxOpt = checkNull(rs.getString("cust_tax_opt"));
//Added by sarita on 15 NOV 2018 [START]
crTermSource = checkNull(rs.getString("cr_term_source"));
//Added by sarita on 15 NOV 2018 [END]
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt)) if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt))
{ {
custTaxOpt = "0"; custTaxOpt = "0";
...@@ -5949,98 +6067,231 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -5949,98 +6067,231 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
if (lbOrdFlag) { if (lbOrdFlag) {
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?"; sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
//pstmt.setString(1, lsCustCode); //changed by Pavan R on 16aug18 [to set cr_term on billto/dlvto] //pstmt.setString(1, lsCustCode); //changed by Pavan R on 16aug18 [to set cr_term on billto/dlvto]
if("1".equals(custTaxOpt)) { /*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
} }
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if (mcrTerm == null || mcrTerm.trim().length() == 0) { if (mcrTerm == null || mcrTerm.trim().length() == 0) {
sql = "select cr_term from customer where cust_code = ?"; sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //pstmt.setString(1, lsCustCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
} }
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
}
} else { } else {
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?"; sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //pstmt.setString(1, lsCustCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill1);
} }
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if (mcrTerm == null || mcrTerm.trim().length() == 0) { if (mcrTerm == null || mcrTerm.trim().length() == 0) {
sql = "select cr_term from customer where cust_code = ?"; sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, lsCustCode); //pstmt.setString(1, lsCustCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
} }
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
}
} }
if (!lbOrdFlag) { if (!lbOrdFlag) {
sql = "select cr_term from customer where cust_code = ?"; sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, custCodeBill); //pstmt.setString(1, custCodeBill);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill); pstmt.setString(1, custCodeBill);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill);
} }
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, lsCustCode);
}
//Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
}
if (lsOrderType != null || lsOrderType.trim().length() > 0) { if (lsOrderType != null && lsOrderType.trim().length() > 0) {
valueXmlString.append("<order_type>").append("<![CDATA[" + lsOrderType + "]]>") valueXmlString.append("<order_type>").append("<![CDATA[" + lsOrderType + "]]>")
.append("</order_type>"); .append("</order_type>");
setNodeValue(dom, "order_type", getAbsString(lsOrderType)); setNodeValue(dom, "order_type", getAbsString(lsOrderType));
...@@ -6223,47 +6474,6 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6223,47 +6474,6 @@ 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((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeBill);
}
else if((crTermSource != null) && ("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));
...@@ -6837,17 +7047,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6837,17 +7047,35 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
custCodeDlv = custCode; custCodeDlv = custCode;
} }
System.out.println("6244orderType::["+orderType+"]custCodeDlv["+custCodeDlv+"]"); System.out.println("6244orderType::["+orderType+"]custCodeDlv["+custCodeDlv+"]");
sql = "select cust_tax_opt from sordertype where order_type = ? "; //Commented and Added by sarita to add cr_term_source in sql on 15 NOV 2018 [START]
//sql = "select cust_tax_opt from sordertype where order_type = ? ";
sql = "select cust_tax_opt,cr_term_source from sordertype where order_type = ? ";
//Commented and Added by sarita to add cr_term_source in sql on 15 NOV 2018 [END]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType); pstmt.setString(1, orderType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
custTaxOpt = checkNull(rs.getString("cust_tax_opt")); custTaxOpt = checkNull(rs.getString("cust_tax_opt"));
//Added by sarita on 15 NOV 2018 [START]
crTermSource = checkNull(rs.getString("cr_term_source"));
//Added by sarita on 15 NOV 2018 [END]
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt)) if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt))
{ {
custTaxOpt = "0"; custTaxOpt = "0";
...@@ -6959,30 +7187,71 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6959,30 +7187,71 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?"; sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, custCode); //changed by Pavan R on 16aug18 start [to set cr_term on billto/dlvto] //pstmt.setString(1, custCode); //changed by Pavan R on 16aug18 start [to set cr_term on billto/dlvto]
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, mbillto); pstmt.setString(1, mbillto);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, custCode);
} }
//Commented and Added by sarita to set customer on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
} }
pstmt.close(); //Added and commented by sarita on 15 NOV 2018 [START]
/*pstmt.close();
pstmt = null; pstmt = null;
rs.close();
rs = null; */
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and commented by sarita on 15 NOV 2018 [END]
if (mcrTerm == null || mcrTerm.trim().length() == 0) { if (mcrTerm == null || mcrTerm.trim().length() == 0) {
sql = "select cr_term from customer where cust_code = ?"; sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, custCode); //pstmt.setString(1, custCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, mbillto); pstmt.setString(1, mbillto);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
} }
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, custCode);
}
//Commented and Added by sarita to set customer on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
...@@ -6996,11 +7265,25 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -6996,11 +7265,25 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?"; sql = "select cr_term from customer_series where cust_code = ? and item_ser= ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, custCode); //pstmt.setString(1, custCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, mbillto); pstmt.setString(1, mbillto);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
}
else
{
pstmt.setString(1, custCode);
} }
//Commented and Added by sarita to set customer on basis of cr_term_source 15 NOV 2018 [END]
pstmt.setString(2, lsItemser); pstmt.setString(2, lsItemser);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
...@@ -7015,11 +7298,25 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -7015,11 +7298,25 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
sql = "select cr_term from customer where cust_code = ?"; sql = "select cr_term from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, custCode); //pstmt.setString(1, custCode);
if("1".equals(custTaxOpt)) { //Commented and Added by sarita to set customer on on basis of cr_term_source 15 NOV 2018 [START]
/*if("1".equals(custTaxOpt)) {
pstmt.setString(1, mbillto); pstmt.setString(1, mbillto);
}else if("0".equals(custTaxOpt)) { }else if("0".equals(custTaxOpt)) {
pstmt.setString(1, custCodeDlv); pstmt.setString(1, custCodeDlv);
}*/
if((crTermSource != null) && ("B".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, mbillto);
}
else if((crTermSource != null) && ("D".equalsIgnoreCase(crTermSource)))
{
pstmt.setString(1, custCodeDlv);
} }
else
{
pstmt.setString(1, custCode);
}
//Commented and Added by sarita to set customer on basis of cr_term_source 15 NOV 2018 [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
mcrTerm = rs.getString("cr_term"); mcrTerm = rs.getString("cr_term");
...@@ -8073,47 +8370,6 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -8073,47 +8370,6 @@ 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,
conn)); conn));
......
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