Commit 4e5a930e authored by agaikwad's avatar agaikwad

Request_id-D15ISUN003


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100316 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 00990868
......@@ -483,6 +483,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
boolean ValueType = false, firstNull=true;
DistCommon discommon = new DistCommon();
double sumQtyamd=0,excedAmt=0;
double tottemp = 0.0;
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -668,29 +669,6 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
rs3 = null;
pstmt3.close();
pstmt3 = null;
/*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 b.status! = 'X'";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, projCode);
pstmt1.setString(2,purcOrder);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
totAmtDetpordertot = rs1.getDouble(1);
System.out.println("totAmtDet for confirmed Porder@@@@@"+ totAmtDetpordertot);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
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 " +
......@@ -774,77 +752,30 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
pstmtold.close();
pstmtold = null;
totAmtpoamdtempold = totAmtpoamdtemp - totAmtpoamdtempold;
System.out.println("sumQtyamd" + totAmtpoamdtempold1);
totAmtpoamdtempold1=String.valueOf(totAmtpoamdtempold);
if(totAmtpoamdtempold1.contains("-"))
{
System.out.println("INNNNNN");
totAmtpoamdtempold = totAmtpoamdtempold * (-1);
System.out.println("IN MINUS " + totAmtpoamdtempold);
}
System.out.println("ABhi testing add old qty" + totAmtpoamdtempold);
System.out.println("linenoOrdBrow>>>["+totAmtpoamdtempold+"]" );
/*sumQtyamd=rateOldamd * qtyOldamd;
sumqty= String.valueOf(sumQtyamd);
System.out.println("Sum Quamtity String" + sumqty);
sumQtyamd = totAmtDetPoamdDetbrowtemp - sumQtyamd;
System.out.println("sumQtyamd" + sumQtyamd);
if(sumqty.contains("-"))
{
System.out.println("INNNNNN");
sumQtyamd = sumQtyamd * (-1);
System.out.println("IN MINUS " + sumQtyamd);
}
System.out.println("ABhi testing add old qty" + sumQtyamd);
countqty++;
System.out.println("linenoOrdBrow>>>["+linenoOrdBrow+"]a["+a+"]" );
if(linenoOrdBrow == null || "@".equalsIgnoreCase(linenoOrdBrow) || "".equalsIgnoreCase(linenoOrdBrow) || linenoOrdBrow.trim().length()==0)
{
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]+totAmtDetpordertot["+totAmtDetpordertot+"]-approxCost["+approxCost+"]");
excedAmt += sumQtyamd + totAmtDetpordertot - approxCost;
}
else
{
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]");
excedAmt += sumQtyamd;
}
System.out.println("@@@@@@@@@@ after excedAmt["+excedAmt+"]");*/
if((lineNoold == null || "@".equalsIgnoreCase(lineNoold) || "".equalsIgnoreCase(lineNoold) || lineNoold.trim().length()==0 ) && firstNull== true)
{
firstNull=false;
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]+totAmtDetpordertot["+totAmtDetpordertot+"]-approxCost["+approxCost+"]");
excedAmt += totAmtpoamdtempold + totAmtDetpordertot - approxCost;
System.out.println("totAmtpoamdtemp@@@@@@@@" +totAmtpoamdtemp);
tottemp+=totAmtpoamdtemp;
System.out.println("totAmtpoamdtemp Null @@@@@" + totAmtpoamdtemp);
}
else
{
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]");
excedAmt += totAmtpoamdtempold;
}
System.out.println("@@@@@@@@@@ after excedAmt["+excedAmt+"]");
System.out.println("excedAmt"+ excedAmt);
excedAmt1=String.valueOf(excedAmt);
System.out.println("excedAmt1"+excedAmt1);
System.out.println("sumQtyamd"+ sumQtyamd);
if(excedAmt == 0.0 || excedAmt1.contains("-"))
// if(excedAmt >0.0 || excedAmt1.contains("-") || totAmtDetPoamdDetbrow < sumQtyamd )
System.out.println("totAmtDetPoamdDetbrowtemp else @@@@@@@@" +totAmtpoamdtemp);
System.out.println("sumQtyamd else @@@@@@@@" + sumQtyamd);
tottemp+= totAmtpoamdtemp - totAmtpoamdtempold;
if(tottemp < 0)
{
break;
System.out.println(" IF tottemp");
tottemp=0;
}
else
{
totAmtPoamd = totAmtnotcurr + totAmtDetpordertot + totAmtpoamdtemp;
System.out.println("totamtpoamd>>>>.."+totAmtPoamd);
System.out.println("tottemp else @@@@@@@@" + tottemp);
}
totAmtPoamd = totAmtDetpordertot + tottemp;
System.out.println("tottemp>>>>.."+tottemp);
System.out.println("totamtpordertot"+totAmtDetpordertot);
System.out.println("totamtpoamdtemp"+totAmtpoamdtemp);
System.out.println("totAmtnotcurr>>>>"+totAmtnotcurr);
if(approxCost < totAmtPoamd)
{
System.out.println("In approxcost validation>>");
......@@ -869,7 +800,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
// +" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtPoamd - approxCost).toPlainString();
// +" ; Exceeded Amount : "+ BigDecimal.valueOf(approxCost - totAmtDetpordertot).toPlainString();
//+" ; Exceeded Amount : "+ BigDecimal.valueOf( totAmtpoamdtempold + totAmtDetpordertot - approxCost).toPlainString();
+" ; Exceeded Amount : "+ BigDecimal.valueOf( excedAmt).toPlainString();
+" ; Exceeded Amount : "+ BigDecimal.valueOf( totAmtPoamd - approxCost ).toPlainString();
System.out.println("Value ::: "+ value);
......@@ -879,7 +810,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
return errCode;
}
}
}
rs.close();
......@@ -986,7 +917,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
unitRate = rs1.getString("unit__rate");
dlvDate = rs1.getTimestamp("dlv_date");
locCode = checknull(rs1.getString("loc_code"));
status = checknull(rs1.getString("status"));
status = rs1.getString("status");
specificInstr = checknull(rs1.getString("specific_instr"));
suppCodeMnfr = checknull(rs1.getString("supp_code_mnfr"));
rateClg = rs1.getDouble("rate__clg");
......@@ -999,6 +930,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
System.out.println("@@@@@@@@ indNo [" + indNo + "]");
System.out.println("CLG rate select from poamd_det[" + rateClg + "]");
if (status == null|| status.trim().length() == 0)
{
status="O";
}
if (indNo != null && indNo.trim().length() > 0)
{
sql = " select quantity__stduom,ord_qty from indent where ind_no = ? ";
......@@ -1089,6 +1024,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
System.out.println("Status is " + status);
sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?,"
+ " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?,"
+ " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?,"
......
......@@ -129,6 +129,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
String type = "", task_code = "", taskcodeparent = "", rel_agnst = "", val = "", val1 = "", retval = "";
double mmin_day = 0, mmax_day = 0, mmin_amt = 0, mmax_amt = 0;
boolean isLine = false;
boolean excedAmtFlag=true;
String pordNo = "", linenoOrdBrow = "";
Timestamp pordDate = null;
double indBalance = 0;
......@@ -1447,61 +1448,6 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
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'"
+ " and a.proj_code = ? and a.purc_order! = ? and b.status! = 'X'";
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())
{
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 != ? "
* ;
*
* 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));
......@@ -1516,7 +1462,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
double chekAMt=0;
String chekAMt1="";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
double tottemp = 0.0;
System.out.println("projCode>>>>" + projCode);
for (a = 0; a < noOfParent; a++)
{
......@@ -1573,138 +1519,51 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
sumqty= String.valueOf(sumQtyamd);
System.out.println("Sum Quamtity String" + sumqty);
sumQtyamd = totAmtDetPoamdDetbrowtemp - sumQtyamd;
//sumQtyamd = totAmtDetPoamdDetbrow - sumQtyamd;
System.out.println("sumQtyamd" + sumQtyamd);
sumqty= String.valueOf(sumQtyamd);
/*if(sumqty.contains("-"))
{
System.out.println("INNNNNN");
sumQtyamd = sumQtyamd * (-1);
System.out.println("IN MINUS " + sumQtyamd);
}*/
System.out.println("ABhi testing add old qty" + sumQtyamd);
//countqty++;
System.out.println("linenoOrdBrow>>>["+linenoOrdBrow+"]a["+a+"]" );
if((linenoOrdBrow == null || "@".equalsIgnoreCase(linenoOrdBrow) || "".equalsIgnoreCase(linenoOrdBrow) || linenoOrdBrow.trim().length()==0 ) && firstNull== true)
{
firstNull=false;
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]+totAmtDetpordertot["+totAmtDetpordertot+"]-approxCost["+approxCost+"]");
excedAmt += sumQtyamd + totAmtDetpordertot - approxCost;
System.out.println("totAmtDetPoamdDetbrowtemp@@@@@@@@" +totAmtDetPoamdDetbrowtemp);
tottemp+=totAmtDetPoamdDetbrowtemp;
System.out.println("tottemp Null @@@@@" + tottemp);
}
else
{
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]");
excedAmt += sumQtyamd;
System.out.println("totAmtDetPoamdDetbrowtemp else @@@@@@@@" +totAmtDetPoamdDetbrowtemp);
System.out.println("sumQtyamd else @@@@@@@@" + sumQtyamd);
tottemp+= totAmtDetPoamdDetbrowtemp - sumQtyamd;
if(tottemp < 0)
{
System.out.println(" IF tottemp");
tottemp=0;
}
System.out.println("tottemp else @@@@@@@@" + tottemp);
}
System.out.println("@@@@@@@@@@ after excedAmt["+excedAmt+"]");
System.out.println("excedAmt is "+excedAmt);
/* if(countqty > 1)
/* if(excedAmt <=0)
{
excedAmt = sumQtyamd + totAmtDetpordertot - approxCost;
System.out.println("totAmtDetpordertot");
System.out.println("approxCost" +approxCost);
System.out.println("sumQtyamd"+sumQtyamd);
System.out.println("excedAmt"+excedAmt);
sumQtyamd = excedAmt +sumQtyamd;
System.out.println("sumQtyamd" +sumQtyamd );
excedAmtFlag=false;
}*/
System.out.println("@@@@@@@@@@ excedAmtFlag["+excedAmtFlag+"]");
}
}
/* if(temparr.length() >0)
{
String tempArray[]=temparr.split(",");
System.out.println("tempArray[].length :-["+tempArray.length+"]");
System.out.println("line!!!!"+line);
for(itrArr=0; itrArr < tempArray.length;itrArr++)
{
line1=line1+"'"+tempArray[itrArr]+"',";
}
System.out.println("line1 before sql:- ["+line1+"]");
line1=line1.substring(0, line1.length()-1);
sql1 = "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 a.purc_order = ? and line_no NOT IN ( "+ line1 +")";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, projCode);
pstmt.setString(2, pordNo);
System.out.println("pordNo is....."+ pordNo);
System.out.println("Project code is....."+ projCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtDetpordertempstr = rs.getString(1);
totAmtDetpordertempstr = totAmtDetpordertempstr != null && totAmtDetpordertempstr.trim().length() > 0 ? totAmtDetpordertempstr.trim() : "0.0";
totAmtDetpordertemp = Double.parseDouble(totAmtDetpordertempstr);
totAmtDetporder = totAmtDetporder + totAmtDetpordertemp;
System.out.println("totAmtDet for Porder in loop>>>>>>>> "+ totAmtDetporder);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
/* sql2 ="select sum(a.tot_amt) from poamd_det a,poamd_hdr b " +
" where (a.purc_order = b.purc_order) and a.proj_code = ? " +
" and a.amd_no ! = ?";
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
System.out.println("AmdNo>>>>>" + amdNo);
if (amdNo == null || amdNo.trim().length() == 0)
{
amdNo = "@@@@@";
}
pstmt = conn.prepareStatement(sql2);
pstmt.setString(1, projCode);
pstmt.setString(2, amdNo);
System.out.println("Project code is for poamdvalidation....."+ projCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totAmtpoamd = rs.getDouble(1);
System.out.println("totAmtDet for Porderamendment for total@@@@@@@>>>>>>>> "+ totAmtpoamd);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("totAmtDet for Porderamendment for total@@@@@@@>>>>>>>> "+ totAmtpoamd);*/
System.out.println("excedAmt"+ excedAmt);
excedAmt1=String.valueOf(excedAmt);
System.out.println("excedAmt1"+excedAmt1);
System.out.println("totAmtDetPoamdDetbrow"+ totAmtDetPoamdDetbrow);
System.out.println("sumQtyamd"+ sumQtyamd);
if(excedAmt == 0.0 || excedAmt1.contains("-"))
// if(excedAmt >0.0 || excedAmt1.contains("-") || totAmtDetPoamdDetbrow < sumQtyamd )
{
System.out.println("Enter If COndition");
totAmtProj = totAmtDetpordertot-sumQtyamd;
System.out.println("totAmtProj"+totAmtProj);
System.out.println("approxCost"+approxCost);
if (totAmtProj < approxCost)
{
break;
}
}
else
{
System.out.println("totAmtDetPoamdDetbrow >>>>>>>> "+ totAmtDetPoamdDetbrow);
System.out.println("totAmtDetporder >>>>>>>> "+ totAmtDetporder);
System.out.println("tottemp >>>>>>>> "+ tottemp);
System.out.println("totAmtDetpordertot>>>>>>>> "+ totAmtDetpordertot);
//totAmtDetPoamdDetbrow = totAmtDetPoamdDetbrow *exchRatePoAmd;
totAmtProj = totAmtDetPoamdDetbrow + totAmtDetporder+ totAmtDetpordertot;
totAmtProj = totAmtDetpordertot + tottemp;
System.out.println("totAmtProj>>>>> "+ totAmtProj);
if (totAmtProj > approxCost )
System.out.println("@@@@@@@@@@ excedAmtFlag222["+excedAmtFlag+"]");
if (totAmtProj > approxCost)
{
errCode = "VTPROJCOST";
errList.add(errCode);
......@@ -1742,7 +1601,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
}*/
}
}
}
}
else if(ValueType == false)
......@@ -3191,7 +3050,7 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
// +" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtDetpordertot - approxCost).toPlainString();
//if( excedAmt > 0.0)
// {
+" ; Exceeded Amount : "+ BigDecimal.valueOf(excedAmt).toPlainString();
+" ; Exceeded Amount : "+ BigDecimal.valueOf(totAmtProj - approxCost).toPlainString();
// }
System.out.println("Value ::: "+ value);
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