Commit 1c712185 authored by pdas's avatar pdas

REQUEST ID -D15ESUN002

CHANGES MADE FOR AMOUNT CALCULATION OF PROJECT AS PER MAIL BY GANESH GHADGE.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99266 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 639ef585
......@@ -142,12 +142,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
double quantitypoamddet = 0, ratepoamddet = 0, totAmtDetPoamdDetbrowtemp = 0;
String line1 ="";
String startStr ="",endStr = "",descrStr = "",descrStart ="", descrEnd ="" ,exchRateStr ="",value ="";
double exchRatePoAmd =0;
double discountpoamddet =0,taxpoamddet =0;
boolean ValueType = false;
int cntindamdhdr = 0,itrArr =0,maxLine =0;
int pos;
String totAmtDetpordertempstr ="",quantitypoamd ="",ratepoamd ="",acctCodeCrporder ="";
String acctCodeCrbrow ="";
String acctCodeCrbrow ="", taxpoamd ="";
String discountpoamd ="";
DistCommon distCommon = new DistCommon();
try {
System.out.println("@@@@@@@@ wfvaldata called");
......@@ -1374,7 +1376,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
* +totAmtDetIndent);
*/
sql = "select sum((a.quantity * a.rate) * b.exch_rate ) from porddet a, porder b"
sql = "select sum( a.tot_amt ) from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'";
......@@ -1446,14 +1448,26 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
if (projcodeBrow.equals(projCode))
{
System.out.println("in condition!!!");
quantitypoamd = checkNull(genericUtility.getColumnValueFromNode("quantity",detail2List.item(a)));
quantitypoamd = checkNull(genericUtility.getColumnValueFromNode("quantity__stduom",detail2List.item(a)));
quantitypoamddet = quantitypoamd == null ? 0: Double.parseDouble(quantitypoamd);
System.out.println("<quantitypoamd >@@@@@@ "+ quantitypoamd);
ratepoamd = checkNull(genericUtility.getColumnValueFromNode("rate",detail2List.item(a)));
System.out.println("<quantitySTDUOMpoamd >@@@@@@ "+ quantitypoamd);
ratepoamd = checkNull(genericUtility.getColumnValueFromNode("rate__stduom",detail2List.item(a)));
ratepoamd = ratepoamd != null&& ratepoamd.trim().length() > 0 ? ratepoamd.trim() : "0";
System.out.println("<ratepoamd > @@@@@@@@@@@@@@@@@"+ ratepoamd);
System.out.println("<rateSTDUOMpoamd > @@@@@@@@@@@@@@@@@"+ ratepoamd);
ratepoamddet = ratepoamd == null ? 0: Double.parseDouble(ratepoamd);
totAmtDetPoamdDetbrowtemp = quantitypoamddet* ratepoamddet;
discountpoamd = checkNull(genericUtility.getColumnValueFromNode("discount", detail2List.item(a)));
discountpoamd = discountpoamd != null && discountpoamd.trim().length() > 0 ? discountpoamd.trim() : "0";
discountpoamddet = discountpoamd == null ? 0: Double.parseDouble(discountpoamd);
System.out.println("<discountpoamd > @@@@@@@@@@@@@@@@@"+ discountpoamd);
System.out.println("<discountpoamdDET > @@@@@@@@@@@@@@@@@"+ discountpoamddet);
taxpoamd = checkNull(genericUtility.getColumnValueFromNode("tax_amt", detail2List.item(a)));
taxpoamd = taxpoamd != null&& taxpoamd.trim().length() > 0 ? taxpoamd.trim() : "0";
taxpoamddet = taxpoamd == null ? 0: Double.parseDouble(taxpoamd);
System.out.println("<taxpoamd > @@@@@@@@@@@@@@@@@"+ taxpoamd);
System.out.println("<taxpoamddet > @@@@@@@@@@@@@@@@@"+ taxpoamddet);
//totAmtDetPoamdDetbrowtemp = quantitypoamddet* ratepoamddet;
totAmtDetPoamdDetbrowtemp = (quantitypoamddet* ratepoamddet)- ((quantitypoamddet* ratepoamddet * discountpoamddet) / 100)+ taxpoamddet;
System.out.println("<totAmtDetPoamdDetbrowtemp > @@@@@@@@@@@@@@@@@"+ totAmtDetPoamdDetbrowtemp);
pordNo = checkNull(genericUtility.getColumnValueFromNode("purc_order",detail2List.item(a)));
linenoOrdBrow = checkNull(genericUtility.getColumnValueFromNode("line_no__ord",detail2List.item(a)));
System.out.println("linenoOrdBrow>>>" +linenoOrdBrow );
......@@ -1480,7 +1494,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
}
System.out.println("line1 before sql:- ["+line1+"]");
line1=line1.substring(0, line1.length()-1);
sql1 = "select sum((a.quantity * a.rate) * b.exch_rate) " +
sql1 = "select sum( a.tot_amt ) " +
"from porddet a, porder b"
+ " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'"
+ " and a.proj_code = ? and a.purc_order = ? and line_no NOT IN ( "+ line1 +")";
......@@ -1503,10 +1517,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
System.out.println("totAmtDetPoamdDetbrow>>"+ totAmtDetPoamdDetbrow);
System.out.println("totAmtDet for poamd>>>>>>>> "+ totAmtDetPoamdDetbrow);
System.out.println("totAmtDet for porder>>>>>>>> "+ totAmtDetporder);
exchRateStr = checkNull(genericUtility.getColumnValue("exch_rate", dom1));
exchRatePoAmd =Double.parseDouble(exchRateStr);
System.out.println("Exchrate>>"+exchRatePoAmd);
totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrow *exchRatePoAmd;
//totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrow *exchRatePoAmd;
totAmtProj = totAmtDetPoamdDetbrow + totAmtDetporder+ totAmtDetpordertot;
System.out.println("totAmtProj>>>>> "+ totAmtProj);
if (totAmtProj > approxCost)
......@@ -2937,9 +2948,15 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
endStr = errString.substring(errString.indexOf("</description>"),errString.length());
descrStr = errString.substring(errString.indexOf("<description>") + 13,errString.indexOf("</description>"));
descrStart = descrStr.substring(0, descrStr.indexOf("]"));
descrEnd = descrStr.substring(descrStr.indexOf("]"),descrStr.length());
value = "Approx Cost Of budget : "+ BigDecimal.valueOf(approxCost).toPlainString()
+ ", Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj).toPlainString();
descrEnd = descrStr.substring(descrStr.indexOf("]"),descrStr.length());
System.out.println("<approxCost IN ERROR MESSAGE> @@@@@@@@@@@@@@@@@"+ approxCost);
System.out.println("<totAmtDetpordertot IN ERROR MESSAGE > @@@@@@@@@@@@@@@@@"+ totAmtDetpordertot);
System.out.println("<totAmtDetPoamdDetbrow + totAmtDetporder IN ERROR MESSAGE > @@@@@@@@@@@@@@@@@"+ totAmtDetPoamdDetbrow + totAmtDetporder);
value = " ; Project Aprroved Amount : "+ BigDecimal.valueOf(approxCost).toPlainString()
+" ; Consumed Amount : "+ BigDecimal.valueOf(totAmtDetpordertot).toPlainString()
+" ; Current Purchase Amendment Amount : "+ BigDecimal.valueOf(totAmtDetPoamdDetbrow + totAmtDetporder ).toPlainString()
+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj - approxCost).toPlainString();
System.out.println("Value ::: "+ value);
descrStart = descrStart.concat(value).concat(descrEnd);
errString = startStr.concat(descrStart).concat(endStr);
......
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