Commit 80bb4bf3 authored by ppatro's avatar ppatro

bug fixing : PO status is not updated as 'C' even after receipt has been...

bug fixing : PO status is not updated as 'C' even after receipt has been generated with full quantity


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97413 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f370c13f
...@@ -1825,36 +1825,43 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -1825,36 +1825,43 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }
//Changed By Pragyan on 25/02/15 to fix bug as suggested by Manohran sir
// 05/05/01 manoharan if all the PO Details are closed // 05/05/01 manoharan if all the PO Details are closed
// then close the PO Header also // then close the PO Header also
if(errString != null && errString.indexOf("Error") == -1 && purcOrder != null ) //if(errString != null && errString.indexOf("Error") == -1 && purcOrder != null )
if(errString == null || errString.trim().length() == 0 || errString.toUpperCase().indexOf("ERROR") == -1)
{ {
sql = "select count(1) from porddet where purc_order = ? And (case when status is null then ' ' else status end) <> 'C' " ; System.out.println("Bug fix check as on date 25FEB15 purcOrder ["+purcOrder+"");
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, purcOrder); if(purcOrder != null && purcOrder.length() > 0)
rs1 = pstmt1.executeQuery();
if ( rs1.next() )
{
count = rs1.getInt(1);
}
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;
if (count == 0 )
{ {
sql = "update porder Set status = 'C' Where purc_order = ?"; sql = "select count(1) from porddet where purc_order = ? And (case when status is null then ' ' else status end) <> 'C' " ;
pstmtUpd = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmtUpd.setString(1, purcOrder); pstmt1.setString(1, purcOrder);
updCnt = pstmtUpd.executeUpdate(); rs1 = pstmt1.executeQuery();
if ( updCnt != 1 ) if ( rs1.next() )
{ {
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014 count = rs1.getInt(1);
} }
pstmtUpd.close(); pstmt1.close();
pstmtUpd = null; pstmt1 = null;
} rs1.close();
rs1 = null;
if (count == 0 )
{
sql = "update porder Set status = 'C' Where purc_order = ?";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, purcOrder);
updCnt = pstmtUpd.executeUpdate();
if ( updCnt != 1 )
{
errString = itmDBAccessLocal.getErrorString("","DS000NR","");//Added by chandrashekar on 17-sep-2014
}
pstmtUpd.close();
pstmtUpd = null;
}
}//if(purcOrder != null && purcOrder.length() > 0)
} }
//Added by Jasmina-28/11/08- EO89SUN002, //Added by Jasmina-28/11/08- EO89SUN002,
......
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