Commit 9679a2b3 authored by ngadkari's avatar ngadkari

Changes for item flag B in item code validation

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214486 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 90692db4
...@@ -1844,7 +1844,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1844,7 +1844,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
if (errCode == null || errCode.trim().length() == 0) { // if (errCode == null || errCode.trim().length() == 0) {Commented condition by nandkumar gadkai on 03/01/20
cnt = 0; cnt = 0;
sql = "Select case when eou is null then 'N' else eou end as eou From site Where site_code =?"; sql = "Select case when eou is null then 'N' else eou end as eou From site Where site_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1902,7 +1902,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1902,7 +1902,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
} }
} //} Commented condition by nandkumar gadkai on 03/01/20
orderType = checkNull(genericUtility.getColumnValue("order_type", dom1)); orderType = checkNull(genericUtility.getColumnValue("order_type", dom1));
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn); lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
...@@ -1920,7 +1920,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1920,7 +1920,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
} }
if (errCode == null || errCode.trim().length() == 0) { //if (errCode == null || errCode.trim().length() == 0) {
schAttr = checkNull(genericUtility.getColumnValue("sch_attr", dom)); schAttr = checkNull(genericUtility.getColumnValue("sch_attr", dom));
System.out.println("schAttr::[" + schAttr + "]"); System.out.println("schAttr::[" + schAttr + "]");
nature = checkNull(genericUtility.getColumnValue("nature", dom)); nature = checkNull(genericUtility.getColumnValue("nature", dom));
...@@ -1951,9 +1951,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1951,9 +1951,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
} //}Commented condition by nandkumar gadkai on 03/01/20
if (errCode == null || errCode.trim().length() == 0) { // if (errCode == null || errCode.trim().length() == 0) {Commented condition by nandkumar gadkai on 03/01/20
if ("B".equalsIgnoreCase(itemFlag) && (!lbOrdFlg)) { if ("B".equalsIgnoreCase(itemFlag) && (!lbOrdFlg)) {
if (itemCode == null || itemCode.length() == 0) { if (itemCode == null || itemCode.length() == 0) {
System.out.println("VTITEM81"); System.out.println("VTITEM81");
...@@ -2042,7 +2042,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2042,7 +2042,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
Arrays.asList(applyCustListArr)); Arrays.asList(applyCustListArr));
if (ApplyCustList.contains(custCode.trim())) { if (ApplyCustList.contains(custCode.trim())) {
lbProceed = true; lbProceed = true;
break; //break;Commented by nandkumar gadkai on 03/01/20
} }
if (!lbProceed) { if (!lbProceed) {
System.out.println("VTITEM87"); System.out.println("VTITEM87");
...@@ -2058,7 +2058,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2058,7 +2058,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
Arrays.asList(noapplyCustListArr)); Arrays.asList(noapplyCustListArr));
if (NoapplyCustListArr.contains(custCode)) { if (NoapplyCustListArr.contains(custCode)) {
lbProceed = false; lbProceed = false;
break; //break;Commented by nandkumar gadkai on 03/01/20
} }
if (!lbProceed) { if (!lbProceed) {
System.out.println("VTITEM88"); System.out.println("VTITEM88");
...@@ -2223,7 +2223,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2223,7 +2223,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
if (errCode == null || errCode.trim().length() == 0) { //if (errCode == null || errCode.trim().length() == 0) {Commented condition by nandkumar gadkai on 03/01/20
itemSer = distCommon.getItemSer(itemCode, siteCode, orderDate, custCode, "C", conn); itemSer = distCommon.getItemSer(itemCode, siteCode, orderDate, custCode, "C", conn);
itemSerHdr = checkNullandTrim(genericUtility.getColumnValue("item_ser", dom1)); itemSerHdr = checkNullandTrim(genericUtility.getColumnValue("item_ser", dom1));
...@@ -2298,8 +2298,112 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2298,8 +2298,112 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
//}Commented condition by nandkumar gadkai on 03/01/20
}
else// else condition added by nandkumar gadkari on 03/01/20 for scheme check item code ord ----------start----------------
{
itemCodeOrd = checkNull(genericUtility.getColumnValue("item_code__ord", dom));
errCode = isItem(siteCode, itemCodeOrd, modName, conn);
if (errCode != null && errCode.trim().length() > 0) {
sql = "select active from item where item_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCodeOrd);
rs = pstmt.executeQuery();
if (rs.next()) {
active = checkNull(rs.getString("active"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ("D".equalsIgnoreCase(active)) {
errCode = "VTITMONALR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} }
//if (errCode == null || errCode.trim().length() == 0) {Commented condition by nandkumar gadkai on 03/01/20
itemSer = distCommon.getItemSer(itemCodeOrd, siteCode, orderDate, custCode, "C", conn);
itemSerHdr = checkNullandTrim(genericUtility.getColumnValue("item_ser", dom1));
sql = "select oth_series from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSerHdr);
rs = pstmt.executeQuery();
if (rs.next()) {
mothSer = checkNullandTrim(rs.getString("oth_series"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (mothSer == null || mothSer.trim().length() == 0) {
mothSer = "N";
}
itemSerProm = checkNullandTrim(genericUtility.getColumnValue("item_ser__prom", dom));
sql = "select item_ser from item_credit_perc where item_code = ? and item_ser"
+ " in ( select item_ser from customer_series where cust_code = ? and item_ser = item_credit_perc.item_ser)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCodeOrd);
pstmt.setString(2, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemSerCrPerc = checkNullandTrim(rs.getString("item_ser"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("itemSerHdr[" + itemSerHdr + "] itemSer[" + itemSer
+ "] mothSer[" + mothSer + "] lsItemSerCrPerc[" + lsItemSerCrPerc
+ "] itemSerProm[" + itemSerProm + "]");
if (!itemSerHdr.equalsIgnoreCase(itemSer.trim()) && "N".equalsIgnoreCase(mothSer)
&& !(lsItemSerCrPerc.equalsIgnoreCase(itemSerProm))) {
errCode = "VTITEM2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (!itemSerHdr.equalsIgnoreCase(itemSer.trim())
&& "G".equalsIgnoreCase(mothSer)) {
sql = "select (case when item_ser__crpolicy is null then item_ser else item_ser__crpolicy end) as item_ser__crpolicy"
+ " from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSerHdr);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemSerCrpolicyHdr = rs.getString("item_ser__crpolicy");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select (case when item_ser__crpolicy is null then item_ser else item_ser__crpolicy end) as item_ser__crpolicy"
+ " from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
if (rs.next()) {
lsItemSerCrpolicy = checkNullandTrim(rs.getString("item_ser__crpolicy"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (!lsItemSerCrpolicy.equalsIgnoreCase(lsItemSerCrpolicyHdr)) {
errCode = "VTITEM2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//}Commented condition by nandkumar gadkai on 03/01/20
} }
// else condition added by nandkumar gadkari on 03/01/20 for scheme check item code ord ----------end----------------
sql = "select stop_business, (case when sale_option is null then 'A' else sale_option end) as sale_option, contract_req" sql = "select stop_business, (case when sale_option is null then 'A' else sale_option end) as sale_option, contract_req"
+ " from item where item_code =?"; + " from item where item_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -2363,7 +2467,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2363,7 +2467,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
} }
} //}Commented condition by nandkumar gadkai on 03/01/20
} }
// quantity // quantity
else if (childNodeName.equalsIgnoreCase("quantity")) { else if (childNodeName.equalsIgnoreCase("quantity")) {
......
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