Commit 2706a4d5 authored by pdas's avatar pdas

changes made for poamd budget cost validation.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99120 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f457b378
...@@ -127,8 +127,11 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -127,8 +127,11 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
String type = "", task_code = "", taskcodeparent = "", rel_agnst = "", val = "", val1 = "", retval = ""; String type = "", task_code = "", taskcodeparent = "", rel_agnst = "", val = "", val1 = "", retval = "";
double mmin_day = 0, mmax_day = 0, mmin_amt = 0, mmax_amt = 0; double mmin_day = 0, mmax_day = 0, mmin_amt = 0, mmax_amt = 0;
boolean isLine = false; boolean isLine = false;
String pordNo = ""; String pordNo = "",linenoOrd ="";
Timestamp pordDate = null; Timestamp pordDate = null;
double indBalance=0;
double totAmtIndent =0;
double totAmtDetpordertemp =0;
double totAmtDetPoamdDetbrow = 0, totAmtDetIndent = 0, totAmtDetporder = 0, approxCost = 0, totAmtProj = 0; double totAmtDetPoamdDetbrow = 0, totAmtDetIndent = 0, totAmtDetporder = 0, approxCost = 0, totAmtProj = 0;
try { try {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
...@@ -1035,442 +1038,371 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal, ...@@ -1035,442 +1038,371 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,
} }
} }
// Added by Priyanka Das Request ID -D15ESUN002 //Added by Priyanka Das Request ID -D15ESUN002
pordNo = checkNull(genericUtility.getColumnValue( pordNo = checkNull(genericUtility.getColumnValue("purc_order", dom));
"purc_order", dom)); lineNoOrd = checkNull(genericUtility.getColumnValue("line_no__ord", dom));
lineNoOrd = checkNull(genericUtility.getColumnValue( amdNo = checkNull(genericUtility.getColumnValue("amd_no",dom ));
"line_no__ord", dom)); purcOrder = checkNull(genericUtility.getColumnValue("purc_order", dom));
amdNo = checkNull(genericUtility.getColumnValue( indNo =checkNull(genericUtility.getColumnValue("ind_no", dom));
"amd_no", dom)); varValue = discommon.getDisparams("999999", "TYPE_ALLOW_PROJBUDGET", conn);
purcOrder = checkNull(genericUtility.getColumnValue( sql="select pord_type from porder where purc_order = ?";
"purc_order", dom)); pstmt = conn.prepareStatement(sql);
indNo = checkNull(genericUtility.getColumnValue( pstmt.setString(1, purcOrder);
"ind_no", dom)); rs = pstmt.executeQuery();
varValue = discommon.getDisparams("999999", if (rs.next())
"TYPE_ALLOW_PROJBUDGET", conn); {
sql = "select pord_type from porder where purc_order = ?"; pordType = rs.getString(1);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
if (rs.next()) {
pordType = rs.getString(1);
}
System.out.println("Amdtype.........." + pordType);
if (varValue != null && varValue.trim().length() > 0
&& varValue != "NULLFOUND"
&& pordType.equalsIgnoreCase(varValue)) {
System.out.println("Project Code>>>> [" + projCode);
if (projCode == null
|| projCode.trim().length() == 0) {
errCode = "VEPRJ1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
} }
if (projCode != null
&& projCode.trim().length() > 0) { System.out.println("Amdtype.........."+pordType);
errCode = isExist("project", "proj_code", if (varValue != null && varValue.trim().length() > 0
projCode, conn); && varValue != "NULLFOUND" && pordType.equalsIgnoreCase(varValue))
if ("FALSE".equalsIgnoreCase(errCode)) { {
errCode = "VTPROJ1"; System.out.println("Project Code>>>> [" +projCode);
errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); if(projCode==null || projCode.trim().length()==0)
break; {
} errCode = "VEPRJ1";
ordDateStr = checkNull(genericUtility
.getColumnValue("ord_date", dom1));
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()) {
cntproj = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out
.println("Count for project not between order date>>>> + "
+ cntproj);
if (cntproj == 0) {
errCode = "VTINVORDT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
sql1 = "select approx_cost from project where proj_code = ?";
projCode = checkNull(genericUtility
.getColumnValue("proj_code", dom));
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, projCode);
System.out.println("Project code is....."
+ projCode);
rs1 = pstmt1.executeQuery();
while (rs1.next()) {
approxCost = rs1.getDouble(1);
System.out
.println("approxCost for Project Code>>>>>>>> "
+ approxCost);
}
sql = "select count(*) from porder,porddet"
+ " where (porddet.purc_order = porder.purc_order)"
+ "and porder.confirmed = 'N' and porddet.proj_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
rs = pstmt.executeQuery();
while (rs.next()) {
cntporder = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for porder>>>> + "
+ cntporder);
if (cntporder >= 1) {
errCode = "VTDUPROJ1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
System.out.println("AmdNo>>>>>" + amdNo);
if (amdNo == null || amdNo.trim().length() == 0) {
amdNo = "@@@@@";
}
sql = "select count(*) from poamd_hdr,poamd_det"
+ " where (poamd_det.amd_no = poamd_hdr.amd_no)"
+ "and poamd_hdr.confirmed = 'N' and poamd_det.proj_code = ? "
+ "and poamd_det.amd_no ! = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
pstmt.setString(2, amdNo);
rs = pstmt.executeQuery();
while (rs.next()) {
cntamd = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for poamd>>>> + "
+ cntamd);
if (cntamd >= 1) {
errCode = "VTDUPRO3";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
} }
if (projCode != null && projCode.trim().length() > 0)
{
errCode = isExist("project", "proj_code",projCode, conn);
if ("FALSE".equalsIgnoreCase(errCode))
{
errCode = "VTPROJ1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
ordDateStr = checkNull(genericUtility.getColumnValue("ord_date", dom1));
System.out.println("orderdate>>>>"+ordDateStr);
//sd = new SimpleDateFormat(genericUtility.getDBDateFormat());
pordDate= Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//pordDate = Timestamp.valueOf(genericUtility.getValidDateString(ordDateStr,genericUtility.getDBDateFormat()));
//pordDate = (Timestamp) sd.parse(ordDateStr);
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())
{
cntproj = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for project not between order date>>>> + "+cntproj);
if (cntproj == 0)
{
errCode = "VTINVORDT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
/* }
* CODE FOR INDENT AND INDENT REQ VALIDATION
* COUNT sql1 ="select approx_cost from project where proj_code = ?" ;
*/
sql = "select count(*) from indent where status = 'U' and proj_code = ?"; projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
pstmt = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql1);
pstmt.setString(1, projCode); pstmt1.setString(1, projCode);
rs = pstmt.executeQuery(); System.out.println("Project code is....."+projCode);
while (rs.next()) { rs1 = pstmt1.executeQuery();
cntind = rs.getInt(1); while (rs1.next())
} {
rs.close(); approxCost =rs1.getDouble(1);
rs = null; System.out.println("approxCost for Project Code>>>>>>>> "
pstmt.close(); + approxCost);
pstmt = null;
}
sql = "select count(*) from porder,porddet"
+ " where (porddet.purc_order = porder.purc_order)"
+ "and porder.confirmed = 'N' and porddet.proj_code = ?" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
rs = pstmt.executeQuery();
while (rs.next())
{
cntporder = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for porder>>>> + "+cntporder);
if (cntporder >= 1)
{
errCode = "VTDUPROJ1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Count for indent>>>> + " }
+ cntind);
if (cntind >= 1) {
errCode = "VTDUPROJ2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
} System.out.println("AmdNo>>>>>" +amdNo);
sql = "select count(*) from indent_hdr where confirmed = 'N' and proj_code = ? "; if(amdNo == null || amdNo.trim().length() ==0)
pstmt = conn.prepareStatement(sql); {
pstmt.setString(1, projCode); amdNo ="@@@@@";
rs = pstmt.executeQuery(); }
while (rs.next()) { sql = "select count(*) from poamd_hdr,poamd_det"
cntindhdr = rs.getInt(1); + " where (poamd_det.amd_no = poamd_hdr.amd_no)"
} + "and poamd_hdr.confirmed = 'N' and poamd_det.proj_code = ? " +
rs.close(); "and poamd_det.amd_no ! = ?";
rs = null; pstmt = conn.prepareStatement(sql);
pstmt.close(); pstmt.setString(1,projCode);
pstmt = null; pstmt.setString(2,amdNo);
rs = pstmt.executeQuery();
while (rs.next())
{
cntamd = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for poamd>>>> + "+cntamd);
System.out if (cntamd >= 1)
.println("Count for indent where unconfirmed indent>>>> + " {
+ cntindhdr); errCode = "VTDUPRO3";
if (cntindhdr >= 1) { errList.add(errCode);
errCode = "VTDUPROJ"; errFields.add(childNodeName.toLowerCase());
errList.add(errCode); break;
errFields.add(childNodeName.toLowerCase());
break;
} }
double indBalance = 0; /*CODE FOR INDENT AND INDENT REQ VALIDATION COUNT*/
double totAmtIndent = 0; sql="select count(*) from indent where status = 'U' and proj_code = ?";
sql1 = " select sum(quantity * purc_rate) " pstmt = conn.prepareStatement(sql);
+ "from indent where proj_code = ? " pstmt.setString(1,projCode);
+ "and status NOT IN ('C','X')"; rs = pstmt.executeQuery();
projCode = checkNull(genericUtility while (rs.next())
.getColumnValue("proj_code", dom)); {
pstmt = conn.prepareStatement(sql1); cntind = rs.getInt(1);
pstmt.setString(1, projCode); }
System.out rs.close();
.println("Project code IN (quantity * purc_rate) is....." rs = null;
+ projCode); pstmt.close();
rs = pstmt.executeQuery(); pstmt = null;
while (rs.next()) {
totAmtIndent = rs.getDouble(1); System.out.println("Count for indent>>>> + "+ cntind);
System.out if (cntind >= 1)
.println("totAmtDet for Indent with quant* rate>>>>>>>> " {
+ totAmtIndent); errCode = "VTDUPROJ2";
} errList.add(errCode);
rs.close(); errFields.add(childNodeName.toLowerCase());
rs = null; break;
pstmt.close();
pstmt = null;
System.out
.println("totAmtDet for Indent with quant* rate>>>>>>>> "
+ totAmtIndent);
sql = "select sum(ord_qty * purc_rate) from indent where proj_code = ?"
+ "and status NOT IN ('C','X') ";
projCode = checkNull(genericUtility
.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
System.out
.println("Project code in (ord_qty * purc_rate)is....."
+ projCode);
rs = pstmt.executeQuery();
while (rs.next()) {
indBalance = rs.getDouble(1);
System.out
.println("totAmtDet for Indent with ordqty * purcrate>>>>>>>> "
+ indBalance);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
totAmtDetIndent = totAmtIndent - indBalance;
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(); sql = "select count(*) from indent_hdr where confirmed = 'N' and proj_code = ? ";
rs = null; pstmt = conn.prepareStatement(sql);
pstmt.close(); pstmt.setString(1,projCode);
pstmt = null; rs = pstmt.executeQuery();
while (rs.next())
{
cntindhdr = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("Count for indent where unconfirmed indent>>>> + "+ cntindhdr);
if (cntindhdr >= 1)
{
errCode = "VTDUPROJ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
System.out }
.println("totAmtDet for Porder outside loop>>>>>>>> "
sql1 =" select sum(quantity * purc_rate) " +
"from indent where proj_code = ? " +
"and status NOT IN ('C','X')";
projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode);
System.out.println("Project code IN (quantity * purc_rate) is....."+projCode);
rs = pstmt.executeQuery();
while (rs.next())
{
totAmtIndent =rs.getDouble(1);
System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ totAmtIndent);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ totAmtIndent);
sql ="select sum(ord_qty * purc_rate) from indent where proj_code = ?" +
"and status NOT IN ('C','X') ";
projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, projCode);
System.out.println("Project code in (ord_qty * purc_rate)is....."+projCode);
rs = pstmt.executeQuery();
while (rs.next())
{
indBalance =rs.getDouble(1);
System.out.println("totAmtDet for Indent with ordqty * purcrate>>>>>>>> "+indBalance);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
totAmtDetIndent =totAmtIndent - indBalance;
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); + 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 != ?"; rs.close();
rs = null;
projCode = checkNull(genericUtility pstmt.close();
.getColumnValue("proj_code", dom)); pstmt = null;
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode); System.out.println("totAmtDet for Porder outside loop>>>>>>>> "
pstmt.setString(2, pordNo); + totAmtDetpordertot);
pstmt.setString(3, lineNoOrd);
System.out.println("Project code is....." /* sql1 ="select sum(a.quantity * a.rate) from porddet a, porder b" +
+ projCode); " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" +
rs = pstmt.executeQuery(); " and a.proj_code = ? and a.purc_order! = ? and line_no != ? " ;
while (rs.next()) {
totAmtDetporder = rs.getDouble(1); projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
System.out pstmt = conn.prepareStatement(sql1);
.println("totAmtDet for Porder in loop>>>>>>>> " pstmt.setString(1, projCode);
+ totAmtDetporder); pstmt.setString(2,pordNo);
pstmt.setString(3, lineNoOrd);
}
System.out.println("Project code is....."+projCode);
System.out rs = pstmt.executeQuery();
.println("totAmtDet for Porder outside loop>>>>>>>> " while (rs.next())
{
totAmtDetporder =rs.getDouble(1);
System.out.println("totAmtDet for Porder in loop>>>>>>>> "
+ totAmtDetporder); + 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>>>>>>>> " System.out.println("totAmtDet for Porder outside loop>>>>>>>> "
+ totAmtDetporder); + totAmtDetporder);
System.out.println("dom@@@@" */
+ genericUtility.serializeDom(dom)); System.out.println("dom@@@@"+genericUtility.serializeDom(dom));
System.out.println("dom1111@@@@" System.out.println("dom1111@@@@"+genericUtility.serializeDom(dom1));
+ genericUtility.serializeDom(dom1)); System.out.println("dom2222222222@@@@"+genericUtility.serializeDom(dom2));
System.out.println("dom2222222222@@@@" NodeList detail2List = dom2.getElementsByTagName("Detail2");
+ genericUtility.serializeDom(dom2)); System.out.println("ChildNOde"+childNodeName);
NodeList detail2List = dom2 System.out.println("detail2List"+detail2List);
.getElementsByTagName("Detail2"); noOfParent = detail2List.getLength();
System.out.println("ChildNOde" + childNodeName); System.out.println("NO OF PARENT@@@@"+noOfParent);
System.out.println("detail2List" + detail2List); int a=0;
noOfParent = detail2List.getLength(); projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
System.out.println("NO OF PARENT@@@@" System.out.println("projCode>>>>"+projCode);
+ noOfParent); for (a = 0; a < noOfParent; a++)
int a = 0; {
projCode = checkNull(genericUtility System.out.println("in loop");
.getColumnValue("proj_code", dom)); System.out.println(" detail2List.item(a)"+ detail2List.item(a));
System.out.println("projCode>>>>" + projCode); System.out.println(genericUtility.getColumnValueFromNode("proj_code", detail2List.item(a))+"in genericutility");
for (a = 0; a < noOfParent; a++) { String projcodeBrow =checkNull(genericUtility.getColumnValueFromNode("proj_code", detail2List.item(a)));
System.out.println("in loop"); System.out.println("projcodebrow>>>"+projcodeBrow);
System.out.println(" detail2List.item(a)" System.out.println("projcode>>"+projCode);
+ detail2List.item(a)); if(projcodeBrow.equals(projCode))
System.out.println(genericUtility {
.getColumnValueFromNode(
"proj_code", detail2List
.item(a))
+ "in genericutility");
String projcodeBrow = checkNull(genericUtility
.getColumnValueFromNode(
"proj_code", detail2List
.item(a)));
System.out.println("projcodebrow>>>"
+ projcodeBrow);
System.out.println("projcode>>" + projCode);
if (projcodeBrow.equals(projCode)) {
System.out.println("in condition!!!"); System.out.println("in condition!!!");
String quantitypoamd = checkNull(genericUtility String quantitypoamd=checkNull(genericUtility.getColumnValueFromNode("quantity", detail2List.item(a)));
.getColumnValueFromNode( double quantitypoamddet =0,ratepoamddet =0,totAmtDetPoamdDetbrowtemp =0;
"quantity", detail2List quantitypoamddet = quantitypoamd==null?0:Double.parseDouble(quantitypoamd);
.item(a))); System.out.println("<quantitypoamd >@@@@@@ " + quantitypoamd);
double quantitypoamddet = 0, ratepoamddet = 0, totAmtDetPoamdDetbrowtemp = 0; String ratepoamd=checkNull(genericUtility.getColumnValueFromNode("rate", detail2List.item(a)));
quantitypoamddet = quantitypoamd == null ? 0 ratepoamd = ratepoamd != null && ratepoamd.trim().length() > 0 ? ratepoamd.trim() : "0";
: Double System.out.println("<ratepoamd > @@@@@@@@@@@@@@@@@" + ratepoamd);
.parseDouble(quantitypoamd); ratepoamddet = ratepoamd==null?0:Double.parseDouble(ratepoamd);
System.out totAmtDetPoamdDetbrowtemp =quantitypoamddet * ratepoamddet;
.println("<quantitypoamd >@@@@@@ " pordNo =checkNull(genericUtility.getColumnValueFromNode("purc_order", detail2List.item(a)));
+ quantitypoamd); linenoOrd=checkNull(genericUtility.getColumnValueFromNode("line_no_ord", detail2List.item(a)));
String ratepoamd = checkNull(genericUtility sql1 ="select sum(a.quantity * a.rate) from porddet a, porder b" +
.getColumnValueFromNode("rate", " where ( a.purc_order = b.purc_order ) and b.confirmed = 'Y'" +
detail2List.item(a))); " and a.proj_code = ? and a.purc_order = ? and line_no NOT IN (?) " ;
ratepoamd = ratepoamd != null projCode =checkNull(genericUtility.getColumnValue("proj_code",dom ));
&& ratepoamd.trim().length() > 0 ? ratepoamd pstmt = conn.prepareStatement(sql1);
.trim() pstmt.setString(1, projCode);
: "0"; pstmt.setString(2,pordNo);
System.out pstmt.setString(3, lineNoOrd);
.println("<ratepoamd > @@@@@@@@@@@@@@@@@"
+ ratepoamd); System.out.println("Project code is....."+projCode);
ratepoamddet = ratepoamd == null ? 0 rs = pstmt.executeQuery();
: Double.parseDouble(ratepoamd); while (rs.next())
totAmtDetPoamdDetbrowtemp = quantitypoamddet {
* ratepoamddet;
System.out String totAmtDetpordertempstr =rs.getString(1);
.println("totAmtDetPoamdDetbrowtemp @@@ " totAmtDetpordertempstr = totAmtDetpordertempstr != null && totAmtDetpordertempstr.trim().length() > 0 ? totAmtDetpordertempstr.trim() : "0.0";
+ totAmtDetPoamdDetbrowtemp); totAmtDetpordertemp =Double.parseDouble(totAmtDetpordertempstr);
totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrowtemp totAmtDetporder =totAmtDetporder+totAmtDetpordertemp;
+ totAmtDetPoamdDetbrow; System.out.println("totAmtDet for Porder in loop>>>>>>>> "
+ totAmtDetporder);
} }
System.out System.out.println("totAmtDetPoamdDetbrowtemp @@@ "+totAmtDetPoamdDetbrowtemp);
.println("totAmtDetPoamdDetbrow>>" totAmtDetPoamdDetbrow =totAmtDetPoamdDetbrowtemp +totAmtDetPoamdDetbrow;
+ totAmtDetPoamdDetbrow);
} }
System.out
.println("totAmtDet for Indent with quant* rate>>>>>>>> " System.out.println("totAmtDetPoamdDetbrow>>"+ totAmtDetPoamdDetbrow);
+ totAmtDetIndent);
System.out
.println("totAmtDet for poamd>>>>>>>> " System.out.println("totAmtDet for Indent with quant* rate>>>>>>>> "+ totAmtDetIndent);
+ totAmtDetPoamdDetbrow); System.out.println("totAmtDet for poamd>>>>>>>> " +totAmtDetPoamdDetbrow);
System.out System.out.println("totAmtDet for porder>>>>>>>> " +totAmtDetporder);
.println("totAmtDet for porder>>>>>>>> " totAmtProj = totAmtDetIndent + totAmtDetPoamdDetbrow + totAmtDetporder + totAmtDetpordertot;
+ totAmtDetporder); System.out.println("totAmtProj>>>>> "+totAmtProj);
totAmtProj = totAmtDetIndent if(totAmtProj > approxCost )
+ totAmtDetPoamdDetbrow {
+ totAmtDetporder + totAmtDetpordertot; errCode = "VTPROJCOST";
System.out.println("totAmtProj>>>>> " errList.add(errCode);
+ totAmtProj); errFields.add(childNodeName.toLowerCase());
if (totAmtProj > approxCost) { break;
errCode = "VTPROJCOST"; }
errList.add(errCode); }
errFields.add(childNodeName.toLowerCase());
break;
}
} }
} }
// Ended by Priyanka Das Request ID -D15ESUN002 //Ended by Priyanka Das Request ID -D15ESUN002
} }
if (childNodeName.equalsIgnoreCase("req_date")) { if (childNodeName.equalsIgnoreCase("req_date")) {
......
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