Commit 8254a546 authored by agaikwad's avatar agaikwad

Added order type column condition in validation and item change of column total qty and item code.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99447 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f3e92619
...@@ -2316,15 +2316,15 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -2316,15 +2316,15 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null , pstmt1 = null; PreparedStatement pstmt = null , pstmt1 = null,pstmt2 = null;
ResultSet rs = null ,rs1 = null ; ResultSet rs = null ,rs1 = null,rs2=null ;
int ctr=0; int ctr=0;
String childNodeName = null; String childNodeName = null;
String columnValue = null; String columnValue = null;
String Col_name = ""; String Col_name = "";
int currentFormNo = 0 ,cnt = 0; int currentFormNo = 0 ,cnt = 0;
String cadreCode="" ; String cadreCode="" ;
String sql = "",descr="",locCode = "",empCode="",locDescr=""; String sql = "",descr="",locCode = "",empCode="",locDescr="",sql1 = "";
String siteCode = null; String siteCode = null;
String empLname = null,empMname = null,empFname = null; String empLname = null,empMname = null,empFname = null;
String itemDescr = null,itemCode = null; String itemDescr = null,itemCode = null;
...@@ -2381,6 +2381,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -2381,6 +2381,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String siteString = null; String siteString = null;
String disparmLoc = null; String disparmLoc = null;
String schemeCode = null; String schemeCode = null;
String lscustschemecode = null;
String custCd = null; String custCd = null;
String stateCd = null; String stateCd = null;
String lsItemCode = null; String lsItemCode = null;
...@@ -2453,6 +2454,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -2453,6 +2454,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String disparmVal = null; String disparmVal = null;
String salesPers = ""; String salesPers = "";
String Descr= null; String Descr= null;
int cnt1= 0;
try try
{ {
...@@ -4538,7 +4540,24 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4538,7 +4540,24 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{ {
lsCurscheme = rs.getString("scheme_code") == null ? "" : rs.getString("scheme_code"); lsCurscheme = rs.getString("scheme_code") == null ? "" : rs.getString("scheme_code");
System.out.println("Scheme COde of table scheme applicability total "+lsCurscheme); System.out.println("Scheme COde of table scheme applicability total "+lsCurscheme);
mcount = 0 ; sql1="select count(1)From scheme_applicability A,bom b Where A.scheme_code = b.bom_code And B.bom_code = ? " +
"And (? between case when min_qty is null then 0 else min_qty end And case when max_qty is null then 0 else max_qty end) and B.promo_term is null";
pstmt2= conn.prepareStatement(sql1);
pstmt2.setString(1,lsCurscheme);
pstmt2.setString(2,totqtyStr);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
cnt1= rs2.getInt(1);
}
rs2.close();
pstmt2.close();
pstmt2 = null;
rs2 = null;
if(cnt1 == 0)
{
continue;
}
sql ="select (case when apply_cust_list is null then '' else apply_cust_list end) apply_cust_list, " sql ="select (case when apply_cust_list is null then '' else apply_cust_list end) apply_cust_list, "
+" (case when noapply_cust_list is null then '' else noapply_cust_list end) noapply_cust_list, " +" (case when noapply_cust_list is null then '' else noapply_cust_list end) noapply_cust_list, "
+" order_type from scheme_applicability where scheme_code = ? " ; +" order_type from scheme_applicability where scheme_code = ? " ;
...@@ -4571,8 +4590,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4571,8 +4590,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (pos > -1) if (pos > -1)
{ {
lsToken = distCommon.getToken(applicableordtypes,","); lsToken = distCommon.getToken(applicableordtypes,",");
System.out System.out.println("Token is:"+lsToken);
.println("Token is:"+lsToken);
if (orderType.trim().equals(lsToken.trim())) if (orderType.trim().equals(lsToken.trim()))
{ {
System.out.println("order type matched.....["+orderType + "]"); System.out.println("order type matched.....["+orderType + "]");
...@@ -4599,10 +4617,13 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4599,10 +4617,13 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
System.out.println("SCheme code is" +lsPrevscheme); System.out.println("SCheme code is" +lsPrevscheme);
schemeCode = lsCurscheme ; schemeCode = lsCurscheme ;
System.out.println("Scheme COde"+schemeCode); System.out.println("Scheme COde"+schemeCode);
System.out.println("Apply Cust Code is" +applyCustList);
if (applyCustList.trim().length() > 0) if (applyCustList.trim().length() > 0)
{ {
schemeCode = null; schemeCode = null;
mcustCd = genericUtility.getColumnValue("cust_code",dom1); mcustCd = genericUtility.getColumnValue("cust_code",dom1);
System.out
.println("Cust code is :" + mcustCd);
mcustCd = mcustCd == null ?"" : mcustCd; mcustCd = mcustCd == null ?"" : mcustCd;
while(applyCustList.trim().length() > 0) while(applyCustList.trim().length() > 0)
{ {
...@@ -4613,6 +4634,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4613,6 +4634,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (applyCust.trim().equals( mcustCd.trim())) if (applyCust.trim().equals( mcustCd.trim()))
{ {
schemeCode = lsCurscheme; schemeCode = lsCurscheme;
//code add
break; break;
} }
applyCustList = applyCustList.substring(pos+1); applyCustList = applyCustList.substring(pos+1);
...@@ -4624,14 +4646,16 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4624,14 +4646,16 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (mcustCd.trim().equals( applyCustList.trim())) if (mcustCd.trim().equals( applyCustList.trim()))
{ {
schemeCode = lsCurscheme; schemeCode = lsCurscheme;
System.out.println("Else SchemeCOde" + schemeCode);
} }
break; break;
} }
} }
} }
if(schemeCode != null && noapplyCustList != null && noapplyCustList.trim().length()>0 ) if(schemeCode != null && noapplyCustList != null && noapplyCustList.trim().length()>0 )
{ {
mcustCd = genericUtility.getColumnValue("cust_code",dom1); mcustCd = genericUtility.getColumnValue("cust_code",dom1);
System.out.println("Cust cod "+mcustCd);
mcustCd = mcustCd == null ? "" : mcustCd; mcustCd = mcustCd == null ? "" : mcustCd;
while (noapplyCustList.trim().length()>0) while (noapplyCustList.trim().length()>0)
{ {
...@@ -4660,18 +4684,26 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4660,18 +4684,26 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
} }
} }
if (schemeCode !=null) if (schemeCode !=null)
{
llSchcnt ++ ; llSchcnt ++ ;
else if( llSchcnt > 1 ) System.out.println("llSchcnt"+ llSchcnt);
schemeCode = lsPrevscheme; }
else if( llSchcnt == 1 )
{
schemeCode = lsPrevscheme;
}
} // end of while } // end of while
rs.close(); rs.close();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; rs = null;
if (llSchcnt > 1 ) if (llSchcnt > 1 )
schemeCode = lsPrevscheme ; {
System.out.println("schemeCode = lsPrevscheme "+schemeCode); schemeCode = null ;
System.out.println("schemeCode = lsPrevscheme@@@ "+lsPrevscheme); ///schemeCode = lsPrevscheme ;
}
System.out.println("schemeCode = Current "+ schemeCode);
System.out.println("schemeCode = lscustschemecode@@@ "+ lsPrevscheme);
//System.out.println("Scheme count.....["+llSchcnt + "] Scheme Code [" + schemeCode + "]"); //System.out.println("Scheme count.....["+llSchcnt + "] Scheme Code [" + schemeCode + "]");
sql="select (case when item_stru is null then 'S' else item_stru end)" sql="select (case when item_stru is null then 'S' else item_stru end)"
...@@ -4879,7 +4911,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -4879,7 +4911,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
listType = getPriceListType(priceList,conn); listType = getPriceListType(priceList,conn);
if(listType.equalsIgnoreCase("L")) if(listType.equalsIgnoreCase("L"))
{ {
String sql1 = " select count(1) from pricelist " sql1 = " select count(1) from pricelist "
+ " where price_list = ? " + " where price_list = ? "
+ " and item_code = ? " + " and item_code = ? "
+ " and unit = ? " + " and unit = ? "
...@@ -5038,7 +5070,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -5038,7 +5070,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
listType = distCommon.getPriceListType(priceListParent,conn); listType = distCommon.getPriceListType(priceListParent,conn);
if(listType.equalsIgnoreCase("L")) if(listType.equalsIgnoreCase("L"))
{ {
String sql1 = " select count(1) from pricelist" sql1 = " select count(1) from pricelist"
+ " where price_list = ? " + " where price_list = ? "
+ " and item_code = ? " + " and item_code = ? "
+ " and unit = ? " + " and unit = ? "
......
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