Commit 76ef81fe authored by vkadam's avatar vkadam

Validation of ref_no, check record in receipt for cust code, ref no, ref date...

Validation of ref_no, check record in receipt for cust code, ref no, ref date and not equal to current tran id.
If record found for above combination check in rcpdishnr for same respective receipt id.
No record found in rcpdishnr error as Duplicate UTR_NO.
The record found in rcpdishnr but unconfirmed error Duplicate UTR_NO.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98619 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c04559d3
...@@ -86,7 +86,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -86,7 +86,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
Node childNode = null; Node childNode = null;
String childNodeName = null; String childNodeName = null;
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
String tranId = ""; String tranId = "",tranIdRcp="";
String custCode = ""; String custCode = "";
String siteCode = ""; String siteCode = "";
String finEntity = ""; String finEntity = "";
...@@ -131,6 +131,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -131,6 +131,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
String refDateS = "" ; String refDateS = "" ;
String dueDateS = ""; String dueDateS = "";
String siteSpecificBank = ""; String siteSpecificBank = "";
String rDshCnf="";
String taxClass = "",taxEnv = "",taxChap;//added by akhilesh on 31/july/13 for tax provision String taxClass = "",taxEnv = "",taxChap;//added by akhilesh on 31/july/13 for tax provision
double diffAmtExch = 0.0D; double diffAmtExch = 0.0D;
double exchRate = 0.0D; double exchRate = 0.0D;
...@@ -146,6 +147,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -146,6 +147,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
double totAmt = 0.0D; double totAmt = 0.0D;
double pendingAmt = 0.0D; double pendingAmt = 0.0D;
double adjAmt = 0.0D; double adjAmt = 0.0D;
Timestamp rfDate=null;
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
...@@ -853,6 +855,115 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -853,6 +855,115 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
} }
/**
* VALLABH KADAM [01/OCT/15]
* */
else if(childNodeName.equalsIgnoreCase("ref_no"))
{
/**
* Select tran_id from table RECEIPT
* for cust_code= customer code
* ref_no= ref no, ref_date= ref date
* tran_id <> current tran id
* */
String rDt = checkNull(this.genericUtility.getColumnValue("ref_date", dom));
rfDate = Timestamp.valueOf(genericUtility.getValidDateString(rDt.trim(),genericUtility.getApplDateFormat(),
genericUtility.getDBDateFormat())+ " 00:00:00.0");
refNo = checkNull(this.genericUtility.getColumnValue("ref_no", dom));
custCode = checkNull(this.genericUtility.getColumnValue("cust_code", dom));
tranId = checkNull(this.genericUtility.getColumnValue("tran_id", dom));
sql = "select tran_id from receipt where cust_code=? and ref_no=? and ref_date=? and tran_id <> ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, refNo);
pstmt.setTimestamp(3, rfDate);
pstmt.setString(4, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
tranIdRcp=checkNull(rs.getString("tran_id"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@V@ Tran id receipt :- ["+tranIdRcp+"]");
if (tranIdRcp != null && tranIdRcp.trim().length()>0)
{
/**
* Existing receipt found
* for above combination
* check the record from table rcpdishnr
* where receipt_no=tranIdRcp
* */
sql = "select count(*) as cnt from rcpdishnr where receipt_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt=rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@V@ Dishponer cnt :- ["+cnt+"]");
if(cnt==0)
{
/**
* Unconfirmed record found
* ERROR (Duplicate utr_no found)
* */
errCode = "VTUTRDUPL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
/**
* Record found in table rcpdishnr
* then check for confirmed status 'N'
* */
sql = "select confirmed from rcpdishnr where receipt_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
rDshCnf=checkNull(rs.getString("confirmed"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@V@ confirmed found :-["+rDshCnf+"]");
if("N".equalsIgnoreCase(rDshCnf))
{
/**
* Unconfirmed record found
* ERROR (Duplicate utr_no found)
* */
errCode = "VTUTRDUPL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
/**
* VALLABH KADAM [01/OCT/15]
* END
* */
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
...@@ -1825,7 +1936,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -1825,7 +1936,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
System.out.println("errCode :"+errCode); System.out.println("errCode :"+errCode);
int pos = errCode.indexOf("~"); int pos = errCode.indexOf("~");
System.out.println("pos :"+pos); System.out.println("pos :"+pos);
if(pos>-1)
{
errCode=errCode.substring(0,pos); errCode=errCode.substring(0,pos);
}
System.out.println("error code is :"+errCode); System.out.println("error code is :"+errCode);
errFldName = (String)errFields.get(cnt); errFldName = (String)errFields.get(cnt);
System.out.println(" cnt [" + cnt + "] errCode [" + errCode + "] errFldName [" + errFldName + "]"); System.out.println(" cnt [" + cnt + "] errCode [" + errCode + "] errFldName [" + errFldName + "]");
......
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