Commit 816c264c authored by agaikwad's avatar agaikwad

Request_id-D15ISUN003

Added receipt and return condition.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100000 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d0dc9a06
...@@ -465,7 +465,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -465,7 +465,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
String taskcodeParent=""; String taskcodeParent="";
double apprvlead= 0 ; double apprvlead= 0 ;
String remark=""; String remark="";
double totAmtpoamdtemp =0,approxCost = 0,totAmtDetpordertot = 0,totAmtPoamd =0; double totAmtpoamdtemp =0,approxCost = 0,totAmtDetpordertot = 0,totAmtPoamd =0,totAmtDetpordertotNtc = 0.0 ,totAmtDetpordertotPorcpConf=0.0, totAmtDetpordertotPorcpSer=0.0;;;
String pordType =""; String pordType ="";
String varValue =""; String varValue ="";
boolean ValueType = false; boolean ValueType = false;
...@@ -644,7 +644,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -644,7 +644,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
pstmt3.close(); pstmt3.close();
pstmt3 = null; pstmt3 = null;
sql1 = "select sum( a.tot_amt ) from porddet a, porder b" /*sql1 = "select sum( a.tot_amt ) from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" + " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'"; + " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'";
...@@ -662,7 +662,72 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -662,7 +662,72 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot); System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot);*/
//ABHIJIT
/* Changed By Priyanka Das */
System.out.println("@@@@@@@ In @@@@@@@@@");
sql="select sum(a.net_amt * b.exch_rate) from " +
"porcpdet a, porcp b ,porddet c " +
" where ( a.purc_order = c.purc_order ) " +
" and (a.tran_id = b.tran_id ) and a.line_no__ord = c.line_no " +
" and b.confirmed = 'Y' and c.proj_code = ? " +
" and b.status ! = 'X'" +
" and c.status = 'C' and b.tran_ser='P-RCP'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
//pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotPorcpConf= rs.getDouble(1);
System.out.println(" POrcp VALUE>>>>>>>> "+ totAmtDetpordertotPorcpConf);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select sum( a.tot_amt * b.exch_rate) from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y' and a.proj_code = ? and b.status! = 'X' and a.status! ='C'" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
// pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotNtc= rs.getDouble(1);
System.out.println("totAmtDet for Porder without in loop and status pordet is not C>>>>>>>> "+ totAmtDetpordertotNtc);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql= "select sum(a.net_amt * b.exch_rate) from porcpdet a, porcp b ,porddet c " +
" where ( a.purc_order = c.purc_order )" +
"and (a.tran_id = b.tran_id )" +
"and b.confirmed = 'Y' and a.line_no__ord = c.line_no and c.proj_code = ?" +
" and b.status ! = 'X'and b.tran_ser= 'P-RET'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
// pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotPorcpSer = rs.getDouble(1);
System.out.println(" return value is>>>>>>>> "+ totAmtDetpordertotPorcpSer);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/* Ended by Abhijit */
totAmtPoamd = totAmtnotcurr + totAmtDetpordertot + totAmtpoamdtemp; totAmtPoamd = totAmtnotcurr + totAmtDetpordertot + totAmtpoamdtemp;
System.out.println("totamtpoamd>>>>.."+totAmtPoamd); System.out.println("totamtpoamd>>>>.."+totAmtPoamd);
System.out.println("totamtpordertot"+totAmtDetpordertot); System.out.println("totamtpordertot"+totAmtDetpordertot);
...@@ -686,9 +751,11 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -686,9 +751,11 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
String value = " ; Amount Exceeded Project Code : " + projCode String value = " ; Amount Exceeded Project Code : " + projCode
+" ; Project Aprroved Amount : "+ BigDecimal.valueOf(approxCost).toPlainString() +" ; Project Aprroved Amount : "+ BigDecimal.valueOf(approxCost).toPlainString()
+" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot + totAmtnotcurr).toPlainString() // +" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot + totAmtnotcurr).toPlainString()
+" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot).toPlainString()
+" ; Current Purchase Order Amendment Amount : "+ BigDecimal.valueOf(totAmtpoamdtemp).toPlainString() +" ; Current Purchase Order Amendment Amount : "+ BigDecimal.valueOf(totAmtpoamdtemp).toPlainString()
+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtPoamd - approxCost).toPlainString(); // +" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtPoamd - approxCost).toPlainString();
+" ; Exceeded Amount : "+ BigDecimal.valueOf(approxCost - totAmtDetpordertot).toPlainString();
System.out.println("Value ::: "+ value); System.out.println("Value ::: "+ value);
......
...@@ -133,7 +133,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder ...@@ -133,7 +133,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
Timestamp pordDate = null; Timestamp pordDate = null;
double indBalance = 0; double indBalance = 0;
double totAmtIndent = 0; double totAmtIndent = 0;
double totAmtDetpordertemp = 0, totAmtDetpordertot = 0.0; double totAmtDetpordertemp = 0, totAmtDetpordertot = 0.0,totAmtDetpordertotNtc = 0.0 ,totAmtDetpordertotPorcpConf=0.0, totAmtDetpordertotPorcpSer=0.0;;
double totAmtDetPoamdDetbrow = 0, totAmtDetIndent = 0, totAmtDetporder = 0, approxCost = 0, totAmtProj = 0; double totAmtDetPoamdDetbrow = 0, totAmtDetIndent = 0, totAmtDetporder = 0, approxCost = 0, totAmtProj = 0;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String linearr []; String linearr [];
...@@ -1373,7 +1373,80 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder ...@@ -1373,7 +1373,80 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
pstmt = null; pstmt = null;
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot); System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot);
*/ */
sql = "select sum( a.tot_amt ) from porddet a, porder b" System.out.println("@@@@@@@ In @@@@@@@@@");
sql= "select sum(a.net_amt * b.exch_rate) from " +
"porcpdet a, porcp b ,porddet c " +
" where ( a.purc_order = c.purc_order ) " +
" and (a.tran_id = b.tran_id ) and a.line_no__ord = c.line_no " +
" and b.confirmed = 'Y' and c.proj_code = ? " +
" and b.status ! = 'X'" +
" and c.status = 'C' and b.tran_ser='P-RCP'";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
//pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotPorcpConf= rs.getDouble(1);
System.out.println(" POrcp VALUE>>>>>>>> "+ totAmtDetpordertotPorcpConf);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select sum( a.tot_amt * b.exch_rate) from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y' and a.proj_code = ? and b.status! = 'X' and a.status! ='C'" ;
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
// pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotNtc= rs.getDouble(1);
System.out.println("totAmtDet for Porder without in loop and status pordet is not C>>>>>>>> "+ totAmtDetpordertotNtc);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("totAmtDet for Porder outside loop and status pordet is C>>>>>>>> "+ totAmtDetpordertotNtc);
sql = "select sum(a.net_amt * b.exch_rate) from porcpdet a, porcp b ,porddet c " +
" where ( a.purc_order = c.purc_order )" +
"and (a.tran_id = b.tran_id )" +
"and b.confirmed = 'Y' and a.line_no__ord = c.line_no and c.proj_code = ?" +
" and b.status ! = 'X'and b.tran_ser= 'P-RET'";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
// pstmt.setString(2, pordNo);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertotPorcpSer = rs.getDouble(1);
System.out.println(" return value is>>>>>>>> "+ totAmtDetpordertotPorcpSer);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("totAmtDet for Porder without in loop and status pordet is C and POrcp confirmed and return >>>>>>>> "+ totAmtDetpordertotPorcpSer);
System.out.println("totAmtDet for Porder return "+ totAmtDetpordertotPorcpSer);
System.out.println("totAmtDet for Porder and status pordet is C and POrcp confirmed and return" + totAmtDetpordertotPorcpConf );
System.out.println("totAmtDet for Porder and status pordet is not C" + totAmtDetpordertotNtc);
System.out.println("totAmtDet for Porder" + totAmtDetpordertot);
totAmtDetpordertot = totAmtDetpordertotNtc + totAmtDetpordertotPorcpConf - totAmtDetpordertotPorcpSer;
System.out.println( totAmtDetpordertotNtc +"-" +totAmtDetpordertotPorcpConf+"-"+ totAmtDetpordertotPorcpSer);
System.out.println("Consumed Amount " + totAmtDetpordertot);
/* sql = "select sum( a.tot_amt ) from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" + " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'"; + " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'";
...@@ -1392,7 +1465,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder ...@@ -1392,7 +1465,10 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot); System.out.println("totAmtDet for Porder outside loop>>>>>>>> "+ totAmtDetpordertot);*/
/* /*
* sql1 = * sql1 =
* "select sum(a.quantity * a.rate) from porddet a, porder b" * "select sum(a.quantity * a.rate) from porddet a, porder b"
...@@ -3023,7 +3099,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder ...@@ -3023,7 +3099,8 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
value = " ; Project Aprroved Amount : "+ BigDecimal.valueOf(approxCost).toPlainString() value = " ; Project Aprroved Amount : "+ BigDecimal.valueOf(approxCost).toPlainString()
+" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot).toPlainString() +" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot).toPlainString()
+" ; Current Purchase Amendment Amount : "+ BigDecimal.valueOf(totAmtDetPoamdDetbrow + totAmtDetporder ).toPlainString() +" ; Current Purchase Amendment Amount : "+ BigDecimal.valueOf(totAmtDetPoamdDetbrow + totAmtDetporder ).toPlainString()
+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj - approxCost).toPlainString(); //+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj - approxCost).toPlainString();
+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtDetpordertot - approxCost).toPlainString();
System.out.println("Value ::: "+ value); System.out.println("Value ::: "+ value);
descrStart = descrStart.concat(value).concat(descrEnd); descrStart = descrStart.concat(value).concat(descrEnd);
......
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