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
Node parentNode = null;
Node childNode = null;
Connection conn = null;
PreparedStatement pstmt = null , pstmt1 = null;
ResultSet rs = null ,rs1 = null ;
PreparedStatement pstmt = null , pstmt1 = null,pstmt2 = null;
ResultSet rs = null ,rs1 = null,rs2=null ;
int ctr=0;
String childNodeName = null;
String columnValue = null;
String Col_name = "";
int currentFormNo = 0 ,cnt = 0;
String cadreCode="" ;
String sql = "",descr="",locCode = "",empCode="",locDescr="";
String sql = "",descr="",locCode = "",empCode="",locDescr="",sql1 = "";
String siteCode = null;
String empLname = null,empMname = null,empFname = null;
String itemDescr = null,itemCode = null;
......@@ -2381,6 +2381,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String siteString = null;
String disparmLoc = null;
String schemeCode = null;
String lscustschemecode = null;
String custCd = null;
String stateCd = null;
String lsItemCode = null;
......@@ -2453,6 +2454,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String disparmVal = null;
String salesPers = "";
String Descr= null;
int cnt1= 0;
try
{
......@@ -4538,7 +4540,24 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
lsCurscheme = rs.getString("scheme_code") == null ? "" : rs.getString("scheme_code");
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, "
+" (case when noapply_cust_list is null then '' else noapply_cust_list end) noapply_cust_list, "
+" order_type from scheme_applicability where scheme_code = ? " ;
......@@ -4571,8 +4590,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (pos > -1)
{
lsToken = distCommon.getToken(applicableordtypes,",");
System.out
.println("Token is:"+lsToken);
System.out.println("Token is:"+lsToken);
if (orderType.trim().equals(lsToken.trim()))
{
System.out.println("order type matched.....["+orderType + "]");
......@@ -4599,10 +4617,13 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
System.out.println("SCheme code is" +lsPrevscheme);
schemeCode = lsCurscheme ;
System.out.println("Scheme COde"+schemeCode);
System.out.println("Apply Cust Code is" +applyCustList);
if (applyCustList.trim().length() > 0)
{
schemeCode = null;
mcustCd = genericUtility.getColumnValue("cust_code",dom1);
System.out
.println("Cust code is :" + mcustCd);
mcustCd = mcustCd == null ?"" : mcustCd;
while(applyCustList.trim().length() > 0)
{
......@@ -4613,6 +4634,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (applyCust.trim().equals( mcustCd.trim()))
{
schemeCode = lsCurscheme;
//code add
break;
}
applyCustList = applyCustList.substring(pos+1);
......@@ -4624,6 +4646,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if (mcustCd.trim().equals( applyCustList.trim()))
{
schemeCode = lsCurscheme;
System.out.println("Else SchemeCOde" + schemeCode);
}
break;
}
......@@ -4632,6 +4655,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
if(schemeCode != null && noapplyCustList != null && noapplyCustList.trim().length()>0 )
{
mcustCd = genericUtility.getColumnValue("cust_code",dom1);
System.out.println("Cust cod "+mcustCd);
mcustCd = mcustCd == null ? "" : mcustCd;
while (noapplyCustList.trim().length()>0)
{
......@@ -4660,18 +4684,26 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
}
if (schemeCode !=null)
{
llSchcnt ++ ;
else if( llSchcnt > 1 )
System.out.println("llSchcnt"+ llSchcnt);
}
else if( llSchcnt == 1 )
{
schemeCode = lsPrevscheme;
}
} // end of while
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if (llSchcnt > 1 )
schemeCode = lsPrevscheme ;
System.out.println("schemeCode = lsPrevscheme "+schemeCode);
System.out.println("schemeCode = lsPrevscheme@@@ "+lsPrevscheme);
{
schemeCode = null ;
///schemeCode = lsPrevscheme ;
}
System.out.println("schemeCode = Current "+ schemeCode);
System.out.println("schemeCode = lscustschemecode@@@ "+ lsPrevscheme);
//System.out.println("Scheme count.....["+llSchcnt + "] Scheme Code [" + schemeCode + "]");
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
listType = getPriceListType(priceList,conn);
if(listType.equalsIgnoreCase("L"))
{
String sql1 = " select count(1) from pricelist "
sql1 = " select count(1) from pricelist "
+ " where price_list = ? "
+ " and item_code = ? "
+ " and unit = ? "
......@@ -5038,7 +5070,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
listType = distCommon.getPriceListType(priceListParent,conn);
if(listType.equalsIgnoreCase("L"))
{
String sql1 = " select count(1) from pricelist"
sql1 = " select count(1) from pricelist"
+ " where price_list = ? "
+ " and item_code = ? "
+ " 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