Commit f19b4ba3 authored by mmhatre's avatar mmhatre

misc voucher validation to be added that the advance being adjusted should not have future ref_date

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204376 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b51ff9ec
...@@ -148,6 +148,8 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -148,6 +148,8 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
double adjAmt1 = 0.0; double adjAmt1 = 0.0;
double Amount = 0.0; double Amount = 0.0;
double totAmt = 0.0; double totAmt = 0.0;
Timestamp refDate=null;
Timestamp today=null;
java.util.Date tranPdate = null; java.util.Date tranPdate = null;
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
...@@ -170,6 +172,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -170,6 +172,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
//End //End
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
SimpleDateFormat dbDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat dbDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
today = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if(objContext != null && objContext.trim().length() > 0) if(objContext != null && objContext.trim().length() > 0)
{ {
...@@ -1509,7 +1515,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1509,7 +1515,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
siteCode1 = rs.getString(3); siteCode1 = rs.getString(3);
currCode1 = rs.getString(4); currCode1 = rs.getString(4);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//added by deepak sawant //added by deepak sawant
System.out.println("new site code added by deep"); System.out.println("new site code added by deep");
...@@ -1595,11 +1604,34 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1595,11 +1604,34 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
//added by deepak sawant //added by deepak sawant
//added by manish mhatre on 24/july/2019[validation for misc voucher]
rs.close(); //start manish
rs = null; System.out.println("RefDate Validation::refNo["+refNo+"]refSer["+refSer+"]");
pstmt.close(); if("M-ADV".equals(refSer.trim())|| "P-ADV".equals(refSer.trim()))
pstmt = null; {
sql = "SELECT ref_date FROM misc_payables WHERE tran_ser = ? and ref_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,refSer);
pstmt1.setString(2,refNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refDate = rs1.getTimestamp(1);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
System.out.println("1625 ValidationrefDate["+refDate+"]today["+today+"]");
if(refDate.after(today))
{
System.out.println("Inside after method");
errCode = "VTPRDFDALW";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//end manish
} }
if(errCode != null && (errCode.trim().length() > 0)) if(errCode != null && (errCode.trim().length() > 0))
{ {
......
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