Commit 2759559c authored by msalla's avatar msalla

1)In bank receipt screen under EPC adjustment screen (4th screen) client want...

1)In bank receipt screen under EPC adjustment screen (4th screen) client want to set the POPHELP on reference number field. but we can not set the pophelp on this field because ref_ser and ref_no field is common in EPC adjustment and Invoice Detail screen (2nd screen).

2)When user select Receipt Mode as Electronic and further select customer then system change Receipt Mode as CHQ because in customer master, default payment mode is Chq. Then user again has to change the Mode or if he forget to change the same, wrong entry is getting passed. To avoid the mistake, Receipt Mode column should appear after the  Customer column. 

3)Bank receipt, ref_no column in packing credit/adv booking to be changed

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204476 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fdc08e61
...@@ -39,42 +39,37 @@ import ibase.webitm.utility.ITMException; ...@@ -39,42 +39,37 @@ import ibase.webitm.utility.ITMException;
public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, MiscVoucherICRemote public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, MiscVoucherICRemote
{ {
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
// GenericUtility genericUtility = GenericUtility.getInstance(); // GenericUtility genericUtility = GenericUtility.getInstance();
String winName = null; String winName = null;
FinCommon finCommon = null; FinCommon finCommon = null;
ValidatorEJB validator = null; ValidatorEJB validator = null;
// method for validation
//method for validation public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag,
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException String xtraParams) throws RemoteException, ITMException {
{
String errString = ""; String errString = "";
Document dom = null; Document dom = null;
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
try try {
{
System.out.println("Val xmlString :: " + xmlString); System.out.println("Val xmlString :: " + xmlString);
System.out.println("Val xmlString1 :: " + xmlString1); System.out.println("Val xmlString1 :: " + xmlString1);
System.out.println("Val xmlString2 :: " + xmlString2 ); System.out.println("Val xmlString2 :: " + xmlString2);
dom = parseString(xmlString); dom = parseString(xmlString);
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 ) if (xmlString2.trim().length() > 0) {
{ dom2 = parseString("<Root>" + xmlString2 + "</Root>");
dom2 = parseString("<Root>" + xmlString2+ "</Root>");
} }
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams); errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
} } catch (Exception e) {
catch(Exception e)
{
throw new ITMException(e); throw new ITMException(e);
} }
return(errString); return (errString);
} }
//method for validation // method for validation
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag,
{ String xtraParams) throws RemoteException, ITMException {
NodeList parentNodeList = null; NodeList parentNodeList = null;
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
...@@ -118,7 +113,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -118,7 +113,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
String acctCodeAp = ""; String acctCodeAp = "";
String acctCodePay = ""; String acctCodePay = "";
String cctrCodeAp = ""; String cctrCodeAp = "";
String cctrCodePay = ""; //added by manish mhatre on 16/july/2019 String cctrCodePay = ""; // added by manish mhatre on 16/july/2019
String acctCodeCf = ""; String acctCodeCf = "";
String cctrCodeCf = ""; String cctrCodeCf = "";
String acctCodeAdv = ""; String acctCodeAdv = "";
...@@ -134,12 +129,12 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -134,12 +129,12 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
String analCode = ""; String analCode = "";
String analCode1 = ""; String analCode1 = "";
String analCode2 = ""; String analCode2 = "";
String sundryTypeFor =""; String sundryTypeFor = "";
String sundryCodeFor =""; String sundryCodeFor = "";
String lineNo = ""; String lineNo = "";
String acctSpec = ""; String acctSpec = "";
String saveflag = "2"; String saveflag = "2";
int ctr=0; int ctr = 0;
int cnt = 0; int cnt = 0;
int currentFormNo = 0; int currentFormNo = 0;
int childNodeListLength; int childNodeListLength;
...@@ -148,94 +143,82 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -148,94 +143,82 @@ 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 refDate = null;
Timestamp today=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>();
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null ; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
PreparedStatement pstmt1 = null ; PreparedStatement pstmt1 = null;
ResultSet rs1 = null; ResultSet rs1 = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
String tranType = ""; //Added by sarita on 06APR2018 String tranType = ""; // Added by sarita on 06APR2018
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try try {
{
finCommon = new FinCommon(); finCommon = new FinCommon();
validator = new ValidatorEJB(); validator = new ValidatorEJB();
//DriverITM changes to getConnction() by Pavan R // DriverITM changes to getConnction() by Pavan R
//conn = connDriver.getConnectDB("DriverITM"); // conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//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()); SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
today = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0"); today = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");//added by manish mhatre on 26-july-2019
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if(objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0) {
{
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
switch(currentFormNo) switch (currentFormNo) {
{ case 1:
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr ++) for (ctr = 0; ctr < childNodeListLength; ctr++) {
{
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("tran_type")) if (childNodeName.equalsIgnoreCase("tran_type")) {
{
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
} }
else if(childNodeName.equalsIgnoreCase("tran_date")) else if (childNodeName.equalsIgnoreCase("tran_date")) {
{
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
tranDate = genericUtility.getColumnValue("tran_date", dom); tranDate = genericUtility.getColumnValue("tran_date", dom);
try try {
{
tranPdate = simpleDateFormat.parse(tranDate); tranPdate = simpleDateFormat.parse(tranDate);
//Changes and Commented By Ajay on 21-12-2017:START // Changes and Commented By Ajay on 21-12-2017:START
//errCode = validator.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode); // errCode = validator.nfCheckPeriod("FIN",new
errCode=finCommon.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode, conn); // java.util.Date(tranPdate.getTime()),siteCode);
//Changes and Commented By Ajay on 21-12-2017:END errCode = finCommon.nfCheckPeriod("FIN", new java.util.Date(tranPdate.getTime()), siteCode,
} conn);
catch (ParseException e) // Changes and Commented By Ajay on 21-12-2017:END
{ } catch (ParseException e) {
System.out.println("Exception in transaction date [tran_date_validation]"+e); System.out.println("Exception in transaction date [tran_date_validation]" + e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
if(errCode != null && errCode.trim().length() > 0) if (errCode != null && errCode.trim().length() > 0) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("sundry_type")) else if (childNodeName.equalsIgnoreCase("sundry_type")) {
{
sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom)); sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom));
if(sundryType != null && sundryType.trim().length() > 0) if (sundryType != null && sundryType.trim().length() > 0) {
{
sql = "SELECT COUNT(*) FROM SUNDRY_TYPE WHERE SUNDRY_TYPE = ?"; sql = "SELECT COUNT(*) FROM SUNDRY_TYPE WHERE SUNDRY_TYPE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryType); pstmt.setString(1, sundryType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VTSUND4"; errCode = "VTSUND4";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -248,31 +231,27 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -248,31 +231,27 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("sundry_code")) else if (childNodeName.equalsIgnoreCase("sundry_code")) {
{
sundryCode = checkNull(genericUtility.getColumnValue("sundry_code", dom)); sundryCode = checkNull(genericUtility.getColumnValue("sundry_code", dom));
sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom)); sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom));
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
if(sundryCode != null && sundryType != null && siteCode != null && sundryCode.trim().length() > 0 && sundryType.trim().length() > 0 && siteCode.trim().length() > 0) if (sundryCode != null && sundryType != null && siteCode != null
{ && sundryCode.trim().length() > 0 && sundryType.trim().length() > 0
&& siteCode.trim().length() > 0) {
errCode = finCommon.isSundryCode(siteCode, sundryType, sundryCode, "", conn); errCode = finCommon.isSundryCode(siteCode, sundryType, sundryCode, "", conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if ((errCode == null || (errCode.trim().length() == 0)) && "R".equalsIgnoreCase( sundryType)) if ((errCode == null || (errCode.trim().length() == 0)) && "R".equalsIgnoreCase(sundryType)) {
{
sql = " select status from strg_customer where sc_code = ? "; sql = " select status from strg_customer where sc_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode); pstmt.setString(1, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
stat = rs.getString(1); stat = rs.getString(1);
if(!"A".equalsIgnoreCase( stat )) if (!"A".equalsIgnoreCase(stat)) {
{
errCode = "VTSTRSTAT"; errCode = "VTSTRSTAT";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -282,32 +261,25 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -282,32 +261,25 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} } else if ((errCode == null || (errCode.trim().length() == 0))
else if ((errCode == null || (errCode.trim().length() == 0)) && "E".equalsIgnoreCase( sundryType)) && "E".equalsIgnoreCase(sundryType)) {
{
sql1 = "SELECT emp_site FROM employee WHERE emp_code = ? "; sql1 = "SELECT emp_site FROM employee WHERE emp_code = ? ";
pstmt = conn.prepareStatement(sql1); pstmt = conn.prepareStatement(sql1);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next()) {
{
site = rs.getString(1); site = rs.getString(1);
if("M-VOUC".equalsIgnoreCase(refSer)) if ("M-VOUC".equalsIgnoreCase(refSer)) {
{
sql2 = "SELECT fin_entity FROM site WHERE site_code = ?"; sql2 = "SELECT fin_entity FROM site WHERE site_code = ?";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql2); /*
pstmt.setString(1,siteCode); * pstmt = conn.prepareStatement(sql2); pstmt.setString(1,siteCode); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); if (rs.next()) { finEntity1 = rs.getString(1); }
if (rs.next()) */
{
finEntity1 = rs.getString(1);
}*/
pstmt1 = conn.prepareStatement(sql2); pstmt1 = conn.prepareStatement(sql2);
pstmt1.setString(1,siteCode); pstmt1.setString(1, siteCode);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next()) {
{
finEntity1 = rs1.getString(1); finEntity1 = rs1.getString(1);
} }
rs1.close(); rs1.close();
...@@ -316,65 +288,50 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -316,65 +288,50 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt1 = null; pstmt1 = null;
sql3 = "SELECT fin_entity FROM site WHERE site_code = ?"; sql3 = "SELECT fin_entity FROM site WHERE site_code = ?";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/* /*
pstmt = conn.prepareStatement(sql3); * pstmt = conn.prepareStatement(sql3); pstmt.setString(1,site); rs =
pstmt.setString(1,site); * pstmt.executeQuery(); if (rs.next()) { finEntity2 = rs.getString(1); }
rs = pstmt.executeQuery();
if (rs.next())
{
finEntity2 = rs.getString(1);
}
*/ */
pstmt1 = conn.prepareStatement(sql3); pstmt1 = conn.prepareStatement(sql3);
pstmt1.setString(1,site); pstmt1.setString(1, site);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next()) {
{
finEntity2 = rs1.getString(1); finEntity2 = rs1.getString(1);
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if(!finEntity2.equalsIgnoreCase(finEntity1)) if (!finEntity2.equalsIgnoreCase(finEntity1)) {
{
errCode = "VTEMPSITE"; errCode = "VTEMPSITE";
} }
} } else if (sundryCode != null && siteCode != null && sundryCode.trim().length() > 0
else if(sundryCode != null && siteCode != null && sundryCode.trim().length() > 0 && siteCode.trim().length() > 0) && siteCode.trim().length() > 0) {
{ errCode = finCommon.isEmployee(siteCode, sundryCode, "", conn);
errCode = finCommon.isEmployee(siteCode, sundryCode, "" , conn); } else if (site != null && siteCode != null
} && !site.trim().equalsIgnoreCase(siteCode.trim())) {
else if(site != null && siteCode != null && !site.trim().equalsIgnoreCase(siteCode.trim()))
{
errCode = "VTEMPSITE"; errCode = "VTEMPSITE";
} }
} }
if (errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{
tranDate = genericUtility.getColumnValue("tran_date", dom); tranDate = genericUtility.getColumnValue("tran_date", dom);
sql = " select pay_site from employee where emp_code = ? "; sql = " select pay_site from employee where emp_code = ? ";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql); /*
pstmt.setString(1,sundryCode); * pstmt = conn.prepareStatement(sql); pstmt.setString(1,sundryCode); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); if(rs.next()) { stat = rs.getString(1);
if(rs.next())
{
stat = rs.getString(1);
*/ */
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,sundryCode); pstmt1.setString(1, sundryCode);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if (rs1.next()) {
{
stat = rs1.getString(1); stat = rs1.getString(1);
if(siteCode != null && sundryCode != null && siteCode.trim().length() > 0 && sundryCode.trim().length() > 0) if (siteCode != null && sundryCode != null && siteCode.trim().length() > 0
{ && sundryCode.trim().length() > 0) {
errCode = finCommon.isEmployee(siteCode, sundryCode, "" , conn); errCode = finCommon.isEmployee(siteCode, sundryCode, "", conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -395,46 +352,38 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -395,46 +352,38 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
else if(childNodeName.equalsIgnoreCase("sundry_code__pay")) else if (childNodeName.equalsIgnoreCase("sundry_code__pay")) {
{
sundryCodePay = checkNull(genericUtility.getColumnValue("sundry_code__pay", dom)); sundryCodePay = checkNull(genericUtility.getColumnValue("sundry_code__pay", dom));
sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom); sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom);
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
//refSer = genericUtility.getColumnValue("ref_ser", dom); // refSer = genericUtility.getColumnValue("ref_ser", dom);
if(sundryCodePay != null && sundryTypePay != null && sundryCodePay.trim().length() > 0 && sundryTypePay.trim().length() > 0) if (sundryCodePay != null && sundryTypePay != null && sundryCodePay.trim().length() > 0
{ && sundryTypePay.trim().length() > 0) {
errCode = finCommon.isSundryCode(siteCode, sundryTypePay, sundryCodePay, "", conn); errCode = finCommon.isSundryCode(siteCode, sundryTypePay, sundryCodePay, "", conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if ((errCode == null || (errCode.trim().length() == 0)) && "E".equalsIgnoreCase( sundryTypePay)) if ((errCode == null || (errCode.trim().length() == 0))
{ && "E".equalsIgnoreCase(sundryTypePay)) {
sql1 = "SELECT emp_site FROM employee WHERE emp_code = ?"; sql1 = "SELECT emp_site FROM employee WHERE emp_code = ?";
pstmt = conn.prepareStatement(sql1); pstmt = conn.prepareStatement(sql1);
pstmt.setString(1,sundryCodePay); pstmt.setString(1, sundryCodePay);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next()) {
{
site = rs.getString(1); site = rs.getString(1);
if("M-VOUC".equalsIgnoreCase(refSer)) if ("M-VOUC".equalsIgnoreCase(refSer)) {
{
sql2 = "SELECT fin_entity FROM site WHERE site_code = ?"; sql2 = "SELECT fin_entity FROM site WHERE site_code = ?";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql2); /*
pstmt.setString(1,siteCode); * pstmt = conn.prepareStatement(sql2); pstmt.setString(1,siteCode); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); if (rs.next()) { finEntity1 = rs.getString(1); }
if (rs.next()) */
{
finEntity1 = rs.getString(1);
}*/
pstmt1 = conn.prepareStatement(sql2); pstmt1 = conn.prepareStatement(sql2);
pstmt1.setString(1,siteCode); pstmt1.setString(1, siteCode);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next()) {
{
finEntity1 = rs1.getString(1); finEntity1 = rs1.getString(1);
} }
rs1.close(); rs1.close();
...@@ -443,40 +392,32 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -443,40 +392,32 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt1 = null; pstmt1 = null;
sql3 = "SELECT fin_entity FROM site WHERE site_code = ?"; sql3 = "SELECT fin_entity FROM site WHERE site_code = ?";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql3); /*
pstmt.setString(1,site); * pstmt = conn.prepareStatement(sql3); pstmt.setString(1,site); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); if (rs.next()) { finEntity2 = rs.getString(1); }
if (rs.next()) */
{
finEntity2 = rs.getString(1);
}*/
pstmt1 = conn.prepareStatement(sql3); pstmt1 = conn.prepareStatement(sql3);
pstmt1.setString(1,site); pstmt1.setString(1, site);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next()) {
{
finEntity2 = rs1.getString(1); finEntity2 = rs1.getString(1);
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if(!finEntity2.equalsIgnoreCase(finEntity1)) if (!finEntity2.equalsIgnoreCase(finEntity1)) {
{
errCode = "VTEMPSITE"; errCode = "VTEMPSITE";
} }
} } else if (siteCode != null && sundryCodePay != null && siteCode.trim().length() > 0
else if(siteCode != null && sundryCodePay != null && siteCode.trim().length() > 0 && sundryCodePay.trim().length() > 0) && sundryCodePay.trim().length() > 0) {
{ errCode = finCommon.isEmployee(siteCode, sundryCodePay, "", conn);
errCode = finCommon.isEmployee(siteCode, sundryCodePay, "" , conn); } else if (site != null && siteCode != null
} && !site.trim().equalsIgnoreCase(siteCode.trim())) {
else if(site != null && siteCode != null && !site.trim().equalsIgnoreCase(siteCode.trim()))
{
errCode = "VTEMPSITE"; errCode = "VTEMPSITE";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -490,72 +431,58 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -490,72 +431,58 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
else if(childNodeName.equalsIgnoreCase("order_ref")) else if (childNodeName.equalsIgnoreCase("order_ref")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
orderRef = checkNull(genericUtility.getColumnValue("order_ref", dom)); orderRef = checkNull(genericUtility.getColumnValue("order_ref", dom));
//Added and Commented by sarita on 06APR2018 for Distribution Expense Voucher[start] // Added and Commented by sarita on 06APR2018 for Distribution Expense
// Voucher[start]
tranType = checkNull(genericUtility.getColumnValue("tran_type", dom)); tranType = checkNull(genericUtility.getColumnValue("tran_type", dom));
System.out.println("Tran Type is == ["+tranType+"]"); System.out.println("Tran Type is == [" + tranType + "]");
if("FRT".equalsIgnoreCase(tranType) == false) if ("FRT".equalsIgnoreCase(tranType) == false) {
{ if (orderRef != null && orderRef.trim().length() > 0) {
if(orderRef != null && orderRef.trim().length() > 0)
{
sql = " select count(tran_id) from srv_order where tran_id = ? and confirmed = 'Y' "; sql = " select count(tran_id) from srv_order where tran_id = ? and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,orderRef); pstmt.setString(1, orderRef);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
sql = " select count(purc_order) from porder where purc_order = ? and confirmed = 'Y' "; sql = " select count(purc_order) from porder where purc_order = ? and confirmed = 'Y' ";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql); /*
pstmt.setString(1,orderRef); * pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderRef); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); while(rs.next()) { cnt = rs.getInt(1); }
while(rs.next()) */
{
cnt = rs.getInt(1);
}*/
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,orderRef); pstmt1.setString(1, orderRef);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
while(rs1.next()) while (rs1.next()) {
{
cnt = rs1.getInt(1); cnt = rs1.getInt(1);
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if(cnt == 0) if (cnt == 0) {
{
sql = " select count(contract_id) from retainer_contract where contract_id = ? and status = 'A' "; sql = " select count(contract_id) from retainer_contract where contract_id = ? and status = 'A' ";
//Added by Varsha V for closing resultset on 19-04-2018 // Added by Varsha V for closing resultset on 19-04-2018
/*pstmt = conn.prepareStatement(sql); /*
pstmt.setString(1,orderRef); * pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderRef); rs =
rs = pstmt.executeQuery(); * pstmt.executeQuery(); while(rs.next()) { cnt = rs.getInt(1); }
while(rs.next()) */
{
cnt = rs.getInt(1);
}*/
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,orderRef); pstmt1.setString(1, orderRef);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
while(rs1.next()) while (rs1.next()) {
{
cnt = rs1.getInt(1); cnt = rs1.getInt(1);
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if(cnt == 0) if (cnt == 0) {
{
errCode = "VTSRV"; errCode = "VTSRV";
} }
...@@ -568,104 +495,76 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -568,104 +495,76 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt = null; pstmt = null;
} }
} }
/*if(orderRef != null && orderRef.trim().length() > 0) /*
{ * if(orderRef != null && orderRef.trim().length() > 0) { sql =
sql = " select count(tran_id) from srv_order where tran_id = ? and confirmed = 'Y' "; * " select count(tran_id) from srv_order where tran_id = ? and confirmed = 'Y' "
pstmt = conn.prepareStatement(sql); * ; pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderRef); rs =
pstmt.setString(1,orderRef); * pstmt.executeQuery(); while(rs.next()) { cnt = rs.getInt(1); } if(cnt == 0) {
rs = pstmt.executeQuery(); * sql =
while(rs.next()) * " select count(purc_order) from porder where purc_order = ? and confirmed = 'Y' "
{ * ; pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderRef); rs =
cnt = rs.getInt(1); * pstmt.executeQuery(); while(rs.next()) { cnt = rs.getInt(1); } if(cnt == 0) {
} * sql =
if(cnt == 0) * " select count(contract_id) from retainer_contract where contract_id = ? and status = 'A' "
{ * ; pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderRef); rs =
sql = " select count(purc_order) from porder where purc_order = ? and confirmed = 'Y' "; * pstmt.executeQuery(); while(rs.next()) { cnt = rs.getInt(1); } if(cnt == 0) {
pstmt = conn.prepareStatement(sql); * errCode = "VTSRV"; }
pstmt.setString(1,orderRef); *
rs = pstmt.executeQuery(); * }
while(rs.next()) *
{ * } rs.close(); rs = null; pstmt.close(); pstmt = null; }
cnt = rs.getInt(1); */
} // Added and Commented by sarita on 06APR2018 Distribution Expense Voucher[end]
if(cnt == 0) if (errCode != null && (errCode.trim().length() > 0)) {
{
sql = " select count(contract_id) from retainer_contract where contract_id = ? and status = 'A' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,orderRef);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt = rs.getInt(1);
}
if(cnt == 0)
{
errCode = "VTSRV";
}
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}*/
//Added and Commented by sarita on 06APR2018 Distribution Expense Voucher[end]
if(errCode != null && (errCode.trim().length() > 0))
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("bill_date")) else if (childNodeName.equalsIgnoreCase("bill_date")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
billNo = checkNull(genericUtility.getColumnValue("bill_no", dom)); billNo = checkNull(genericUtility.getColumnValue("bill_no", dom));
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
if(billNo!= null && (billNo.trim().length() > 0 )) if (billNo != null && (billNo.trim().length() > 0)) {
{
billDate = checkNull(genericUtility.getColumnValue("bill_date", dom)); billDate = checkNull(genericUtility.getColumnValue("bill_date", dom));
sundryType = genericUtility.getColumnValue("sundry_type", dom); sundryType = genericUtility.getColumnValue("sundry_type", dom);
sundryCode = genericUtility.getColumnValue("sundry_code", dom); sundryCode = genericUtility.getColumnValue("sundry_code", dom);
tranId = genericUtility.getColumnValue("tran_id", dom); tranId = genericUtility.getColumnValue("tran_id", dom);
if(tranId == null) if (tranId == null) {
{ // Modified by Anjali R. on [08/02/2019][Record not found if tran_id set as
//Modified by Anjali R. on [08/02/2019][Record not found if tran_id set as empty][Start] // empty][Start]
//tranId = ""; // tranId = "";
tranId = "*"; tranId = "*";
//Modified by Anjali R. on [08/02/2019][Record not found if tran_id set as empty][End] // Modified by Anjali R. on [08/02/2019][Record not found if tran_id set as
// empty][End]
} }
if(billDate != null && billDate.trim().length() > 0) if (billDate != null && billDate.trim().length() > 0) {
{
sql = "SELECT COUNT(*) FROM voucher WHERE supp_code = ? and bill_no = ? and bill_date = ? and tran_id != ?"; sql = "SELECT COUNT(*) FROM voucher WHERE supp_code = ? and bill_no = ? and bill_date = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
pstmt.setString(2,billNo); pstmt.setString(2, billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0")); pstmt.setTimestamp(3,
pstmt.setString(4,tranId); Timestamp.valueOf(
dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()
+ " 00:00:00.0"));
pstmt.setString(4, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} } else {
else
{
sql = "SELECT COUNT(*) FROM voucher WHERE supp_code = ? and bill_no = ? and tran_id != ?"; sql = "SELECT COUNT(*) FROM voucher WHERE supp_code = ? and bill_no = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
pstmt.setString(2,billNo); pstmt.setString(2, billNo);
pstmt.setString(3,tranId); pstmt.setString(3, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -674,38 +573,35 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -674,38 +573,35 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt = null; pstmt = null;
} }
} }
if(cnt == 0) if (cnt == 0) {
{ if (billDate != null && billDate.trim().length() > 0) {
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and bill_date = ? and sundry_type = ? and tran_id != ?"; sql = "SELECT COUNT(*) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and bill_date = ? and sundry_type = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
pstmt.setString(2,billNo); pstmt.setString(2, billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0")); pstmt.setTimestamp(3,
pstmt.setString(4,sundryType); Timestamp.valueOf(
pstmt.setString(5,tranId); dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()
+ " 00:00:00.0"));
pstmt.setString(4, sundryType);
pstmt.setString(5, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} } else {
else
{
sql = "SELECT COUNT(*) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and sundry_type = ? and tran_id != ?"; sql = "SELECT COUNT(*) FROM misc_voucher WHERE sundry_code = ? and bill_no = ? and sundry_type = ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
pstmt.setString(2,billNo); pstmt.setString(2, billNo);
pstmt.setString(3,sundryType); pstmt.setString(3, sundryType);
pstmt.setString(4,tranId); pstmt.setString(4, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -713,38 +609,35 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -713,38 +609,35 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(cnt == 0) if (cnt == 0) {
{ if (billDate != null && billDate.trim().length() > 0) {
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(1) FROM misc_vouchdet WHERE bill_no = ? and bill_date = ? and sundry_code__for = ? and sundry_type__for= ? and tran_id != ?"; sql = "SELECT COUNT(1) FROM misc_vouchdet WHERE bill_no = ? and bill_date = ? and sundry_code__for = ? and sundry_type__for= ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,billNo); pstmt.setString(1, billNo);
pstmt.setTimestamp(2,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0")); pstmt.setTimestamp(2,
pstmt.setString(3,sundryCode); Timestamp.valueOf(
pstmt.setString(4,sundryType); dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()
pstmt.setString(5,tranId); + " 00:00:00.0"));
pstmt.setString(3, sundryCode);
pstmt.setString(4, sundryType);
pstmt.setString(5, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} } else {
else
{
sql = "SELECT COUNT(1) FROM misc_vouchdet WHERE bill_no = ? and sundry_code__for = ? and sundry_type__for= ? and tran_id != ?"; sql = "SELECT COUNT(1) FROM misc_vouchdet WHERE bill_no = ? and sundry_code__for = ? and sundry_type__for= ? and tran_id != ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,billNo); pstmt.setString(1, billNo);
pstmt.setString(2,sundryCode); pstmt.setString(2, sundryCode);
pstmt.setString(3,sundryType); pstmt.setString(3, sundryType);
pstmt.setString(4,tranId); pstmt.setString(4, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -754,22 +647,20 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -754,22 +647,20 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
} }
if(cnt != 0) if (cnt != 0) {
{
errCode = "VTBILL1"; errCode = "VTBILL1";
} } else {
else if (billDate != null && billDate.trim().length() > 0) {
{
if(billDate != null && billDate.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM porcp WHERE supp_code = ? and invoice_no = ? and invoice_date= ? "; sql = "SELECT COUNT(*) FROM porcp WHERE supp_code = ? and invoice_no = ? and invoice_date= ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sundryCode); pstmt.setString(1, sundryCode);
pstmt.setString(2,billNo); pstmt.setString(2, billNo);
pstmt.setTimestamp(3,Timestamp.valueOf(dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()+ " 00:00:00.0")); pstmt.setTimestamp(3,
Timestamp.valueOf(
dbDateFormat.format(simpleDateFormat.parse(billDate)).toString()
+ " 00:00:00.0"));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
rs.close(); rs.close();
...@@ -778,33 +669,28 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -778,33 +669,28 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt = null; pstmt = null;
} }
} }
if(cnt != 0) //commented by dipak on 12 Nov 2011 if (cnt != 0) // commented by dipak on 12 Nov 2011
{ {
errCode = "VTBILL1"; errCode = "VTBILL1";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("proj_code")) else if (childNodeName.equalsIgnoreCase("proj_code")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
projectCode = genericUtility.getColumnValue("proj_code", dom); projectCode = genericUtility.getColumnValue("proj_code", dom);
if(projectCode!= null && !"null".equals(projectCode) && (projectCode.trim().length() > 0 )) if (projectCode != null && !"null".equals(projectCode) && (projectCode.trim().length() > 0)) {
{
sql = "SELECT COUNT(*) FROM PROJECT WHERE PROJ_CODE = ?"; sql = "SELECT COUNT(*) FROM PROJECT WHERE PROJ_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,projectCode); pstmt.setString(1, projectCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMPROJ1"; errCode = "VMPROJ1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -817,13 +703,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -817,13 +703,10 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase( "curr_code")) else if (childNodeName.equalsIgnoreCase("curr_code")) {
{ if (childNode.getFirstChild() != null) {
if(childNode.getFirstChild() != null) currCode = genericUtility.getColumnValue("curr_code", dom);
{ if (currCode == null || (currCode.trim().length() == 0)) {
currCode =genericUtility.getColumnValue("curr_code", dom);
if(currCode== null || (currCode.trim().length() == 0))
{
errCode = "VECUR2"; errCode = "VECUR2";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -832,233 +715,207 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -832,233 +715,207 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
System.out.println("sql [" + sql + "]"); System.out.println("sql [" + sql + "]");
System.out.println("columnValue [" + currCode + "]"); System.out.println("columnValue [" + currCode + "]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,currCode); pstmt.setString(1, currCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMCUR1"; errCode = "VMCUR1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(pstmt != null) if (pstmt != null) {
{
pstmt.close(); pstmt.close();
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("acct_code__ap")) else if (childNodeName.equalsIgnoreCase("acct_code__ap")) {
{
acctCodeAp = checkNull(genericUtility.getColumnValue("acct_code__ap", dom)); acctCodeAp = checkNull(genericUtility.getColumnValue("acct_code__ap", dom));
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
sundryCode = genericUtility.getColumnValue("sundry_code", dom); sundryCode = genericUtility.getColumnValue("sundry_code", dom);
sundryType = genericUtility.getColumnValue("sundry_type", dom); sundryType = genericUtility.getColumnValue("sundry_type", dom);
if(acctCodeAp != null && siteCode != null && acctCodeAp.trim().length() > 0 && siteCode.trim().length() >0) if (acctCodeAp != null && siteCode != null && acctCodeAp.trim().length() > 0
{ && siteCode.trim().length() > 0) {
errCode = finCommon.isAcctCode(siteCode, acctCodeAp, "", conn); errCode = finCommon.isAcctCode(siteCode, acctCodeAp, "", conn);
} } else if (acctCodeAp == null || acctCodeAp.trim().length() == 0) {
else if(acctCodeAp == null || acctCodeAp.trim().length() == 0)
{
errCode = "VMACCTCD1"; errCode = "VMACCTCD1";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{ if (acctCodeAp != null && sundryCode != null && sundryType != null
if(acctCodeAp != null && sundryCode != null && sundryType != null && acctCodeAp.trim().length() > 0 && sundryCode.trim().length() > 0 && sundryType.trim().length() > 0) && acctCodeAp.trim().length() > 0 && sundryCode.trim().length() > 0
{ && sundryType.trim().length() > 0) {
errCode = finCommon.isAcctType(acctCodeAp, sundryCode, sundryType, conn); errCode = finCommon.isAcctType(acctCodeAp, sundryCode, sundryType, conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("acct_code__pay")) else if (childNodeName.equalsIgnoreCase("acct_code__pay")) {
{
acctCodePay = checkNull(genericUtility.getColumnValue("acct_code__pay", dom)); acctCodePay = checkNull(genericUtility.getColumnValue("acct_code__pay", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
if(siteCode != null && acctCodePay != null && siteCode.trim().length() > 0 && acctCodePay.trim().length() > 0) if (siteCode != null && acctCodePay != null && siteCode.trim().length() > 0
{ && acctCodePay.trim().length() > 0) {
errCode = finCommon.isAcctCode(siteCode, acctCodePay, "", conn); errCode = finCommon.isAcctCode(siteCode, acctCodePay, "", conn);
} } else if (acctCodePay == null || acctCodePay.trim().length() == 0) {
else if(acctCodePay == null || acctCodePay.trim().length() == 0)
{
errCode = "VMACCTCD1"; errCode = "VMACCTCD1";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
sundryCodePay = genericUtility.getColumnValue("sundry_code__pay", dom); sundryCodePay = genericUtility.getColumnValue("sundry_code__pay", dom);
sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom); sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom);
if(errCode == null || (errCode.trim().length()== 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{ if (acctCodePay != null && sundryCodePay != null && sundryTypePay != null
if(acctCodePay != null && sundryCodePay != null && sundryTypePay != null && acctCodePay.trim().length() > 0 && sundryTypePay.trim().length() > 0 && sundryCodePay.trim().length() > 0) && acctCodePay.trim().length() > 0 && sundryTypePay.trim().length() > 0
{ && sundryCodePay.trim().length() > 0) {
errCode = finCommon.isAcctType(acctCodePay, sundryCodePay, sundryTypePay, conn); errCode = finCommon.isAcctType(acctCodePay, sundryCodePay, sundryTypePay, conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("cctr_code__ap")) else if (childNodeName.equalsIgnoreCase("cctr_code__ap")) {
{
cctrCodeAp = checkNull(genericUtility.getColumnValue("cctr_code__ap", dom)); cctrCodeAp = checkNull(genericUtility.getColumnValue("cctr_code__ap", dom));
acctCodeAp = checkNull(genericUtility.getColumnValue("acct_code__ap", dom)); acctCodeAp = checkNull(genericUtility.getColumnValue("acct_code__ap", dom));
// if(acctCodeAp != null && cctrCodeAp != null && acctCodeAp.trim().length() > 0 && cctrCodeAp.trim().length() > 0) // if(acctCodeAp != null && cctrCodeAp != null && acctCodeAp.trim().length() > 0
// && cctrCodeAp.trim().length() > 0)
// { // {
System.out.println("cctrCodeAp:"+cctrCodeAp); System.out.println("cctrCodeAp:" + cctrCodeAp);
errCode = finCommon.isCctrCode(acctCodeAp, cctrCodeAp, "", conn); errCode = finCommon.isCctrCode(acctCodeAp, cctrCodeAp, "", conn);
// } // }
System.out.println("errCode:"+errCode); System.out.println("errCode:" + errCode);
/* else if(cctrCodeCf == null || cctrCodeCf.trim().length() /*
/* else if(cctrCodeAp == null || cctrCodeAp.trim().length() == 0 )--commented by Abhijit * else if(cctrCodeCf == null || cctrCodeCf.trim().length() /* else
{ * if(cctrCodeAp == null || cctrCodeAp.trim().length() == 0 )--commented by
errCode = "VMCCTRNULL"; * Abhijit { errCode = "VMCCTRNULL"; }
}*/ */
/*if(cctrCodeAp == null || cctrCodeAp.trim().length() == 0)//Added by Pavan R [to handle exception in gltrace on blank_cctr] /*
{ * if(cctrCodeAp == null || cctrCodeAp.trim().length() == 0)//Added by Pavan R
errCode = "VTBLCCTRCD"; * [to handle exception in gltrace on blank_cctr] { errCode = "VTBLCCTRCD"; }
}*/ */
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
//added by manish mhatre on 16/july/2019 // added by manish mhatre on 16/july/2019
//start manish // start manish
else if(childNodeName.equalsIgnoreCase("cctr_code__pay")) else if (childNodeName.equalsIgnoreCase("cctr_code__pay")) {
{
cctrCodePay = checkNull(genericUtility.getColumnValue("cctr_code__pay", dom)); cctrCodePay = checkNull(genericUtility.getColumnValue("cctr_code__pay", dom));
acctCodePay = checkNull(genericUtility.getColumnValue("acct_code__pay", dom)); acctCodePay = checkNull(genericUtility.getColumnValue("acct_code__pay", dom));
if(cctrCodePay == null || cctrCodePay.trim().length() == 0) if (cctrCodePay == null || cctrCodePay.trim().length() == 0) {
{
errCode = "VTBLCCTRCD"; errCode = "VTBLCCTRCD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} } else {
else System.out.println("cctrCodePay1:" + cctrCodePay);
{
System.out.println("cctrCodePay1:"+cctrCodePay);
errCode = finCommon.isCctrCode(acctCodePay, cctrCodePay, "", conn); errCode = finCommon.isCctrCode(acctCodePay, cctrCodePay, "", conn);
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
System.out.println("errCode:"+errCode); System.out.println("errCode:" + errCode);
} }
} }
//end manish // end manish
else if(childNodeName.equalsIgnoreCase("acct_code__cf")) else if (childNodeName.equalsIgnoreCase("acct_code__cf")) {
{
acctCodeCf = checkNull(genericUtility.getColumnValue("acct_code__cf", dom)); acctCodeCf = checkNull(genericUtility.getColumnValue("acct_code__cf", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
if(siteCode != null && acctCodeCf!= null && siteCode.trim().length() > 0 && acctCodeCf.trim().length() > 0 ) if (siteCode != null && acctCodeCf != null && siteCode.trim().length() > 0
{ && acctCodeCf.trim().length() > 0) {
errCode = finCommon.isAcctCode(siteCode, acctCodeCf, "", conn); errCode = finCommon.isAcctCode(siteCode, acctCodeCf, "", conn);
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
sundryCodePay = ""; sundryCodePay = "";
sundryTypePay = "O"; sundryTypePay = "O";
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{ if (acctCodeCf != null && sundryCodePay != null && sundryTypePay != null
if(acctCodeCf != null && sundryCodePay != null && sundryTypePay != null && acctCodeCf.trim().length() > 0 && sundryCodePay.trim().length() > 0 && sundryTypePay.trim().length() > 0) && acctCodeCf.trim().length() > 0 && sundryCodePay.trim().length() > 0
{ && sundryTypePay.trim().length() > 0) {
errCode = finCommon.isAcctType(acctCodeCf, sundryCodePay, sundryTypePay, conn); errCode = finCommon.isAcctType(acctCodeCf, sundryCodePay, sundryTypePay, conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("cctr_code__cf")) else if (childNodeName.equalsIgnoreCase("cctr_code__cf")) {
{
cctrCodeCf = checkNull(genericUtility.getColumnValue("cctr_code__cf", dom)); cctrCodeCf = checkNull(genericUtility.getColumnValue("cctr_code__cf", dom));
acctCodeCf = checkNull(genericUtility.getColumnValue("acct_code__cf", dom)); acctCodeCf = checkNull(genericUtility.getColumnValue("acct_code__cf", dom));
if(cctrCodeCf == null || cctrCodeCf.trim().length() == 0)//Added by Pavan R [to handle exception in gltrace on blank_cctr] if (cctrCodeCf == null || cctrCodeCf.trim().length() == 0)// Added by Pavan R [to handle
// exception in gltrace on
// blank_cctr]
{ {
errCode = "VTBLCCTRCD"; errCode = "VTBLCCTRCD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(acctCodeCf!= null && (acctCodeCf.trim().length() > 0 )) if (acctCodeCf != null && (acctCodeCf.trim().length() > 0)) {
{ // if(acctCodeCf != null && cctrCodeCf != null && acctCodeCf.trim().length() > 0
//if(acctCodeCf != null && cctrCodeCf != null && acctCodeCf.trim().length() > 0 && cctrCodeCf.trim().length() > 0) // && cctrCodeCf.trim().length() > 0)
//{ // {
System.out.println("cctrCodeCf:"+cctrCodeCf); System.out.println("cctrCodeCf:" + cctrCodeCf);
errCode = finCommon.isCctrCode(acctCodeCf, cctrCodeCf, "", conn); errCode = finCommon.isCctrCode(acctCodeCf, cctrCodeCf, "", conn);
// } // }
System.out.println("errCode:"+errCode); System.out.println("errCode:" + errCode);
/* else if(cctrCodeCf == null || cctrCodeCf.trim().length() == 0 ) /*
{ * else if(cctrCodeCf == null || cctrCodeCf.trim().length() == 0 ) { errCode =
errCode = "VMCCTRNULL"; * "VMCCTRNULL"; }
}*/ */
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("acct_code__adv")) else if (childNodeName.equalsIgnoreCase("acct_code__adv")) {
{
vouchType = checkNull(genericUtility.getColumnValue("vouch_type", dom)); vouchType = checkNull(genericUtility.getColumnValue("vouch_type", dom));
if(vouchType != null && "A".equalsIgnoreCase(vouchType)) if (vouchType != null && "A".equalsIgnoreCase(vouchType)) {
{
acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom)); acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
if(acctCodeAdv != null && siteCode != null && acctCodeAdv.trim().length() > 0 && siteCode.trim().length() > 0) if (acctCodeAdv != null && siteCode != null && acctCodeAdv.trim().length() > 0
{ && siteCode.trim().length() > 0) {
errCode = finCommon.isAcctCode(siteCode, acctCodeAdv, "", conn); //added if condition extra by Dipak errCode = finCommon.isAcctCode(siteCode, acctCodeAdv, "", conn); // added if condition
} // extra by Dipak
else if(acctCodeAdv == null || acctCodeAdv.trim().length() == 0) } else if (acctCodeAdv == null || acctCodeAdv.trim().length() == 0) {
{
errCode = "VMACCTCD1"; errCode = "VMACCTCD1";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
sundryCode = genericUtility.getColumnValue("sundry_code", dom); sundryCode = genericUtility.getColumnValue("sundry_code", dom);
sundryType = genericUtility.getColumnValue("sundry_type", dom); sundryType = genericUtility.getColumnValue("sundry_type", dom);
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{ if (acctCodeAdv != null && sundryCode != null && sundryType != null
if(acctCodeAdv != null && sundryCode != null && sundryType != null && acctCodeAdv.trim().length() > 0 && sundryCode.trim().length() > 0 && sundryType.trim().length() > 0) //added if condition extra by Dipak && acctCodeAdv.trim().length() > 0 && sundryCode.trim().length() > 0
&& sundryType.trim().length() > 0) // added if condition extra by Dipak
{ {
errCode = finCommon.isAcctType(acctCodeAdv, sundryCode, sundryType, conn); errCode = finCommon.isAcctType(acctCodeAdv, sundryCode, sundryType, conn);
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -1066,52 +923,45 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1066,52 +923,45 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("cctr_code__adv")) else if (childNodeName.equalsIgnoreCase("cctr_code__adv")) {
{
vouchType = checkNull(genericUtility.getColumnValue("vouch_type", dom)); vouchType = checkNull(genericUtility.getColumnValue("vouch_type", dom));
if(vouchType != null && "A".equalsIgnoreCase(vouchType)) if (vouchType != null && "A".equalsIgnoreCase(vouchType)) {
{
cctrCodeAdv = checkNull(genericUtility.getColumnValue("cctr_code__adv", dom)); cctrCodeAdv = checkNull(genericUtility.getColumnValue("cctr_code__adv", dom));
acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom)); acctCodeAdv = checkNull(genericUtility.getColumnValue("acct_code__adv", dom));
//if(acctCodeAdv != null && cctrCodeAdv != null && acctCodeAdv.trim().length() > 0 && cctrCodeAdv.trim().length() > 0) // if(acctCodeAdv != null && cctrCodeAdv != null && acctCodeAdv.trim().length()
//{ // > 0 && cctrCodeAdv.trim().length() > 0)
System.out.println("cctrCodeAdv:"+cctrCodeAdv); // {
System.out.println("cctrCodeAdv:" + cctrCodeAdv);
errCode = finCommon.isCctrCode(acctCodeAdv, cctrCodeAdv, "", conn); errCode = finCommon.isCctrCode(acctCodeAdv, cctrCodeAdv, "", conn);
// } // }
System.out.println("errCode:"+errCode); System.out.println("errCode:" + errCode);
/*else if(cctrCodeAdv == null || cctrCodeAdv.trim().length() == 0 ) /*
{ * else if(cctrCodeAdv == null || cctrCodeAdv.trim().length() == 0 ) { errCode =
errCode = "VMCCTRNULL"; * "VMCCTRNULL"; }
}*/ */
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("site_code")) else if (childNodeName.equalsIgnoreCase("site_code")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
if(siteCode == null || (siteCode.length() == 0)) if (siteCode == null || (siteCode.length() == 0)) {
{
errList.add("VMSITECOD"); errList.add("VMSITECOD");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(siteCode != null && (siteCode.trim().length() > 0)) if (siteCode != null && (siteCode.trim().length() > 0)) {
{
sql = " select count(*) from site where site_code = ? "; sql = " select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode); pstmt.setString(1, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMSITE1"; errCode = "VMSITE1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1122,52 +972,44 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1122,52 +972,44 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{
tranDate = genericUtility.getColumnValue("tran_date", dom); tranDate = genericUtility.getColumnValue("tran_date", dom);
try try {
{
tranPdate = simpleDateFormat.parse(tranDate); tranPdate = simpleDateFormat.parse(tranDate);
//Changes and Commented By Ajay on 11-01-2018:START // Changes and Commented By Ajay on 11-01-2018:START
//errCode = validator.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode); // errCode = validator.nfCheckPeriod("FIN",new
errCode = finCommon.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode,conn); // java.util.Date(tranPdate.getTime()),siteCode);
//Changes and Commented By Ajay on 11-01-2018:END errCode = finCommon.nfCheckPeriod("FIN", new java.util.Date(tranPdate.getTime()),
} siteCode, conn);
catch (ParseException e) // Changes and Commented By Ajay on 11-01-2018:END
{ } catch (ParseException e) {
System.out.println("Exception in transaction date [tran_date_validation]"+e); System.out.println("Exception in transaction date [tran_date_validation]" + e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
if(errCode != null && errCode.trim().length() > 0) if (errCode != null && errCode.trim().length() > 0) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("site_code__for")) else if (childNodeName.equalsIgnoreCase("site_code__for")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
siteCodeFor = genericUtility.getColumnValue("site_code__for", dom); siteCodeFor = genericUtility.getColumnValue("site_code__for", dom);
if(siteCodeFor == null || (siteCodeFor.length() == 0)) if (siteCodeFor == null || (siteCodeFor.length() == 0)) {
{
errList.add("VMSITECOD"); errList.add("VMSITECOD");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(siteCodeFor != null && (siteCodeFor.trim().length() > 0)) if (siteCodeFor != null && (siteCodeFor.trim().length() > 0)) {
{
sql = " select count(*) from site where site_code = ? "; sql = " select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeFor); pstmt.setString(1, siteCodeFor);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMSITE1"; errCode = "VMSITE1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1178,47 +1020,40 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1178,47 +1020,40 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{
tranDate = genericUtility.getColumnValue("tran_date", dom); tranDate = genericUtility.getColumnValue("tran_date", dom);
try try {
{
tranPdate = simpleDateFormat.parse(tranDate); tranPdate = simpleDateFormat.parse(tranDate);
//Changes and Commented By Ajay on 11-01-2018:START // Changes and Commented By Ajay on 11-01-2018:START
//errCode = validator.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCodeFor); // errCode = validator.nfCheckPeriod("FIN",new
errCode = finCommon.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCodeFor,conn); // java.util.Date(tranPdate.getTime()),siteCodeFor);
//Changes and Commented By Ajay on 11-01-2018:END errCode = finCommon.nfCheckPeriod("FIN", new java.util.Date(tranPdate.getTime()),
} siteCodeFor, conn);
catch (ParseException e) // Changes and Commented By Ajay on 11-01-2018:END
{ } catch (ParseException e) {
System.out.println("Exception in transaction date [tran_date_validation]"+e); System.out.println("Exception in transaction date [tran_date_validation]" + e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
if(errCode != null && errCode.trim().length() > 0) if (errCode != null && errCode.trim().length() > 0) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("fin_entity")) else if (childNodeName.equalsIgnoreCase("fin_entity")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
finEntity = checkNull(genericUtility.getColumnValue("fin_entity", dom)); finEntity = checkNull(genericUtility.getColumnValue("fin_entity", dom));
if(finEntity != null && (finEntity.trim().length() > 0)) if (finEntity != null && (finEntity.trim().length() > 0)) {
{
sql = "SELECT COUNT(*) FROM FINENT WHERE FIN_ENTITY = ?"; sql = "SELECT COUNT(*) FROM FINENT WHERE FIN_ENTITY = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,finEntity); pstmt.setString(1, finEntity);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMFENTY1"; errCode = "VMFENTY1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1231,23 +1066,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1231,23 +1066,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("tax_class")) else if (childNodeName.equalsIgnoreCase("tax_class")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom)); taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
if(taxClass!= null && (taxClass.trim().length() > 0 )) if (taxClass != null && (taxClass.trim().length() > 0)) {
{
sql = "SELECT COUNT(*) FROM taxclass WHERE tax_class = ? "; sql = "SELECT COUNT(*) FROM taxclass WHERE tax_class = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,taxClass); pstmt.setString(1, taxClass);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMTACLA1"; errCode = "VMTACLA1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1259,23 +1090,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1259,23 +1090,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("tax_chap")) else if (childNodeName.equalsIgnoreCase("tax_chap")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom)); taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
if(taxChap!= null && (taxChap.trim().length() > 0 )) if (taxChap != null && (taxChap.trim().length() > 0)) {
{
sql = "SELECT COUNT(*) FROM taxchap WHERE tax_chap = ? "; sql = "SELECT COUNT(*) FROM taxchap WHERE tax_chap = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,taxChap); pstmt.setString(1, taxChap);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMTACHA1"; errCode = "VMTACHA1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1287,23 +1114,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1287,23 +1114,19 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("tax_env")) else if (childNodeName.equalsIgnoreCase("tax_env")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
taxEnv = checkNull(genericUtility.getColumnValue("tax_env", dom)); taxEnv = checkNull(genericUtility.getColumnValue("tax_env", dom));
if(taxEnv!= null && (taxEnv.trim().length() > 0 )) if (taxEnv != null && (taxEnv.trim().length() > 0)) {
{
sql = "SELECT COUNT(*) FROM taxenv WHERE tax_env = ? "; sql = "SELECT COUNT(*) FROM taxenv WHERE tax_env = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,taxEnv); pstmt.setString(1, taxEnv);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMTAENV1"; errCode = "VMTAENV1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1315,48 +1138,37 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1315,48 +1138,37 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
} }
} }
else if(childNodeName.equalsIgnoreCase("adv_amt")) else if (childNodeName.equalsIgnoreCase("adv_amt")) {
{ advAmt = Double.parseDouble(genericUtility.getColumnValue("adv_amt", dom));
advAmt = Double.parseDouble (genericUtility.getColumnValue("adv_amt", dom));
sundryType = genericUtility.getColumnValue("sundry_type", dom); sundryType = genericUtility.getColumnValue("sundry_type", dom);
sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom); sundryTypePay = genericUtility.getColumnValue("sundry_type__pay", dom);
vouchType = genericUtility.getColumnValue("vouch_type", dom); vouchType = genericUtility.getColumnValue("vouch_type", dom);
if(advAmt!= 0 && (sundryType == "O" || sundryTypePay == "O")) if (advAmt != 0 && (sundryType == "O" || sundryTypePay == "O")) {
{
errCode = "VTADV1"; errCode = "VTADV1";
} } else if ("A".equalsIgnoreCase(vouchType) && (advAmt < 0)) {
else if("A".equalsIgnoreCase(vouchType) && (advAmt < 0))
{
errCode = "VTADV2"; errCode = "VTADV2";
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("cr_term")) else if (childNodeName.equalsIgnoreCase("cr_term")) {
{ // Added by sarita on 28FEB2018
//Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom)); crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
if(crTerm == null || (crTerm.trim().length() == 0)) if (crTerm == null || (crTerm.trim().length() == 0)) {
{
errCode = "VECRT2"; errCode = "VECRT2";
} } else {
else
{
sql = "SELECT COUNT(*) FROM crterm WHERE cr_term = ? "; sql = "SELECT COUNT(*) FROM crterm WHERE cr_term = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,crTerm); pstmt.setString(1, crTerm);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMCRTER1"; errCode = "VMCRTER1";
} }
rs.close(); rs.close();
...@@ -1364,41 +1176,39 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1364,41 +1176,39 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(errCode != null && (errCode.trim().length() > 0)) if (errCode != null && (errCode.trim().length() > 0)) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("site_code__pay")) //Added by Abhijit Gaikwad else if (childNodeName.equalsIgnoreCase("site_code__pay")) // Added by Abhijit Gaikwad
{ {
//Added by sarita on 28FEB2018 // Added by sarita on 28FEB2018
cnt = 0; cnt = 0;
String siteCodePay=""; String siteCodePay = "";
siteCodePay = genericUtility.getColumnValue("site_code__pay", dom); siteCodePay = genericUtility.getColumnValue("site_code__pay", dom);
// Modified by Jaffar on 21/05/2018 [To allow empty site code as requested from GTPL].Start // Modified by Jaffar on 21/05/2018 [To allow empty site code as requested from
if (siteCodePay != null && siteCodePay.length() > 0) // GTPL].Start
{ if (siteCodePay != null && siteCodePay.length() > 0) {
// Modified by Jaffar on 21/05/2018 [To allow empty site code as requested from GTPL].End // Modified by Jaffar on 21/05/2018 [To allow empty site code as requested from
//Commented and changes by sarita for gtpl point[355- Site_code__payable mandatory validation to be removed.] on 11 JUL 18 [START] // GTPL].End
/*if(siteCodePay == null || (siteCodePay.length() == 0)) // Commented and changes by sarita for gtpl point[355- Site_code__payable
{ // mandatory validation to be removed.] on 11 JUL 18 [START]
errList.add("VMSITECOD"); /*
errFields.add(childNodeName.toLowerCase()); * if(siteCodePay == null || (siteCodePay.length() == 0)) {
} * errList.add("VMSITECOD"); errFields.add(childNodeName.toLowerCase()); }
if(siteCodePay != null && (siteCodePay.trim().length() > 0)) * if(siteCodePay != null && (siteCodePay.trim().length() > 0)) {
{*/ */
//Commented and changes by sarita for gtpl point[355- Site_code__payable mandatory validation to be removed.] on 11 JUL 18 [END] // Commented and changes by sarita for gtpl point[355- Site_code__payable
// mandatory validation to be removed.] on 11 JUL 18 [END]
sql = " select count(*) from site where site_code = ? "; sql = " select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodePay); pstmt.setString(1, siteCodePay);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{
errCode = "VMSITE1"; errCode = "VMSITE1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1408,27 +1218,27 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1408,27 +1218,27 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//}//Commented and changes by sarita on 11 JUL 18 // }//Commented and changes by sarita on 11 JUL 18
// Added By PriyankaC on 20/02/2018 [START] // Added By PriyankaC on 20/02/2018 [START]
//changes and commented by sarita for gtpl point[355- Site_code__payable mandatory validation to be removed.] on 11 JUL 18 [START] // changes and commented by sarita for gtpl point[355- Site_code__payable
//if(! siteCode.equalsIgnoreCase(siteCodePay)) // mandatory validation to be removed.] on 11 JUL 18 [START]
if(! siteCode.trim().equalsIgnoreCase(siteCodePay.trim())) // if(! siteCode.equalsIgnoreCase(siteCodePay))
//changes and commented by sarita for gtpl point[355- Site_code__payable mandatory validation to be removed.] on 11 JUL 18 [END] if (!siteCode.trim().equalsIgnoreCase(siteCodePay.trim()))
// changes and commented by sarita for gtpl point[355- Site_code__payable
// mandatory validation to be removed.] on 11 JUL 18 [END]
{ {
System.out.println("inside condition of siteCodePay ::"); System.out.println("inside condition of siteCodePay ::");
sql = "select count(*) from ibca_pay_ctrl where site_code__to = ? and site_code__from = ? "; sql = "select count(*) from ibca_pay_ctrl where site_code__to = ? and site_code__from = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodePay); pstmt.setString(1, siteCodePay);
pstmt.setString(2,siteCode); pstmt.setString(2, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
cnt = rs.getInt(1); cnt = rs.getInt(1);
if(cnt == 0) if (cnt == 0) {
{ System.out.println("counterr ::" + cnt);
System.out.println("counterr ::" +cnt);
errCode = "VTSITEREQ"; errCode = "VTSITEREQ";
errList.add(errCode); errList.add(errCode);
...@@ -1441,75 +1251,67 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1441,75 +1251,67 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt = null; pstmt = null;
} }
// Added By PriyankaC on 20/02/2018 [END] // Added By PriyankaC on 20/02/2018 [END]
if(errCode == null || (errCode.trim().length() == 0)) if (errCode == null || (errCode.trim().length() == 0)) {
{
tranDate = genericUtility.getColumnValue("tran_date", dom); tranDate = genericUtility.getColumnValue("tran_date", dom);
try try {
{
tranPdate = simpleDateFormat.parse(tranDate); tranPdate = simpleDateFormat.parse(tranDate);
//Changes and Commented By Ajay on 11-01-2018:START // Changes and Commented By Ajay on 11-01-2018:START
//errCode = validator.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode); // errCode = validator.nfCheckPeriod("FIN",new
errCode = finCommon.nfCheckPeriod("FIN",new java.util.Date(tranPdate.getTime()),siteCode,conn); // java.util.Date(tranPdate.getTime()),siteCode);
//Changes and Commented By Ajay on 11-01-2018:END errCode = finCommon.nfCheckPeriod("FIN", new java.util.Date(tranPdate.getTime()),
} siteCode, conn);
catch (ParseException e) // Changes and Commented By Ajay on 11-01-2018:END
{ } catch (ParseException e) {
System.out.println("Exception in transaction date [tran_date_validation]"+e); System.out.println("Exception in transaction date [tran_date_validation]" + e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
if(errCode != null && errCode.trim().length() > 0) if (errCode != null && errCode.trim().length() > 0) {
{
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}//end by Abhijit } // end by Abhijit
} }
} }
break; break;
case 2 : case 2:
parentNodeList = dom1.getElementsByTagName("Detail1"); parentNodeList = dom1.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
parentNodeList = dom.getElementsByTagName("Detail2"); parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr ++) for (ctr = 0; ctr < childNodeListLength; ctr++) {
{
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("ref_ser")) if (childNodeName.equalsIgnoreCase("ref_ser")) {
{ // Changed by Anjali R. on[05/03/2018][To trim ref ser value]
//Changed by Anjali R. on[05/03/2018][To trim ref ser value]
refSer = checkNull(genericUtility.getColumnValue("ref_ser", dom)).trim(); refSer = checkNull(genericUtility.getColumnValue("ref_ser", dom)).trim();
//refSer = checkNull(genericUtility.getColumnValue("ref_ser", dom)); // refSer = checkNull(genericUtility.getColumnValue("ref_ser", dom));
if((refSer != null) && (!("M-ADV".equalsIgnoreCase(refSer))) && (!("P-ADV".equalsIgnoreCase(refSer)) ) && (refSer.trim().length() > 0)) if ((refSer != null) && (!("M-ADV".equalsIgnoreCase(refSer)))
{ && (!("P-ADV".equalsIgnoreCase(refSer))) && (refSer.trim().length() > 0)) {
errCode = "VTREFSER3"; errCode = "VTREFSER3";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if(childNodeName.equalsIgnoreCase("ref_no")) else if (childNodeName.equalsIgnoreCase("ref_no")) {
{
refNo = checkNull(genericUtility.getColumnValue("ref_no", dom)); refNo = checkNull(genericUtility.getColumnValue("ref_no", dom));
refSer = genericUtility.getColumnValue("ref_ser", dom); refSer = genericUtility.getColumnValue("ref_ser", dom);
sundryType = genericUtility.getColumnValue("sundry_type", dom1); sundryType = genericUtility.getColumnValue("sundry_type", dom1);
sundryCode = genericUtility.getColumnValue("sundry_code", dom1); sundryCode = genericUtility.getColumnValue("sundry_code", dom1);
siteCode = genericUtility.getColumnValue("site_code", dom1); siteCode = genericUtility.getColumnValue("site_code", dom1);
currCode = genericUtility.getColumnValue("curr_code", dom1); currCode = genericUtility.getColumnValue("curr_code", dom1);
if(refNo != null && (refNo.trim().length() > 0 )) if (refNo != null && (refNo.trim().length() > 0)) {
{
sql = "SELECT sundry_type, sundry_code, site_code, curr_code FROM misc_payables WHERE tran_ser = ? and ref_no = ? "; sql = "SELECT sundry_type, sundry_code, site_code, curr_code FROM misc_payables WHERE tran_ser = ? and ref_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refSer); pstmt.setString(1, refSer);
pstmt.setString(2,refNo); pstmt.setString(2, refNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if (rs.next()) {
{
sundryType1 = rs.getString(1); sundryType1 = rs.getString(1);
sundryCode1 = rs.getString(2); sundryCode1 = rs.getString(2);
siteCode1 = rs.getString(3); siteCode1 = rs.getString(3);
...@@ -1520,95 +1322,84 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1520,95 +1322,84 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
pstmt.close(); pstmt.close();
pstmt = null; 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");
System.out.println("databse stype value"+sundryType1+"**"); System.out.println("databse stype value" + sundryType1 + "**");
System.out.println("dom stype value"+sundryType+"**"); System.out.println("dom stype value" + sundryType + "**");
System.out.println("databse scode value"+sundryCode1+"**");
System.out.println("dom scode value"+sundryCode+"**");
System.out.println("databse sitecode value"+siteCode1+"**");
System.out.println("dom sitecode value"+siteCode+"**");
System.out.println("databse curr code value"+currCode1+"**"); System.out.println("databse scode value" + sundryCode1 + "**");
System.out.println("dom curr code value"+currCode+"**"); System.out.println("dom scode value" + sundryCode + "**");
System.out.println("databse sitecode value" + siteCode1 + "**");
System.out.println("dom sitecode value" + siteCode + "**");
System.out.println("databse curr code value" + currCode1 + "**");
System.out.println("dom curr code value" + currCode + "**");
System.out.println("latest code11"); System.out.println("latest code11");
if( (sundryType1 != null && sundryType != null)) if ((sundryType1 != null && sundryType != null)) {
{
sundryType1 = sundryType1.trim(); sundryType1 = sundryType1.trim();
sundryType = sundryType.trim(); sundryType = sundryType.trim();
System.out.println("databse stype value => "+sundryType1); System.out.println("databse stype value => " + sundryType1);
System.out.println("dom stype value => "+sundryType); System.out.println("dom stype value => " + sundryType);
if(sundryType1.equalsIgnoreCase(sundryType)==false){ if (sundryType1.equalsIgnoreCase(sundryType) == false) {
errCode = "VTMPAY2"; errCode = "VTMPAY2";
} }
} }
if ((sundryCode1 != null && sundryCode != null)) {
if( (sundryCode1 != null && sundryCode != null))
{
sundryCode1 = sundryCode1.trim(); sundryCode1 = sundryCode1.trim();
sundryCode = sundryCode.trim(); sundryCode = sundryCode.trim();
System.out.println("databse scode value => "+sundryCode1); System.out.println("databse scode value => " + sundryCode1);
System.out.println("dom scode value => "+sundryCode1); System.out.println("dom scode value => " + sundryCode1);
if(sundryCode1.equalsIgnoreCase(sundryCode)==false){ if (sundryCode1.equalsIgnoreCase(sundryCode) == false) {
errCode = "VTMPAY1"; errCode = "VTMPAY1";
} }
} }
if ((siteCode1 != null && siteCode != null)) {
if( (siteCode1 != null && siteCode != null))
{
siteCode1 = siteCode1.trim(); siteCode1 = siteCode1.trim();
siteCode = siteCode.trim(); siteCode = siteCode.trim();
System.out.println("databse sitecode value => "+siteCode1); System.out.println("databse sitecode value => " + siteCode1);
System.out.println("dom sitecode value => "+siteCode); System.out.println("dom sitecode value => " + siteCode);
if(siteCode1.equalsIgnoreCase(siteCode)==false){ if (siteCode1.equalsIgnoreCase(siteCode) == false) {
errCode = "VTMPAYSITE"; errCode = "VTMPAYSITE";
} }
} }
if ((currCode1 != null && currCode != null)) {
if( (currCode1 != null && currCode != null))
{
currCode1 = currCode1.trim(); currCode1 = currCode1.trim();
currCode = currCode.trim(); currCode = currCode.trim();
System.out.println("databse currcode value => "+currCode1); System.out.println("databse currcode value => " + currCode1);
System.out.println("dom currcode value => "+currCode); System.out.println("dom currcode value => " + currCode);
if(currCode1.equalsIgnoreCase(currCode)==false){ if (currCode1.equalsIgnoreCase(currCode) == false) {
errCode = "VTMPAYCURR"; errCode = "VTMPAYCURR";
} }
} }
//added by deepak sawant // added by deepak sawant
//added by manish mhatre on 24/july/2019[validation for misc voucher] // added by manish mhatre on 24/july/2019[validation for misc voucher]
//start manish //start manish
System.out.println("RefDate Validation::refNo["+refNo+"]refSer["+refSer+"]"); System.out.println("RefDate Validation::refNo["+refNo+"]refSer["+refSer+"]");
if("M-ADV".equals(refSer.trim())|| "P-ADV".equals(refSer.trim())) /*if("M-ADV".equals(refSer.trim())|| "P-ADV".equals(refSer.trim()))
{ { */ //commented by manish mhatre 26-july-19
sql = "SELECT ref_date FROM misc_payables WHERE tran_ser = ? and ref_no = ? "; sql = "SELECT ref_date FROM misc_payables WHERE tran_ser = ? and ref_no = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,refSer); pstmt1.setString(1,refSer);
...@@ -1630,7 +1421,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M ...@@ -1630,7 +1421,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }//commented by manish mhatre
//end manish //end manish
} }
if(errCode != null && (errCode.trim().length() > 0)) if(errCode != null && (errCode.trim().length() > 0))
......
...@@ -199,9 +199,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -199,9 +199,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
//System.out.println("current date:::::"+tranDateStr); //System.out.println("current date:::::"+tranDateStr);
//SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());--commemt by monika //SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());--commemt by monika
//added by manish mhatre on 23-july-2019
//start manish
SimpleDateFormat sdf1 = 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"); today = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
//end
Calendar currentDate = Calendar.getInstance(); Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDate = sdf.format(currentDate.getTime()); String sysDate = sdf.format(currentDate.getTime());
...@@ -1353,7 +1355,6 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -1353,7 +1355,6 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
else if (childNodeName.equalsIgnoreCase("cctr_code__ar")) else if (childNodeName.equalsIgnoreCase("cctr_code__ar"))
{ {
cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom); cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom);
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0) if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
{ {
...@@ -4611,7 +4612,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -4611,7 +4612,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
System.out.println("rcpepc_ref_no"+refNo); System.out.println("rcpepc_ref_no"+refNo);
if((refNo!=null) && (refNo.trim().length()>0)) if((refNo!=null) && (refNo.trim().length()>0))
{ {
sql="select tran_date,curr_code__from,exch_rate,tot_amt into from advbking where tran_id=?"; sql="select tran_date,curr_code__from,exch_rate,tot_amt from advbking where tran_id=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refNo); pstmt.setString(1, refNo);
......
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