Commit dfc804f9 authored by mjadhav's avatar mjadhav

validation for receipt amt and receivable amt


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97573 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4d6c84f3
......@@ -119,7 +119,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
//String custrefNo="";
int countCustRef=0,refSerCnt=0;
int childNodeListLength=0;
double rcpAmt=0.0,chqAmt=0.0;
double rcpAmt=0.0,chqAmt=0.0,rcpAmtVal=0.0;
boolean isValidcustRef=false;
ArrayList<String> refNoList = new ArrayList<String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
......@@ -360,7 +360,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
{
refSerCnt = rs1.getInt(1);
}
rs1.close(); // added By akhilesh on 10/01/13 to close the statement
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
......@@ -495,6 +495,33 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
System.out.println("ref_ser :"+genericUtility.getColumnValue("ref_ser",domAll));
System.out.println("ref_no :"+genericUtility.getColumnValue("ref_no",domAll));
System.out.println("custCode :"+genericUtility.getColumnValue("cust_code", dom1));
sql = "SELECT (TOT_AMT - ADJ_AMT) AS AMT FROM RECEIVABLES WHERE TRAN_SER = ? AND REF_NO = ? AND cust_code = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_ser",domAll)));
pstmt.setString(2,checkNull(genericUtility.getColumnValue("ref_no",domAll)));
pstmt.setString(3,checkNull(genericUtility.getColumnValue("cust_code",dom1)));
rs = pstmt.executeQuery();
if( rs.next())
{
rcpAmtVal=rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("rcpAmtVal>>>["+rcpAmtVal+"]rcpAmt["+rcpAmt+"]");
if(rcpAmtVal < rcpAmt)
{
errCode = "VTINVTLAMT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
......@@ -1524,6 +1551,105 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
//checkAccValidation
/*--------------------------------------------------------------------------------------*/
/* public boolean checkAccValidation(Connection conn) throws ITMException
{
boolean flag=false;
NodeList parentList = null;
NodeList childList = null;
Node parentNode = null;
Document domTest = null;
int detailsLen=0;
PreparedStatement pstmt = null;
ResultSet rSet = null;
double rcpAmt=0.0,chqAmt=0.0,totRcpAmt=0.0;
String updateFlag="",refNo="",refSer="",sql="";
try
{
System.out.println("========checkAccValidation========");
domTest = parseString(allXmlDataStr1);
detailsLen=domTest.getElementsByTagName("Detail2").getLength();
System.out.println("detailsLen "+detailsLen);
for(int i=0 ; i<detailsLen ; i++)
{
updateFlag = getCurrentUpdateFlag(domTest.getElementsByTagName("Detail2").item(i));
System.out.println("updateFlag :"+updateFlag+" i :"+i);
refNo=e12GenericUtility.getColumnValueFromNode("ref_no", domTest.getElementsByTagName("Detail2").item(i));
System.out.println("refNo :"+refNo);
refSer=e12GenericUtility.getColumnValueFromNode("ref_ser", domTest.getElementsByTagName("Detail2").item(i));
System.out.println("refSer :"+refSer);
refSer=e12GenericUtility.getColumnValueFromNode("line_no_ref", domTest.getElementsByTagName("Detail2").item(i));
System.out.println("refSer :"+refSer);
sql ="select (tot_amt - adj_amt) as amt , tran_ser,tran_date,ref_no,ref_date,curr_code,exch_rate,acct_code, cctr_code,due_date,tax_amt,tot_amt,cust_code,adj_amt, case when bad_debt_amt is null then 0 else bad_debt_amt end,discount_dt,DISCOUNT from receivables "
+ " where tran_ser = ? and ref_no = ? and line_no__ref = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(refSer));
pstmt.setString(2,checkNull(refNo));
pstmt.setString(3,checkNull());
rSet = pstmt.executeQuery();
if (rSet.next())
{
rcpAmt=rSet.getDouble(1);
isFound=true;
}
rSet.close();
rSet=null;
pstmt.close();
pstmt=null;
rcpAmt= Double.parseDouble(e12GenericUtility.getColumnValueFromNode("rcp_amt", domTest.getElementsByTagName("Detail2").item(i)));
System.out.println("rcpAmt :"+rcpAmt);
if("D".equalsIgnoreCase(updateFlag))
{
totRcpAmt=totRcpAmt-rcpAmt;
}
else
{
totRcpAmt = totRcpAmt + rcpAmt;
}
}
System.out.println("totRcpAmt :"+totRcpAmt);
if(chqAmt < totRcpAmt)
{
flag=true;
}
}
catch(Exception e)
{
e.printStackTrace();
}
return flag;
}*/
/*---------------------------------------------------------------------------------------*/
public boolean checkAmtvalidation(Document dom1) throws ITMException
{
......
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