Commit 6db0a23b authored by caluka's avatar caluka

Release amount greater than zero validation added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98350 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c8bf3a06
...@@ -1918,8 +1918,13 @@ public class MilestonePayGen ...@@ -1918,8 +1918,13 @@ public class MilestonePayGen
vocherAmt = Double.parseDouble(vocherAmtStr); vocherAmt = Double.parseDouble(vocherAmtStr);
milestoneAmt = Double.parseDouble(milestoneAmtStr); milestoneAmt = Double.parseDouble(milestoneAmtStr);
differenceAmt=ordAmt-(vocherAmt+milestoneAmt); differenceAmt=ordAmt-(vocherAmt+milestoneAmt);
if(relAmtFinal<=0)
sql = "select ord_amt,tot_amt,tax_amt from porder where purc_order= ? " ; {
result = "RELAMTZERO";
return result;
}else
{
sql = "select ord_amt,tot_amt,tax_amt from porder where purc_order= ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1934,36 +1939,37 @@ public class MilestonePayGen ...@@ -1934,36 +1939,37 @@ public class MilestonePayGen
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("odtAmt :" + odtAmt);
System.out.println("tot_amt :" + totAmt);
System.out.println("taxAmt :" + taxAmt);
System.out.println("amtType ::::" + amtType);
System.out.println("odtAmt :"+odtAmt); if (amtType.equalsIgnoreCase("01")) // % of base
System.out.println("tot_amt :"+totAmt);
System.out.println("taxAmt :"+taxAmt);
System.out.println("amtType ::::"+amtType);
if(amtType.equalsIgnoreCase("01")) // % of base
{ {
calRelAmt=(odtAmt * Double.parseDouble(relAmt))/100; calRelAmt = (odtAmt * Double.parseDouble(relAmt)) / 100;
} } else if (amtType.equalsIgnoreCase("02")) // % of
else if(amtType.equalsIgnoreCase("02")) // % of net // net
{ {
calRelAmt=(totAmt * Double.parseDouble(relAmt))/100; calRelAmt = (totAmt * Double.parseDouble(relAmt)) / 100;
} } else if (amtType.equalsIgnoreCase("03"))// fixed
else if (amtType.equalsIgnoreCase("03"))// fixed amount // amount
{ {
calRelAmt=Double.parseDouble(relAmt); calRelAmt = Double.parseDouble(relAmt);
} } else if (amtType.equalsIgnoreCase("04"))// % of
else if(amtType.equalsIgnoreCase("04"))// % of full tax // full
// tax
{ {
calRelAmt = (totAmt * Double.parseDouble(relAmt))/100 + taxAmt; calRelAmt = (totAmt * Double.parseDouble(relAmt)) / 100 + taxAmt;
} }
System.out.println("calRelAmt>>>>>>"+calRelAmt); System.out.println("calRelAmt>>>>>>" + calRelAmt);
System.out.println("differenceAmt>>>>>>"+differenceAmt); System.out.println("differenceAmt>>>>>>" + differenceAmt);
if(calRelAmt > differenceAmt) if (calRelAmt > differenceAmt)
{ {
result = "RELAMTGRT"; result = "RELAMTGRT";
return result; return result;
} }
} }
}
} }
if(dueDate == null || dueDate.trim().length() == 0 ) if(dueDate == null || dueDate.trim().length() == 0 )
......
...@@ -485,6 +485,11 @@ function getInfo() ...@@ -485,6 +485,11 @@ function getInfo()
alert("Release Amount is greater than Order Amount-(Vocher Amount +Pending Approval)!"); alert("Release Amount is greater than Order Amount-(Vocher Amount +Pending Approval)!");
document.getElementById("Detail2.1.rel_amt").focus(); document.getElementById("Detail2.1.rel_amt").focus();
} }
if(tet == "RELAMTZERO")
{
alert("Release Amount should be greater than zero!");
document.getElementById("Detail2.1.rel_amt").focus();
}
if(tet == "LINEPREV") if(tet == "LINEPREV")
{ {
alert("Please input numeric characters only !"); alert("Please input numeric characters only !");
......
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