Commit 6db00fd3 authored by pdas's avatar pdas

REQUEST ID -D15ESUN002

CHANGES FOR COMPARISON OF CONSUMED AMOUNT WITH ALLOCATED AMOUNT FOR PROJECT.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98722 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a2786f01
......@@ -641,7 +641,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
{
sql = " select quantity__stduom,ord_qty from indent where ind_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
pstmt.setString(1, indNo);
rs = pstmt.executeQuery();
if (rs.next())
{
......
......@@ -128,6 +128,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
double mmin_day = 0, mmax_day = 0, mmin_amt = 0, mmax_amt = 0;
boolean isLine = false;
String pordNo ="";
Timestamp pordDate = null;
double totAmtDetPoamdDetbrow =0,totAmtDetIndent =0,totAmtDetporder =0,approxCost =0,totAmtProj =0;
try
{
......@@ -858,9 +859,6 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
if( childNodeName.equalsIgnoreCase("acct_code__cr") )
{
System.out.println("Priyanka dom:::"+genericUtility.serializeDom(dom));
System.out.println("Priyanka dom1:::"+genericUtility.serializeDom(dom1));
System.out.println("Priyanka dom2:::"+genericUtility.serializeDom(dom2));
acctCodeCr = genericUtility.getColumnValue("acct_code__cr", dom);
siteCode = genericUtility.getColumnValue("site_code", dom);
......@@ -1066,17 +1064,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
}
ordDateStr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
String orderDate = null;
SimpleDateFormat sd = null;
sd = new SimpleDateFormat(genericUtility.getApplDateFormat());
Date pordDate = sd.parse(ordDateStr);
orderDate =sd.format(pordDate);
sql ="select count(*) from project where proj_code = ? and ('" + orderDate + "' between start_date and end_date OR '" + orderDate + "' between start_date and ext_end_date)";
System.out.println("orderdate>>>>"+ordDateStr);
pordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("pordDate>>>>"+pordDate);
sql ="select count(*) from project where proj_code = ? and ? between start_date and end_date OR ? between start_date and ext_end_date";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
pstmt.setTimestamp(2, pordDate);
pstmt.setTimestamp(3, pordDate);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -1256,7 +1251,32 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ totAmtIndent);
System.out.println("totAmtDet for Indent with ordqty * purcrate>>>>>>>> "+indBalance);
System.out.println("totAmtDet for Indent with totAmtDetIndent>>>>>>>> "+totAmtDetIndent);
Double totAmtDetpordertot =0.0;
sql = "select sum(a.quantity * a.rate) from porddet a, porder b" +
" where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" +
" and a.proj_code = ? and a.purc_order! = ? ";
projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
pstmt.setString(2,pordNo);
//pstmt.setString(3, lineNoOrd);
System.out.println("Project code is in porder....."+projCode);
rs = pstmt.executeQuery();
while (rs.next())
{
totAmtDetpordertot =rs.getDouble(1);
System.out.println("totAmtDet for Porder without in loop>>>>>>>> "
+ totAmtDetpordertot);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "
+ totAmtDetpordertot);
sql1 ="select sum(a.quantity * a.rate) 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 != ?" ;
......@@ -1279,7 +1299,29 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "
+ totAmtDetporder);
sql1 ="select sum(a.quantity * a.rate) 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 != ? " ;
projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode);
pstmt.setString(2,pordNo);
pstmt.setString(3, lineNoOrd);
System.out.println("Project code is....."+projCode);
rs = pstmt.executeQuery();
while (rs.next())
{
totAmtDetporder =rs.getDouble(1);
System.out.println("totAmtDet for Porder in loop>>>>>>>> "
+ totAmtDetporder);
}
System.out.println("totAmtDet for Porder outside loop>>>>>>>> "
+ totAmtDetporder);
System.out.println("dom@@@@"+genericUtility.serializeDom(dom));
System.out.println("dom1111@@@@"+genericUtility.serializeDom(dom1));
System.out.println("dom2222222222@@@@"+genericUtility.serializeDom(dom2));
......@@ -1323,7 +1365,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, POrde
System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ totAmtDetIndent);
System.out.println("totAmtDet for poamd>>>>>>>> " +totAmtDetPoamdDetbrow);
System.out.println("totAmtDet for porder>>>>>>>> " +totAmtDetporder);
totAmtProj = totAmtDetIndent + totAmtDetPoamdDetbrow + totAmtDetporder;
totAmtProj = totAmtDetIndent + totAmtDetPoamdDetbrow + totAmtDetporder+totAmtDetpordertot;
System.out.println("totAmtProj>>>>> "+totAmtProj);
if(totAmtProj > approxCost )
{
......
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