Commit 6c20f6d2 authored by ngadkari's avatar ngadkari

changes in sales orderIC condition added to set price list for cust_codedlv

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@179217 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4fcf9f62
...@@ -5704,7 +5704,142 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -5704,7 +5704,142 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsOrdtypeSample = distCommon.getDisparams("999999", "SAMPLE_ORDER_TYPE", conn); lsOrdtypeSample = distCommon.getDisparams("999999", "SAMPLE_ORDER_TYPE", conn);
lsOrderType = checkNull(genericUtility.getColumnValue("order_type", dom)); lsOrderType = checkNull(genericUtility.getColumnValue("order_type", dom));
sql = "SELECT price_list,price_list__clg FROM cust_plist WHERE cust_code =? AND order_type =?";
//Nandkumar Gadkari 29/01/18 Start ------------- CONDITION ADDED FOR SET PRICE LIST CUST_CODE
lsCustCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
lsDisIndOrdtypeList = distCommon.getDisparams("999999", "IND_ORD_TYPE", conn);
boolean lbOrdFlag = false;
String lsDisIndOrdtypeListArr[] = lsDisIndOrdtypeList.split(",");
if (lsDisIndOrdtypeListArr.length > 0) {
for (int i = 0; i < lsDisIndOrdtypeListArr.length; i++) {
if (lsOrderType.equalsIgnoreCase(lsDisIndOrdtypeListArr[i])) {
lbOrdFlag = true;
}
}
}
if (lbOrdFlag) {
System.out.println("insideIfprice_listnandkumar"+lsCustCode);
sql = "SELECT price_list,price_list__clg FROM cust_plist WHERE cust_code =? AND order_type =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCode);
pstmt.setString(2, lsOrderType);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPriceList = checkNull(rs.getString("price_list"));
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
if (lsPriceList == null || lsPriceList.trim().length() == 0) {
Timestamp orderDate = Timestamp.valueOf(
genericUtility.getValidDateString(genericUtility.getColumnValue("order_date", dom1),
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())
+ " 00:00:00.0");
lsPriceList = getPriceListOrderType(orderDate, dom, dom1, dom2, conn);
}
if (lsPriceList == null || lsPriceList.trim().length() == 0) {
lsPriceList = priceListSite(lsSiteCode, lsCustCode, conn);
}
} else {
sql = "SELECT price_list,price_list__clg FROM cust_plist WHERE cust_code =? AND order_type =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCodeDlv);
pstmt.setString(2, lsOrderType);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPriceList = checkNull(rs.getString("price_list"));
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("Site Code is" + lsSiteCode);
if (lsPriceList == null || lsPriceList.trim().length() == 0) {
Timestamp orderDate = Timestamp.valueOf(
genericUtility.getValidDateString(genericUtility.getColumnValue("order_date", dom1),
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())
+ " 00:00:00.0");
lsPriceList = getPriceListOrderType(orderDate, dom, dom1, dom2, conn);
}
if (lsPriceList == null || lsPriceList.trim().length() == 0) {
System.out.println("if Price list is null then Site Code is" + lsSiteCode);
lsPriceList = priceListSite(lsSiteCode, lsCustCodeDlv, conn);
}
}
if (lbOrdFlag) {
System.out.println("insideIfprice_listnandkumar2price_list__clg"+lsCustCode);
if (lsPlistClg == null || lsPlistClg.trim().length() == 0) {
sql = "select price_list__clg from site_customer where cust_code = ? and site_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCode);
pstmt.setString(2, lsSiteCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
if (lsPlistClg == null || lsPlistClg.trim().length() == 0) {
sql = "select price_list__clg from customer where cust_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
}
else {
if (lsPlistClg == null || lsPlistClg.trim().length() == 0) {
sql = "select price_list__clg from site_customer where cust_code = ? and site_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCodeDlv);
pstmt.setString(2, lsSiteCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
if (lsPlistClg == null || lsPlistClg.trim().length() == 0) {
sql = "select price_list__clg from customer where cust_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCodeDlv);
rs = pstmt.executeQuery();
if (rs.next()) {
lsPlistClg = checkNull(rs.getString("price_list__clg"));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
}
/* sql = "SELECT price_list,price_list__clg FROM cust_plist WHERE cust_code =? AND order_type =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCodeDlv); pstmt.setString(1, lsCustCodeDlv);
pstmt.setString(2, lsOrderType); pstmt.setString(2, lsOrderType);
...@@ -5755,8 +5890,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -5755,8 +5890,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null; rs = null;
} }*/
//---------------------Nandkumar Gadkari 29/01/18 end -------------
if (lsOrderType.equalsIgnoreCase(lsOrdtypeSample)) { if (lsOrderType.equalsIgnoreCase(lsOrdtypeSample)) {
valueXmlString.append("<price_list>").append("<![CDATA[]]>").append("</price_list>"); valueXmlString.append("<price_list>").append("<![CDATA[]]>").append("</price_list>");
} else { } else {
......
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