Commit df6ec260 authored by smane's avatar smane

Add 'Customer Code Dlv ' itemchange and validation and set pricelist, for ...

Add 'Customer Code Dlv ' itemchange and validation and set pricelist,  for  Sales Return Form(D14DSUN021).


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95845 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1d315443
...@@ -150,9 +150,9 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -150,9 +150,9 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
double mdisc = 0,mminShlife=0,exchRate =0; double mdisc = 0,mminShlife=0,exchRate =0;
String tranDate = "",mvarValue="",locDescr="",lsDamagedtype="",tranType=""; String tranDate = "",mvarValue="",locDescr="",lsDamagedtype="",tranType="";
String invoiceId ="",tranMode="",siteCode="",custCodeBil="",currCode="",siteCodeDlv=""; String invoiceId ="",tranMode="",siteCode="",custCodeBil="",currCode="",siteCodeDlv="";
String analCode ="",itemSer ="",invDate ="",salesPers ="",custCode =""; String analCode ="",itemSer ="",invDate ="",salesPers ="",custCode ="",custCodeDlv="";
String saleOrder ="",salesPers1 ="",salesPers2 =""; String saleOrder ="",salesPers1 ="",salesPers2 ="";
String mSiteDescr="",custName="",tranCode="",tranName=""; String mSiteDescr="",custName="",tranCode="",tranName="",custNameDlv="";
java.sql.Timestamp mtranDate = null,ldtLrdate=null,mchkDate=null; java.sql.Timestamp mtranDate = null,ldtLrdate=null,mchkDate=null;
String mCurr="",mlocCode="",mloc="",mitemCode=""; String mCurr="",mlocCode="",mloc="",mitemCode="";
double mshlife=0; double mshlife=0;
...@@ -708,7 +708,13 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -708,7 +708,13 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
valueXmlString.append("<price_list__clg>").append("<![CDATA[" + getAbsString( priceListClg ) + "]]>").append("</price_list__clg>"); valueXmlString.append("<price_list__clg>").append("<![CDATA[" + getAbsString( priceListClg ) + "]]>").append("</price_list__clg>");
setNodeValue( dom, "price_list__clg", getAbsString( priceListClg ) ); setNodeValue( dom, "price_list__clg", getAbsString( priceListClg ) );
} }
reStr = itemChanged(dom, dom1, dom2, objContext, "ret_opt", editFlag, xtraParams); //reStr = itemChanged(dom, dom1, dom2, objContext, "ret_opt", editFlag, xtraParams);//comment added by sagar on 05/08/14
//Added by sagar on 05/08/14 start
valueXmlString.append("<cust_code__dlv>").append("<![CDATA[" + getAbsString( custCode ) + "]]>").append("</cust_code__dlv>");
setNodeValue( dom, "cust_code__dlv", getAbsString( custCode ) );
System.out.println(">>>>>>>>>>>>>>>Calling cust_code__dlv IC in cust code>>>>>>>>>>>>>>>>>");
reStr = itemChanged(dom, dom1, dom2, objContext, "cust_code__dlv", editFlag, xtraParams);
//Added by sagar on 05/08/14 end
pos = reStr.indexOf("<Detail1>"); pos = reStr.indexOf("<Detail1>");
reStr = reStr.substring(pos + 9); reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail1>"); pos = reStr.indexOf("</Detail1>");
...@@ -825,6 +831,61 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -825,6 +831,61 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
} }
valueXmlString.append("<price_list>").append("<![CDATA[" + getAbsString(priceList) + "]]>").append("</price_list>"); valueXmlString.append("<price_list>").append("<![CDATA[" + getAbsString(priceList) + "]]>").append("</price_list>");
} }
else if (currentColumn.trim().equals("cust_code__dlv")) //condition added by sagar on 05/08/14
{
custCodeDlv = genericUtility.getColumnValue("cust_code__dlv",dom);
siteCode = genericUtility.getColumnValue("site_code",dom);
System.out.println(">>>>>>>In Itemchange of cust_code__dlv:"+custCodeDlv);
sql = " select cust_name from customer where cust_code = ?";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, custCodeDlv);
rs = pstmt.executeQuery();
if( rs.next() )
{
custNameDlv = rs.getString(1);
System.out.println(">>>>>>>Found custNameDlv:"+custNameDlv);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<cust_name_dlv>").append("<![CDATA[" + getAbsString( custNameDlv ) + "]]>").append("</cust_name_dlv>");
setNodeValue( dom, "cust_name_dlv", getAbsString( custNameDlv ) );
priceList = "";
sql = " select price_list from site_customer where cust_code = ? and site_code = ?";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, custCodeDlv);
pstmt.setString( 2, siteCode);
rs = pstmt.executeQuery();
if( rs.next() )
{
priceList = rs.getString(1);
System.out.println(">>>>>>>Found Price list in site_customer:"+priceList);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
priceList = priceList == null ?"" : priceList.trim();
if (priceList == null || priceList.trim().length() == 0)
{
sql = " select price_list from customer where cust_code = ?";
pstmt= conn.prepareStatement( sql );
pstmt.setString( 1, custCodeDlv);
rs = pstmt.executeQuery();
if( rs.next() )
{
priceList = rs.getString(1);
System.out.println(">>>>>>>Found Price list in customer:"+priceList);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
valueXmlString.append("<price_list>").append("<![CDATA[" + getAbsString(priceList) + "]]>").append("</price_list>");
}
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
break; break;
...@@ -3983,7 +4044,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3983,7 +4044,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
String sqlStr="",mVal="",lsItemser="",blackListedYn="",lsStopBusiness="",itemCode1=""; String sqlStr="",mVal="",lsItemser="",blackListedYn="",lsStopBusiness="",itemCode1="";
java.sql.Timestamp ldInvoiceDate = null; java.sql.Timestamp ldInvoiceDate = null;
int cnt=0; int cnt=0;
String exchRateStr="",currCode="",mVal1="",custCode=""; String exchRateStr="",currCode="",mVal1="",custCode="",custCodeDlv="";
double exchRate =0; double exchRate =0;
int mlineNo=0; int mlineNo=0;
java.sql.Timestamp mtrandate = null; java.sql.Timestamp mtrandate = null;
...@@ -4415,7 +4476,39 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -4415,7 +4476,39 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
if( childNodeName.equalsIgnoreCase("cust_code__dlv") )//added by Sagar on 05/08/14
{
custCodeDlv = getAbsString(genericUtility.getColumnValue( "cust_code__dlv", dom ));
System.out.println(">>>>>>cust_code__dlv validation:"+custCodeDlv);
cnt=0;
if(custCodeDlv==null || custCodeDlv.trim().length()==0)
{
errCode = "VTCUSTDLBK";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
sqlStr = "select count(*) cnt from customer where cust_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, custCodeDlv );
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0 )
{
errCode = "VTCUSTDLVD";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}//end for }//end for
break; break;
case 2 : case 2 :
......
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