Commit b60c4a09 authored by pdas's avatar pdas

Request ID-D15DSUN003

Changes made for purchase order header close when purchase milestone task status is 'C'.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98206 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 961a27cf
...@@ -932,11 +932,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, ...@@ -932,11 +932,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal,
String siteCode = ""; String siteCode = "";
String varValue = ""; String varValue = "";
String varName = ""; String varName = "";
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null; PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null,pstmt3 =null;
PreparedStatement pstmtUpd = null; PreparedStatement pstmtUpd = null;
String retString = ""; String retString = "";
PreparedStatement pstmtItemLotPack = null; PreparedStatement pstmtItemLotPack = null;
ResultSet rs = null, rs1 = null,rs2 = null; ResultSet rs = null, rs1 = null,rs2 = null,rs3 = null;
ResultSet rsItemLotPack = null; ResultSet rsItemLotPack = null;
String sql = ""; String sql = "";
java.sql.Timestamp tranDate = null; java.sql.Timestamp tranDate = null;
...@@ -959,6 +959,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, ...@@ -959,6 +959,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal,
String ordStatus = "", siteCodeDet = "", xmlValues = "", keyString = "", remarks = ""; String ordStatus = "", siteCodeDet = "", xmlValues = "", keyString = "", remarks = "";
String cctrCodeInv = "", acctCodeInv = ""; String cctrCodeInv = "", acctCodeInv = "";
int lineNoInv = 0; int lineNoInv = 0;
int count1 =0,count2 = 0,count3 =0;
java.sql.Timestamp chgDate = null; java.sql.Timestamp chgDate = null;
FinCommon finCommon = null; FinCommon finCommon = null;
HashMap stkUpdMap = null; HashMap stkUpdMap = null;
...@@ -1940,12 +1941,83 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, ...@@ -1940,12 +1941,83 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal,
if (rs1.next()) { if (rs1.next()) {
count = rs1.getInt(1); count = rs1.getInt(1);
} }
System.out.println("Count for relagainst in pordet>>>>>>>>>>> "+ count);
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
if (count == 0) { if (count == 0) {
boolean pocomp = true;
String sql1 = "select count(*) from PORD_PAY_TERM Where purc_order= ?and ( rel_agnst ='05' or rel_agnst ='06')";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, purcOrder);
System.out.print("in count loop");
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
count1 = rs1.getInt(1);
}
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;
System.out.println("Count for relagainst in pord_pay_term>>>>>>>>>>> "+ count1);
if(count1 > 0)
{
String sql2 ="Select Count(*) From Pord_Pay_Term,Pur_Milstn " +
"where Pord_Pay_Term.Line_No = pur_milstn.Line_No__Ord " +
"And Pord_Pay_Term.Purc_Order = Pur_Milstn.Purc_Order "+
"and Pord_Pay_Term.Purc_Order = ?";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1, purcOrder);
System.out.print("in count for pordpayterm and purcmilestone exist>>>>>>>>>>>>>>");
rs2 = pstmt2.executeQuery();
while (rs2.next()) {
count2 = rs2.getInt(1);
}
System.out.print("in count for pordpayterm and purcmilestone line exist>>>>>>>>>>>>>>>>>>>>> " + count2);
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if(count2 == 0)
{
pocomp = false;
}
else if(count2 > 0)
{
String sql3 ="Select Count(*) From Pord_Pay_Term,Pur_Milstn " +
"where Pord_Pay_Term.Line_No = pur_milstn.Line_No__Ord " +
"And Pord_Pay_Term.Purc_Order = Pur_Milstn.Purc_Order "+
"and Pur_Milstn.Task_Status ! = 'C'" +
"and Pord_Pay_Term.Purc_Order = ?" ;
pstmt3 = conn.prepareStatement(sql3);
pstmt3.setString(1, purcOrder);
System.out.print("in count for pordpayterm and purcmilestone line>>>>>>>>>>>>>>");
rs3 = pstmt3.executeQuery();
while (rs3.next())
{
count3 = rs3.getInt(1);
}
System.out.print("in count for pordpayterm and purcmilestone line>>>>>>>>>>>>>>>>>>>>> " + count3);
pstmt3.close();
pstmt3 = null;
rs3.close();
rs3 = null;
}
if(count3 > 0)
{
pocomp = false;
}
}
if(pocomp == true)
{
sql = "update porder Set status = 'C' Where purc_order = ?"; sql = "update porder Set status = 'C' Where purc_order = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, purcOrder); pstmtUpd.setString(1, purcOrder);
...@@ -1958,6 +2030,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, ...@@ -1958,6 +2030,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal,
} }
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
}
} }
}// if(purcOrder != null && purcOrder.length() > 0) }// if(purcOrder != null && purcOrder.length() > 0)
} }
......
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