Commit 76c28a6e authored by prane's avatar prane

While using POB_ORD_TYPE list used foreach instead of contains and Change in...

While using POB_ORD_TYPE list used foreach instead of contains and Change in rate validation to check negative rate  and If order type not defined in distribution variable(POB_ORD_TYPE) and Price list is not defined or Rate less then zero or zero then system gives

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204498 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6c6f69b0
...@@ -1876,14 +1876,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1876,14 +1876,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn); lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlg = false; lbOrdFlg = false;
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0) { if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0)
{
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(","); String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>( ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
Arrays.asList(lsDisPobOrdtypeListArr)); //if (disPobOrdtypeList.contains(orderType)) {
if (disPobOrdtypeList.contains(orderType)) { for( String pobOrdType : disPobOrdtypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(orderType))
{
lbOrdFlg = true; lbOrdFlg = true;
} }
} }
}
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 + "]");
...@@ -2455,12 +2460,18 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2455,12 +2460,18 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
orderType = checkNullandTrim(genericUtility.getColumnValue("order_type", dom1)); orderType = checkNullandTrim(genericUtility.getColumnValue("order_type", dom1));
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn); lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlag = false; lbOrdFlag = false;
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0)
{
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(","); String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
for (int i = 0; i < lsDisPobOrdtypeListArr.length; i++) { ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
if (orderType.equalsIgnoreCase(lsDisPobOrdtypeListArr[i])) { //for (int i = 0; i < lsDisPobOrdtypeListArr.length; i++) {
//if (orderType.equalsIgnoreCase(lsDisPobOrdtypeListArr[i])) {
for( String pobOrdType : disPobOrdtypeList ) {
if(checkNull(pobOrdType).equalsIgnoreCase(orderType)) {
lbOrdFlag = true; lbOrdFlag = true;
} }
} }
}
System.out.println("lbOrdFlag[" + lbOrdFlag + "]"); System.out.println("lbOrdFlag[" + lbOrdFlag + "]");
System.out.println("errCode<<<<<<" + errCode + "]" + "schemeCode" + schemeCode + "]" System.out.println("errCode<<<<<<" + errCode + "]" + "schemeCode" + schemeCode + "]"
+ "nature" + nature + "]"); + "nature" + nature + "]");
...@@ -3537,9 +3548,28 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -3537,9 +3548,28 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
} }
//Pavan Rane 01aug19 Start[change in rate validation]
String lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
orderType = checkNull(genericUtility.getColumnValue("order_type", dom1));
boolean lbOrdFlg = false;
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0) {
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
//if (disPobOrdtypeList.contains(orderType))
for(String pobOrdType : disPobOrdtypeList)
{
if(checkNull(pobOrdType).equals(orderType))
{
lbOrdFlg = true;
}
}
}
//Pavan Rane 01aug19 End[change in rate validation]
lsListType = distCommon.getPriceListType(priceList, conn); lsListType = distCommon.getPriceListType(priceList, conn);
if (errCode == null || errCode.trim().length() == 0) { if (errCode == null || errCode.trim().length() == 0) {
if (priceList == null || priceList.trim().length() == 0 && rate <= 0) { //if (priceList == null || priceList.trim().length() == 0 && rate <= 0) { //Pavan Rane 01aug19 End[change in rate validation]
if ((!lbOrdFlg && ((priceList == null || priceList.trim().length() == 0) && rate <= 0 )) && (lbOrdFlg && rate < 0 ))
{
errCode = "VTRATE2"; errCode = "VTRATE2";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -3549,8 +3579,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -3549,8 +3579,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
if (errCode == null || errCode.trim().length() == 0) { if (errCode == null || errCode.trim().length() == 0) {
if (priceList == null || priceList.trim().length() == 0 && rate <= 0 //Pavan Rane 1aug19[to change if condtion]
&& !"B".equalsIgnoreCase(lsListType)) { //if (priceList == null || priceList.trim().length() == 0 && rate <= 0 && !"B".equalsIgnoreCase(lsListType)) {
if (priceList != null && priceList.trim().length() > 0 && rate <= 0 && !"B".equalsIgnoreCase(lsListType)) {
if (rate == 0) { if (rate == 0) {
String lrdateStr = ""; String lrdateStr = "";
if (ldtDate != null) { if (ldtDate != null) {
...@@ -10034,15 +10065,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -10034,15 +10065,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lbOrdFlag = false; lbOrdFlag = false;
System.out.println("===lsOrderType[" + lsDisPobOrdtypeList + "]"); System.out.println("===lsOrderType[" + lsDisPobOrdtypeList + "]");
System.out.println("===lsDisPobOrdtypeList.length[" + lsDisPobOrdtypeList.length() + "]"); System.out.println("===lsDisPobOrdtypeList.length[" + lsDisPobOrdtypeList.length() + "]");
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0) { if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0)
{
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(","); String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>( ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
Arrays.asList(lsDisPobOrdtypeListArr));
System.out.println("disPobOrdtypeList[" + disPobOrdtypeList + "]"); System.out.println("disPobOrdtypeList[" + disPobOrdtypeList + "]");
if (disPobOrdtypeList.contains(lsOrderType)) { //if (disPobOrdtypeList.contains(lsOrderType)) {
for( String pobOrdType : disPobOrdtypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(lsOrderType)) {
lbOrdFlag = true; lbOrdFlag = true;
} }
} }
}
System.out.println("lsItemStru[" + lsItemStru + "] lsSchemeCode[" + lsSchemeCode + "]lbOrdFlag[" System.out.println("lsItemStru[" + lsItemStru + "] lsSchemeCode[" + lsSchemeCode + "]lbOrdFlag["
+ lbOrdFlag + "]"); + lbOrdFlag + "]");
if (lbOrdFlag == true) { if (lbOrdFlag == true) {
...@@ -15003,13 +15038,18 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15003,13 +15038,18 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsDisPobOrdTypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn); lsDisPobOrdTypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlag = false; lbOrdFlag = false;
if (lsDisPobOrdTypeList.trim().length() > 0) { if (lsDisPobOrdTypeList != null && lsDisPobOrdTypeList.trim().length() > 0)
{
String lsDisPobOrdTypeListArr[] = lsDisPobOrdTypeList.split(","); String lsDisPobOrdTypeListArr[] = lsDisPobOrdTypeList.split(",");
ArrayList<String> disPobOrdTypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdTypeListArr)); ArrayList<String> disPobOrdTypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdTypeListArr));
if (disPobOrdTypeList.contains(lsOrderType)) { //if (disPobOrdTypeList.contains(lsOrderType)) {
for( String pobOrdType : disPobOrdTypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(lsOrderType)) {
lbOrdFlag = true; lbOrdFlag = true;
} }
} }
}
System.out.println("lbOrdFlag>?>>>[" + lbOrdFlag + "]lsItemStru>>>" + lsItemStru + "] lsSchemeCode[" System.out.println("lbOrdFlag>?>>>[" + lbOrdFlag + "]lsItemStru>>>" + lsItemStru + "] lsSchemeCode["
+ lsSchemeCode + "]"); + lsSchemeCode + "]");
if (lbOrdFlag) { if (lbOrdFlag) {
......
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