Commit 56a83760 authored by ngadkari's avatar ngadkari

change of setting status and location on basis of reason code

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@208147 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 29321518
......@@ -1345,7 +1345,13 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
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
setNodeValue( dom, "reas_code", reasonCode );
reStr = itemChanged(dom, dom1, dom2, objContext, "reas_code", editFlag, xtraParams);
pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail2>");
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
}
else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{
......@@ -4455,6 +4461,7 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
if( mcount1 > 0 )
{
valueXmlString.append("<status>").append("<![CDATA[" + "E" + "]]>").append("</status>");
setNodeValue( dom, "status", "E" );
valueXmlString.append("<stk_opt>").append("<![CDATA[" + "N" + "]]>").append("</stk_opt>");
mvarValue = distCommon.getDisparams( "999999", "EXPIRED_LOC", conn );
......@@ -4590,6 +4597,13 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
System.out.println( "pos1 :: " + pos );
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
// ADDED BY NANDKUMAR GADKARI ON 21/09/19
reStr = itemChanged(dom, dom1, dom2, objContext, "status", editFlag, xtraParams);
pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail2>");
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
} // end of lot_sl
......@@ -5252,6 +5266,58 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
System.out.println( "sRate :7: " + sRate );
valueXmlString.append("<rate protect =\"0\">").append("<![CDATA["+ ( sRate == null || sRate.trim().length() == 0 ? "0" : sRate ) +"]]>").append("</rate>");
}
////added by nandkumar gadkari on 23/09/19--------Start-----------
sqlStr = " Select reason_descr mreason_descr "
+ " ,reason_code, loc_code "
+" from sreturn_reason "
+" where status = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mstatus );
rs = pstmt.executeQuery();
if( rs.next() )
{
reasonCode = rs.getString( "reason_code" );
locCode = rs.getString( "loc_code" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( locCode!=null && locCode.trim().length() > 0 && reasonCode!=null && reasonCode.trim().length() > 0 )
{
valueXmlString.append("<reas_code>").append("<![CDATA[" + reasonCode + "]]>").append("</reas_code>");
valueXmlString.append("<loc_code>").append("<![CDATA["+ locCode +"]]>").append("</loc_code>");
sqlStr = "select descr mloc "
+" from location "
+" where loc_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, locCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mloc = rs.getString( "mloc" );
valueXmlString.append("<location_descr>").append("<![CDATA[" + mloc + "]]>").append("</location_descr>");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
////added by nandkumar gadkari on 123/09/19--------end
}//end of status
//Added By Mahesh Patidar on 07/05/12 add item change on exp_date
else if (currentColumn.trim().equals( "exp_date" ) )
......@@ -6177,7 +6243,60 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
}
//
////added by nandkumar gadkari on 23/09/19--------start
else if (currentColumn.trim().equals( "reas_code" ) )
{
reasonCode = genericUtility.getColumnValue( "reas_code", dom );
sqlStr = " Select reason_descr mreason_descr "
+ " ,status, loc_code "
+" from sreturn_reason "
+" where reason_code = ? "; //:mreas_code ;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, reasonCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mstatus = rs.getString( "status" );
locCode = rs.getString( "loc_code" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(mstatus !=null && mstatus.trim().length() > 0 && locCode!=null && locCode.trim().length() > 0)
{
valueXmlString.append("<status>").append("<![CDATA["+ mstatus +"]]>").append("</status>");
valueXmlString.append("<loc_code>").append("<![CDATA["+ locCode +"]]>").append("</loc_code>");
sqlStr = "select descr mloc "
+" from location "
+" where loc_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, locCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mloc = rs.getString( "mloc" );
valueXmlString.append("<location_descr>").append("<![CDATA[" + mloc + "]]>").append("</location_descr>");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
//added by nandkumar gadkari on 123/09/19--------end
valueXmlString.append("</Detail2>");
break;
case 3:
......
......@@ -5817,7 +5817,8 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
}
//mvarValue = " ";*/
System.out.println("Status is"+ mstatus);
if(mstatus != null && mstatus.trim().length() >0)
//STATUS_REASON commented by nandkumar gadkari on 23/09/19
/*if(mstatus != null && mstatus.trim().length() >0)
{
mvarName1 = mstatus.trim() + "STATUS_REASON";
System.out.println("mvarName1 is"+ mvarName1);
......@@ -5848,16 +5849,62 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
pstmt = null;
System.out.println("Reson description is");
valueXmlString.append("<reason_descr>").append("<![CDATA["+ mreasonDescr +"]]>").append("</reason_descr>");
}*/
sqlStr = " Select reason_descr mreason_descr "
+ " ,reason_code, loc_code "////added by nandkumar gadkari on 11/09/19
+" from sreturn_reason "
+" where status = ? "; //:mreas_code ;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mstatus );
rs = pstmt.executeQuery();
mreasonDescr = "";
if( rs.next() )
{
mreasonDescr = rs.getString( "mreason_descr" );
mvarValue1 = rs.getString( "reason_code" );
locCode = rs.getString( "loc_code" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( locCode!=null && locCode.trim().length() > 0 && mvarValue1!=null && mvarValue1.trim().length() > 0 )
{
valueXmlString.append("<reas_code>").append("<![CDATA[" + mvarValue1 + "]]>").append("</reas_code>");
valueXmlString.append("<reason_descr>").append("<![CDATA["+ mreasonDescr +"]]>").append("</reason_descr>");
valueXmlString.append("<loc_code>").append("<![CDATA["+ locCode +"]]>").append("</loc_code>");
sqlStr = "select descr mloc "
+" from location "
+" where loc_code = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, locCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
mloc = rs.getString( "mloc" );
valueXmlString.append("<location_descr>").append("<![CDATA[" + mloc + "]]>").append("</location_descr>");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
////added by nandkumar gadkari on 11/09/19--------
reStr = itemChanged(dom, dom1, dom2, objContext, "reas_code", editFlag, xtraParams);
pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9);
pos = reStr.indexOf("</Detail2>");
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);
////added by nandkumar gadkari on 123/09/19--------end
}//end of status
else if (currentColumn.trim().equals( "stk_opt" ) )
......
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