Commit 3ef38527 authored by asikarwar's avatar asikarwar

add reas_code in salesreturn_form header and same as details also, put...

add  reas_code in salesreturn_form header and same as details  also, put validation , set tran type on item default


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92425 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9c0f94d8
...@@ -189,6 +189,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -189,6 +189,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
double rateStd=0,totFreeCost=0,discount=0; double rateStd=0,totFreeCost=0,discount=0;
String sorder ="",sordLineNo=""; String sorder ="",sordLineNo="";
String pickLowerRate = ""; String pickLowerRate = "";
String reasonCode = "";//added by kunal on 24/12/12
double priceListRate = 0,sRateClg=0; double priceListRate = 0,sRateClg=0;
HashMap infoMap = null; HashMap infoMap = null;
String sretLocCode="",taxCal="",itemCodeOrd=""; String sretLocCode="",taxCal="",itemCodeOrd="";
...@@ -316,6 +317,22 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -316,6 +317,22 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
valueXmlString.append("<exch_rate protect =\"0\">").append("0").append("</exch_rate>"); valueXmlString.append("<exch_rate protect =\"0\">").append("0").append("</exch_rate>");
sql =" select rtrim(fld_value),descr from gencodes where fld_name='P_TYPE' and udf_str1 = 'D' ";
pstmt= conn.prepareStatement( sql );
rs = pstmt.executeQuery();
if( rs.next() )
{
tranType = rs.getString(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//added by kunal on 24/12/12
valueXmlString.append("<tran_type protect =\"0\">").append(tranType).append("</tran_type>");
} }
else if (currentColumn.trim().equals("tran_date") ) else if (currentColumn.trim().equals("tran_date") )
{ {
...@@ -611,7 +628,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -611,7 +628,8 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
//CHECKING IN RECEVABLES IF ANY DUES ARE O/S FOR CUST CODE OR NOT //CHECKING IN RECEVABLES IF ANY DUES ARE O/S FOR CUST CODE OR NOT
//IF YES THEN ISSUE CREDIT NOTE ELSE REPLACE THE GOODS //IF YES THEN ISSUE CREDIT NOTE ELSE REPLACE THE GOODS
sql =" select count(1) from receivables " //committed by akhilesh on 25/12/12 as discuss with kbaghar by manoj this logic is not use in taro-edi
/*sql =" select count(1) from receivables "
+" where tran_ser in ('S-INV','DRNRCP', 'CRNRCP') " +" where tran_ser in ('S-INV','DRNRCP', 'CRNRCP') "
+" and cust_code = ? " +" and cust_code = ? "
+" and item_ser = ? " +" and item_ser = ? "
...@@ -640,7 +658,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -640,7 +658,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
} }
valueXmlString.append("<ret_opt>").append("<![CDATA[" + getAbsString( retOpt ) + "]]>").append("</ret_opt>"); valueXmlString.append("<ret_opt>").append("<![CDATA[" + getAbsString( retOpt ) + "]]>").append("</ret_opt>");
setNodeValue( dom, "ret_opt", getAbsString( retOpt ) ); setNodeValue( dom, "ret_opt", getAbsString( retOpt ) );
*/
priceListClg = distCommon.getDisparams("999999","PRICE_LIST__CLG",conn); priceListClg = distCommon.getDisparams("999999","PRICE_LIST__CLG",conn);
if((priceListClg == null) || (priceListClg.trim().length() == 0)) if((priceListClg == null) || (priceListClg.trim().length() == 0))
{ {
...@@ -879,6 +897,10 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -879,6 +897,10 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
invoiceId = genericUtility.getColumnValue("invoice_id", dom1); invoiceId = genericUtility.getColumnValue("invoice_id", dom1);
fullRet = genericUtility.getColumnValue("full_ret",dom1); fullRet = genericUtility.getColumnValue("full_ret",dom1);
retOpt = genericUtility.getColumnValue("ret_opt",dom1); retOpt = genericUtility.getColumnValue("ret_opt",dom1);
reasonCode = genericUtility.getColumnValue("reas_code",dom1);
if (invoiceId == null || invoiceId.trim().length() == 0 || "null".equalsIgnoreCase( invoiceId.trim() ) ) if (invoiceId == null || invoiceId.trim().length() == 0 || "null".equalsIgnoreCase( invoiceId.trim() ) )
{ {
valueXmlString.append("<line_no__inv protect =\"1\">").append("<![CDATA["+""+"]]>").append("</line_no__inv>"); valueXmlString.append("<line_no__inv protect =\"1\">").append("<![CDATA["+""+"]]>").append("</line_no__inv>");
...@@ -988,6 +1010,10 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -988,6 +1010,10 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
valueXmlString.append("<mfg_date>").append("<![CDATA["+simpleDateFormat.format(new Date(2012, 00,01))+"]]>").append("</mfg_date>");//added by kunal on 7/12/12 as per Manoj instruction valueXmlString.append("<mfg_date>").append("<![CDATA["+simpleDateFormat.format(new Date(2012, 00,01))+"]]>").append("</mfg_date>");//added by kunal on 7/12/12 as per Manoj instruction
valueXmlString.append("<exp_date>").append("<![CDATA["+simpleDateFormat.format(addMonths(new Date(2012, 00,01),months))+"]]>").append("</exp_date>");//added by kunal on 7/12/12 as per Manoj instruction valueXmlString.append("<exp_date>").append("<![CDATA["+simpleDateFormat.format(addMonths(new Date(2012, 00,01),months))+"]]>").append("</exp_date>");//added by kunal on 7/12/12 as per Manoj instruction
System.out.println("reas_code"+reasonCode);
valueXmlString.append("<reas_code>").append("<![CDATA["+reasonCode+"]]>").append("</reas_code>"); //added by kunal on 24/12/12 as per Manoj instruction
} }
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
...@@ -1157,6 +1183,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -1157,6 +1183,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
rate = distCommon.pickRate(priceList,tranDate,itemCode," ","L",qtyStdUom, conn); rate = distCommon.pickRate(priceList,tranDate,itemCode," ","L",qtyStdUom, conn);
varValue = distCommon.getPriceListType(priceList,conn); varValue = distCommon.getPriceListType(priceList,conn);
varValue = varValue == null ?"" : varValue.trim(); varValue = varValue == null ?"" : varValue.trim();
if ("B".equals(varValue) && rate < 0) if ("B".equals(varValue) && rate < 0)
{ {
rate = 0; rate = 0;
...@@ -3819,7 +3846,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -3819,7 +3846,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
double lcQty=0; double lcQty=0;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String errorType = ""; String errorType = "";
String tranType = "";
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -4201,6 +4228,43 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu ...@@ -4201,6 +4228,43 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
if( childNodeName.equalsIgnoreCase( "reas_code" ) )//added by kunal on 24/12/12
{
mreasCode = getAbsString( genericUtility.getColumnValue( "reas_code", dom ) );
mcount = 0;
sqlStr = " select count(*) mcount "
+" from sreturn_reason "
+" where reason_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mreasCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mcount = rs.getInt( "mcount" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( mcount == 0 )
{
errCode = "VUREASON";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
if( childNodeName.equalsIgnoreCase( "tran_type" ) )//added by kunal on 24/12/12
{
tranType = genericUtility.getColumnValue( "tran_type", dom ) ;
if( tranType == null || tranType.trim().length() == 0 )
{
errCode = "TRTYPEBK";
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