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,12 +1876,17 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlg = false;
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0) {
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0)
{
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(
Arrays.asList(lsDisPobOrdtypeListArr));
if (disPobOrdtypeList.contains(orderType)) {
lbOrdFlg = true;
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
//if (disPobOrdtypeList.contains(orderType)) {
for( String pobOrdType : disPobOrdtypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(orderType))
{
lbOrdFlg = true;
}
}
}
if (errCode == null || errCode.trim().length() == 0) {
......@@ -2455,10 +2460,16 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
orderType = checkNullandTrim(genericUtility.getColumnValue("order_type", dom1));
lsDisPobOrdtypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlag = false;
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
for (int i = 0; i < lsDisPobOrdtypeListArr.length; i++) {
if (orderType.equalsIgnoreCase(lsDisPobOrdtypeListArr[i])) {
lbOrdFlag = true;
if (lsDisPobOrdtypeList != null && lsDisPobOrdtypeList.trim().length() > 0)
{
String lsDisPobOrdtypeListArr[] = lsDisPobOrdtypeList.split(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
//for (int i = 0; i < lsDisPobOrdtypeListArr.length; i++) {
//if (orderType.equalsIgnoreCase(lsDisPobOrdtypeListArr[i])) {
for( String pobOrdType : disPobOrdtypeList ) {
if(checkNull(pobOrdType).equalsIgnoreCase(orderType)) {
lbOrdFlag = true;
}
}
}
System.out.println("lbOrdFlag[" + lbOrdFlag + "]");
......@@ -3536,10 +3547,29 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out.println("Rate is less Than MinRate of Pricelist["+rate+"]<["+lcMaxRate+"]");
}
}
}
//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);
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";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -3548,9 +3578,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
}
}
if (errCode == null || errCode.trim().length() == 0) {
if (priceList == null || priceList.trim().length() == 0 && rate <= 0
&& !"B".equalsIgnoreCase(lsListType)) {
if (errCode == null || errCode.trim().length() == 0) {
//Pavan Rane 1aug19[to change if condtion]
//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) {
String lrdateStr = "";
if (ldtDate != null) {
......@@ -10034,13 +10065,17 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lbOrdFlag = false;
System.out.println("===lsOrderType[" + lsDisPobOrdtypeList + "]");
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(",");
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(
Arrays.asList(lsDisPobOrdtypeListArr));
ArrayList<String> disPobOrdtypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdtypeListArr));
System.out.println("disPobOrdtypeList[" + disPobOrdtypeList + "]");
if (disPobOrdtypeList.contains(lsOrderType)) {
lbOrdFlag = true;
//if (disPobOrdtypeList.contains(lsOrderType)) {
for( String pobOrdType : disPobOrdtypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(lsOrderType)) {
lbOrdFlag = true;
}
}
}
System.out.println("lsItemStru[" + lsItemStru + "] lsSchemeCode[" + lsSchemeCode + "]lbOrdFlag["
......@@ -15003,11 +15038,16 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsDisPobOrdTypeList = distCommon.getDisparams("999999", "POB_ORD_TYPE", conn);
lbOrdFlag = false;
if (lsDisPobOrdTypeList.trim().length() > 0) {
if (lsDisPobOrdTypeList != null && lsDisPobOrdTypeList.trim().length() > 0)
{
String lsDisPobOrdTypeListArr[] = lsDisPobOrdTypeList.split(",");
ArrayList<String> disPobOrdTypeList = new ArrayList<String>(Arrays.asList(lsDisPobOrdTypeListArr));
if (disPobOrdTypeList.contains(lsOrderType)) {
lbOrdFlag = true;
//if (disPobOrdTypeList.contains(lsOrderType)) {
for( String pobOrdType : disPobOrdTypeList )
{
if(checkNull(pobOrdType).equalsIgnoreCase(lsOrderType)) {
lbOrdFlag = true;
}
}
}
System.out.println("lbOrdFlag>?>>>[" + lbOrdFlag + "]lsItemStru>>>" + lsItemStru + "] lsSchemeCode["
......
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