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 ...@@ -483,6 +483,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
boolean ValueType = false, firstNull=true; boolean ValueType = false, firstNull=true;
DistCommon discommon = new DistCommon(); DistCommon discommon = new DistCommon();
double sumQtyamd=0,excedAmt=0; double sumQtyamd=0,excedAmt=0;
double tottemp = 0.0;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
...@@ -668,29 +669,6 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -668,29 +669,6 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
rs3 = null; rs3 = null;
pstmt3.close(); pstmt3.close();
pstmt3 = null; 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 @@@@@@@@@"); System.out.println("@@@@@@@ In @@@@@@@@@");
sql="select sum(a.net_amt * b.exch_rate) from " + sql="select sum(a.net_amt * b.exch_rate) from " +
"porcpdet a, porcp b ,porddet c " + "porcpdet a, porcp b ,porddet c " +
...@@ -774,77 +752,30 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -774,77 +752,30 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
pstmtold.close(); pstmtold.close();
pstmtold = null; 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("ABhi testing add old qty" + totAmtpoamdtempold);
System.out.println("linenoOrdBrow>>>["+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) if((lineNoold == null || "@".equalsIgnoreCase(lineNoold) || "".equalsIgnoreCase(lineNoold) || lineNoold.trim().length()==0 ) && firstNull== true)
{ {
firstNull=false; firstNull=false;
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]+totAmtDetpordertot["+totAmtDetpordertot+"]-approxCost["+approxCost+"]"); System.out.println("totAmtpoamdtemp@@@@@@@@" +totAmtpoamdtemp);
excedAmt += totAmtpoamdtempold + totAmtDetpordertot - approxCost; tottemp+=totAmtpoamdtemp;
System.out.println("totAmtpoamdtemp Null @@@@@" + totAmtpoamdtemp);
} }
else else
{ {
System.out.println("@@@@@@@@@@ excedAmt["+excedAmt+"]sumQtyamd["+sumQtyamd+"]"); System.out.println("totAmtDetPoamdDetbrowtemp else @@@@@@@@" +totAmtpoamdtemp);
excedAmt += totAmtpoamdtempold; System.out.println("sumQtyamd else @@@@@@@@" + sumQtyamd);
} tottemp+= totAmtpoamdtemp - totAmtpoamdtempold;
System.out.println("@@@@@@@@@@ after excedAmt["+excedAmt+"]"); if(tottemp < 0)
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 )
{ {
break; System.out.println(" IF tottemp");
tottemp=0;
} }
System.out.println("tottemp else @@@@@@@@" + tottemp);
else }
{ totAmtPoamd = totAmtDetpordertot + tottemp;
totAmtPoamd = totAmtnotcurr + totAmtDetpordertot + totAmtpoamdtemp; System.out.println("tottemp>>>>.."+tottemp);
System.out.println("totamtpoamd>>>>.."+totAmtPoamd);
System.out.println("totamtpordertot"+totAmtDetpordertot); System.out.println("totamtpordertot"+totAmtDetpordertot);
System.out.println("totamtpoamdtemp"+totAmtpoamdtemp);
System.out.println("totAmtnotcurr>>>>"+totAmtnotcurr);
if(approxCost < totAmtPoamd) if(approxCost < totAmtPoamd)
{ {
System.out.println("In approxcost validation>>"); System.out.println("In approxcost validation>>");
...@@ -869,7 +800,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -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(totAmtPoamd - approxCost).toPlainString();
// +" ; Exceeded Amount : "+ BigDecimal.valueOf(approxCost - totAmtDetpordertot).toPlainString(); // +" ; Exceeded Amount : "+ BigDecimal.valueOf(approxCost - totAmtDetpordertot).toPlainString();
//+" ; Exceeded Amount : "+ BigDecimal.valueOf( totAmtpoamdtempold + totAmtDetpordertot - approxCost).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); System.out.println("Value ::: "+ value);
...@@ -879,7 +810,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -879,7 +810,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
return errCode; return errCode;
} }
}
} }
rs.close(); rs.close();
...@@ -986,7 +917,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -986,7 +917,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
unitRate = rs1.getString("unit__rate"); unitRate = rs1.getString("unit__rate");
dlvDate = rs1.getTimestamp("dlv_date"); dlvDate = rs1.getTimestamp("dlv_date");
locCode = checknull(rs1.getString("loc_code")); locCode = checknull(rs1.getString("loc_code"));
status = checknull(rs1.getString("status")); status = rs1.getString("status");
specificInstr = checknull(rs1.getString("specific_instr")); specificInstr = checknull(rs1.getString("specific_instr"));
suppCodeMnfr = checknull(rs1.getString("supp_code_mnfr")); suppCodeMnfr = checknull(rs1.getString("supp_code_mnfr"));
rateClg = rs1.getDouble("rate__clg"); rateClg = rs1.getDouble("rate__clg");
...@@ -999,6 +930,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd ...@@ -999,6 +930,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
System.out.println("@@@@@@@@ indNo [" + indNo + "]"); System.out.println("@@@@@@@@ indNo [" + indNo + "]");
System.out.println("CLG rate select from poamd_det[" + rateClg + "]"); 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) if (indNo != null && indNo.trim().length() > 0)
{ {
sql = " select quantity__stduom,ord_qty from indent where ind_no = ? "; 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 ...@@ -1089,6 +1024,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
errCode = itmDBAccessLocal.getErrorString("", errCode, ""); errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode; return errCode;
} }
System.out.println("Status is " + status);
sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?," sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?,"
+ " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?," + " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?,"
+ " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?," + " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?,"
......
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