Commit d9087dda authored by vvengurlekar's avatar vvengurlekar

MiscPayAutoPrc.java - changes done as per issue parsing date


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186658 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 20fc0518
...@@ -102,8 +102,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -102,8 +102,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
PreparedStatement pstmt = null,pstmt1 = null; PreparedStatement pstmt = null,pstmt1 = null;
ResultSet resultSet = null,resultSet1 = null; ResultSet resultSet = null,resultSet1 = null;
//added by Varsha V on 19-06-18 for conversion of date
String billDateStr = "", refDateStr = "", dueDateStr = "";
//Ended by Varsha V on 19-06-18 for conversion of date
try try
{ {
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
...@@ -269,15 +270,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -269,15 +270,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
sumNetAmt = resultSet1.getDouble(1); sumNetAmt = resultSet1.getDouble(1);
} }
System.out.println("sumNetAmt---["+sumNetAmt+"]"); System.out.println("sumNetAmt---["+sumNetAmt+"]");
//added by Varsha V on 19-06-18 for conversion of date
if(resultSet.getTimestamp("bill_date") != null)
{
billDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("bill_date"),genericUtility.getApplDateFormat());
}
else
{
billDateStr = "";
}
if(resultSet.getTimestamp("ref_date") != null)
{
refDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("ref_date"),genericUtility.getApplDateFormat());
}
else
{
refDateStr = "";
}
if(resultSet.getTimestamp("due_date") != null)
{
dueDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("due_date"),genericUtility.getApplDateFormat());
}
else
{
dueDateStr = "";
}
//Ended by Varsha V on 19-06-18 for conversion of date
xmlBuff.append("<Detail2>"); xmlBuff.append("<Detail2>");
xmlBuff.append("<net_payable>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("net_payable")) + "]]>").append("</net_payable>"); xmlBuff.append("<net_payable>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("net_payable")) + "]]>").append("</net_payable>");
xmlBuff.append("<ref_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("ref_no")) + "]]>").append("</ref_no>"); xmlBuff.append("<ref_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("ref_no")) + "]]>").append("</ref_no>");
xmlBuff.append("<tran_id>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_id")) + "]]>").append("</tran_id>"); xmlBuff.append("<tran_id>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_id")) + "]]>").append("</tran_id>");
xmlBuff.append("<misc_payables_tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?resultSet.getTimestamp("tran_date"):"" + "]]>").append("</misc_payables_tran_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
xmlBuff.append("<tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?resultSet.getTimestamp("tran_date"):"" + "]]>").append("</tran_date>"); //xmlBuff.append("<misc_payables_tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?resultSet.getTimestamp("tran_date"):"" + "]]>").append("</misc_payables_tran_date>");
xmlBuff.append("<ref_date>").append("<![CDATA[" + resultSet.getTimestamp("ref_date") != null?resultSet.getTimestamp("ref_date") : ""+ "]]>").append("</ref_date>"); //xmlBuff.append("<tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?resultSet.getTimestamp("tran_date"):"" + "]]>").append("</tran_date>");
//xmlBuff.append("<ref_date>").append("<![CDATA[" + resultSet.getTimestamp("ref_date") != null?resultSet.getTimestamp("ref_date") : ""+ "]]>").append("</ref_date>");
xmlBuff.append("<misc_payables_tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?genericUtility.getValidDateString(resultSet.getTimestamp("tran_date"),genericUtility.getApplDateFormat()):"" + "]]>").append("</misc_payables_tran_date>");
xmlBuff.append("<tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?genericUtility.getValidDateString(resultSet.getTimestamp("tran_date"),genericUtility.getApplDateFormat()):"" + "]]>").append("</tran_date>");
xmlBuff.append("<ref_date>").append("<![CDATA[" + refDateStr + "]]>").append("</ref_date>");
//commented and added by Varsha V on 19-06-18 for conversion of date
xmlBuff.append("<bill_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("bill_no")) + "]]>").append("</bill_no>"); xmlBuff.append("<bill_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("bill_no")) + "]]>").append("</bill_no>");
xmlBuff.append("<bill_date>").append("<![CDATA[" + resultSet.getTimestamp("bill_date") != null?resultSet.getTimestamp("bill_date"):""+ "]]>").append("</bill_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
//xmlBuff.append("<bill_date>").append("<![CDATA[" + resultSet.getTimestamp("bill_date") != null?resultSet.getTimestamp("bill_date"):""+ "]]>").append("</bill_date>");
xmlBuff.append("<bill_date>").append("<![CDATA[" + billDateStr + "]]>").append("</bill_date>");
//commented and added by Varsha V on 19-06-18 for conversion of date
xmlBuff.append("<curr_code>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("curr_code") )+ "]]>").append("</curr_code>"); xmlBuff.append("<curr_code>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("curr_code") )+ "]]>").append("</curr_code>");
xmlBuff.append("<exch_rate>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("exch_rate")) + "]]>").append("</exch_rate>"); xmlBuff.append("<exch_rate>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("exch_rate")) + "]]>").append("</exch_rate>");
xmlBuff.append("<sundry_code>").append("<![CDATA[" + resultSet.getString("sundry_code") + "]]>").append("</sundry_code>"); xmlBuff.append("<sundry_code>").append("<![CDATA[" + resultSet.getString("sundry_code") + "]]>").append("</sundry_code>");
...@@ -297,7 +334,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -297,7 +334,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlBuff.append("<sundry_name>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("sundry_name")) + "]]>").append("</sundry_name>"); xmlBuff.append("<sundry_name>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("sundry_name")) + "]]>").append("</sundry_name>");
xmlBuff.append("<net_payable>").append("<![CDATA[" + resultSet.getDouble("net_payable") + "]]>").append("</net_payable>"); xmlBuff.append("<net_payable>").append("<![CDATA[" + resultSet.getDouble("net_payable") + "]]>").append("</net_payable>");
xmlBuff.append("<cheque_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("cheque_no")) + "]]>").append("</cheque_no>"); xmlBuff.append("<cheque_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("cheque_no")) + "]]>").append("</cheque_no>");
xmlBuff.append("<due_date>").append("<![CDATA[" + resultSet.getTimestamp("due_date")+"]]>").append("</due_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
//xmlBuff.append("<due_date>").append("<![CDATA[" + resultSet.getTimestamp("due_date")+"]]>").append("</due_date>");
xmlBuff.append("<due_date>").append("<![CDATA[" + dueDateStr +"]]>").append("</due_date>");
//commented and added by Varsha V on 19-06-18 for conversion of date
xmlBuff.append("<tran_ser>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_ser")) + "]]>").append("</tran_ser>"); xmlBuff.append("<tran_ser>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_ser")) + "]]>").append("</tran_ser>");
xmlBuff.append("<unconfirm_amt>").append("<![CDATA[" + sumNetAmt + "]]>").append("</unconfirm_amt>"); xmlBuff.append("<unconfirm_amt>").append("<![CDATA[" + sumNetAmt + "]]>").append("</unconfirm_amt>");
pstmt1.clearParameters(); pstmt1.clearParameters();
...@@ -365,9 +405,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -365,9 +405,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlBuff.append("<ref_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("ref_no")) + "]]>").append("</ref_no>"); xmlBuff.append("<ref_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("ref_no")) + "]]>").append("</ref_no>");
xmlBuff.append("<tran_id>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_id")) + "]]>").append("</tran_id>"); xmlBuff.append("<tran_id>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_id")) + "]]>").append("</tran_id>");
xmlBuff.append("<tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?genericUtility.getValidDateString(resultSet.getTimestamp("tran_date"),genericUtility.getApplDateFormat()):"" + "]]>").append("</tran_date>"); xmlBuff.append("<tran_date>").append("<![CDATA[" + resultSet.getTimestamp("tran_date") != null?genericUtility.getValidDateString(resultSet.getTimestamp("tran_date"),genericUtility.getApplDateFormat()):"" + "]]>").append("</tran_date>");
xmlBuff.append("<ref_date>").append("<![CDATA[" + resultSet.getTimestamp("ref_date") != null?resultSet.getTimestamp("ref_date") : ""+ "]]>").append("</ref_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
//xmlBuff.append("<ref_date>").append("<![CDATA[" + resultSet.getTimestamp("ref_date") != null?resultSet.getTimestamp("ref_date") : ""+ "]]>").append("</ref_date>");
xmlBuff.append("<ref_date>").append("<![CDATA[" + refDateStr + "]]>").append("</ref_date>");
xmlBuff.append("<bill_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("bill_no")) + "]]>").append("</bill_no>"); xmlBuff.append("<bill_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("bill_no")) + "]]>").append("</bill_no>");
xmlBuff.append("<bill_date>").append("<![CDATA[" + resultSet.getTimestamp("bill_date") != null?resultSet.getTimestamp("bill_date"):""+ "]]>").append("</bill_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
//xmlBuff.append("<bill_date>").append("<![CDATA[" + resultSet.getTimestamp("bill_date") != null?resultSet.getTimestamp("bill_date"):""+ "]]>").append("</bill_date>");
xmlBuff.append("<bill_date>").append("<![CDATA[" + billDateStr + "]]>").append("</bill_date>");
xmlBuff.append("<curr_code>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("curr_code") )+ "]]>").append("</curr_code>"); xmlBuff.append("<curr_code>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("curr_code") )+ "]]>").append("</curr_code>");
xmlBuff.append("<exch_rate>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("exch_rate")) + "]]>").append("</exch_rate>"); xmlBuff.append("<exch_rate>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("exch_rate")) + "]]>").append("</exch_rate>");
xmlBuff.append("<sundry_code>").append("<![CDATA[" + resultSet.getString("sundry_code") + "]]>").append("</sundry_code>"); xmlBuff.append("<sundry_code>").append("<![CDATA[" + resultSet.getString("sundry_code") + "]]>").append("</sundry_code>");
...@@ -387,7 +431,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -387,7 +431,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlBuff.append("<sundry_name>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("sundry_name")) + "]]>").append("</sundry_name>"); xmlBuff.append("<sundry_name>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("sundry_name")) + "]]>").append("</sundry_name>");
xmlBuff.append("<net_payable>").append("<![CDATA[" + resultSet.getDouble("net_payable") + "]]>").append("</net_payable>"); xmlBuff.append("<net_payable>").append("<![CDATA[" + resultSet.getDouble("net_payable") + "]]>").append("</net_payable>");
xmlBuff.append("<cheque_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("cheque_no")) + "]]>").append("</cheque_no>"); xmlBuff.append("<cheque_no>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("cheque_no")) + "]]>").append("</cheque_no>");
xmlBuff.append("<due_date>").append("<![CDATA[" + resultSet.getTimestamp("due_date")!= null ?resultSet.getTimestamp("due_date"):"" + "]]>").append("</due_date>"); //commented and added by Varsha V on 19-06-18 for conversion of date
//xmlBuff.append("<due_date>").append("<![CDATA[" + resultSet.getTimestamp("due_date")!= null ?resultSet.getTimestamp("due_date"):"" + "]]>").append("</due_date>");
xmlBuff.append("<due_date>").append("<![CDATA[" + dueDateStr + "]]>").append("</due_date>");
xmlBuff.append("<tran_ser>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_ser")) + "]]>").append("</tran_ser>"); xmlBuff.append("<tran_ser>").append("<![CDATA[" + checkNullAndTrim(resultSet.getString("tran_ser")) + "]]>").append("</tran_ser>");
xmlBuff.append("<unconfirm_amt>").append("<![CDATA[" + sumNetAmt + "]]>").append("</unconfirm_amt>"); xmlBuff.append("<unconfirm_amt>").append("<![CDATA[" + sumNetAmt + "]]>").append("</unconfirm_amt>");
pstmt1.clearParameters(); pstmt1.clearParameters();
...@@ -967,8 +1013,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -967,8 +1013,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
else else
{ {
errString = itmDBAccess.getErrorString( "", "VTNODF" , loginCode); /*errString = itmDBAccess.getErrorString( "", "VTNODF" , loginCode);
return errString; return errString; */ //Commented By Varsha V on 19-06-18
} }
System.out.println("purcOrder---["+purcOrder+"]effDate--["+effDate+"]billDate---["+billDate+"]"); System.out.println("purcOrder---["+purcOrder+"]effDate--["+effDate+"]billDate---["+billDate+"]");
...@@ -1035,7 +1081,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1035,7 +1081,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("effDt----["+effDt+"]"); System.out.println("effDt----["+effDt+"]");
java.util.Date billDt = billDate != null && billDate.trim().length() > 0 ?sdf.parse(genericUtility.getValidDateString(billDate, genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())):null; java.util.Date billDt = billDate != null && billDate.trim().length() > 0 ?sdf.parse(genericUtility.getValidDateString(billDate, genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())):null;
System.out.println("billDt--["+billDt+"]"); System.out.println("billDt--["+billDt+"]");
//if-else condition added by Varsha V on 19-06-18 as per suggested
if( crTerm != null && crTerm.length()>0)
{
discDate = finCommon.getCalcDiscountDate(crTerm, tranDt , effDt ,billDt , conn); discDate = finCommon.getCalcDiscountDate(crTerm, tranDt , effDt ,billDt , conn);
System.out.println("discDate----["+discDate+"]"); System.out.println("discDate----["+discDate+"]");
dateDiff = utilMethods.DaysAfter(discDate, tranDt); dateDiff = utilMethods.DaysAfter(discDate, tranDt);
...@@ -1075,8 +1123,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1075,8 +1123,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
startDate = billDate; startDate = billDate;
} }
try {
startDt = sdf.parse(startDate);
}
catch (Exception e) {
startDate = tranDate;
startDt = tranDt;
}
System.out.println("startDate-----["+startDate+"]"); System.out.println("startDate-----["+startDate+"]");
}
else
{
startDate = tranDate;
startDt = tranDt;
}
//if-else condition added by Varsha V on 19-06-18 as per suggested
System.out.println("startDt---["+startDt+"]tranDt---["+tranDt+"]discDate--["+discDate+"]"); System.out.println("startDt---["+startDt+"]tranDt---["+tranDt+"]discDate--["+discDate+"]");
if(tranDt.equals(startDt) || tranDt.after(startDt) && tranDt.equals(discDate) || tranDt.before(discDate)) if(tranDt.equals(startDt) || tranDt.after(startDt) && tranDt.equals(discDate) || tranDt.before(discDate))
{ {
...@@ -1092,7 +1153,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1092,7 +1153,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("adjAmt---["+adjAmt+"]"); System.out.println("adjAmt---["+adjAmt+"]");
System.out.println("dueDate---["+ dueDate +"]"); System.out.println("dueDate---["+ dueDate +"]");
dueDate = sdf.parse(genericUtility.getValidDateString(genericUtility.getColumnValueFromNode("due_date", parentNode1),genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())); System.out.println("genericUtility.getColumnValueFromNode(\"due_date\", parentNode1): "+genericUtility.getColumnValueFromNode("due_date", parentNode1));
//Changed by Varsha V on 19-06-18 because due date is in application date format
//dueDate = sdf.parse(genericUtility.getValidDateString(genericUtility.getColumnValueFromNode("due_date", parentNode1),genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()));
dueDate = sdf.parse(genericUtility.getColumnValueFromNode("due_date", parentNode1));
System.out.println("dueDate---["+ dueDate +"]"); System.out.println("dueDate---["+ dueDate +"]");
holdAmt = Double.parseDouble(genericUtility.getColumnValueFromNode("hold_amt", parentNode1)); holdAmt = Double.parseDouble(genericUtility.getColumnValueFromNode("hold_amt", parentNode1));
...@@ -1332,7 +1396,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1332,7 +1396,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
java.util.Date temp; java.util.Date temp;
if (startDate != null && startDate.trim().length()>0) if (startDate != null && startDate.trim().length()>0)
temp = (sdf.parse(genericUtility.getValidDateString(startDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()))); //Changed by Varsha V on 19-06-18 because start date is in application date format
//temp = (sdf.parse(genericUtility.getValidDateString(startDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())));
temp = (sdf.parse(startDate));
else else
temp = null; temp = null;
...@@ -1533,7 +1599,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1533,7 +1599,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
detailBuff.append("<stan_code>").append("<![CDATA[" + stanCode + "]]>").append("</stan_code>"); detailBuff.append("<stan_code>").append("<![CDATA[" + stanCode + "]]>").append("</stan_code>");
detailBuff.append("<tran_ser>").append("<![CDATA[" + mTranSer + "]]>").append("</tran_ser>"); detailBuff.append("<tran_ser>").append("<![CDATA[" + mTranSer + "]]>").append("</tran_ser>");
detailBuff.append("<vouch_no>").append("<![CDATA[" + mVouchNo + "]]>").append("</vouch_no>"); detailBuff.append("<vouch_no>").append("<![CDATA[" + mVouchNo + "]]>").append("</vouch_no>");
detailBuff.append("<vouch_date>").append("<![CDATA[" + genericUtility.getValidDateString(mVouchDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()) + "]]>").append("</vouch_date>"); //changed by Varsha on 19-06-18 because vouch_date in application date format
//detailBuff.append("<vouch_date>").append("<![CDATA[" + genericUtility.getValidDateString(mVouchDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()) + "]]>").append("</vouch_date>");
detailBuff.append("<vouch_date>").append("<![CDATA[" + mVouchDate + "]]>").append("</vouch_date>");
detailBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>"); detailBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>");
detailBuff.append("<net_amt>").append("<![CDATA["+ mPayAmt+ "]]>").append("</net_amt>"); detailBuff.append("<net_amt>").append("<![CDATA["+ mPayAmt+ "]]>").append("</net_amt>");
detailBuff.append("<pay_amt>").append("<![CDATA[ " + mPayAmt+"]]>").append("</pay_amt>"); detailBuff.append("<pay_amt>").append("<![CDATA[ " + mPayAmt+"]]>").append("</pay_amt>");
...@@ -2102,8 +2170,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2102,8 +2170,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
else else
{ {
errString = itmDBAccess.getErrorString( "", "VTNODF" , loginCode); /*errString = itmDBAccess.getErrorString( "", "VTNODF" , loginCode);
return errString; return errString; */ //Commented by varsha v as per suggested
} }
System.out.println("purcOrder---["+purcOrder+"]effDate--["+effDate+"]billDate---["+billDate+"]"); System.out.println("purcOrder---["+purcOrder+"]effDate--["+effDate+"]billDate---["+billDate+"]");
...@@ -2170,7 +2238,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2170,7 +2238,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("effDt----["+effDt+"]"); System.out.println("effDt----["+effDt+"]");
java.util.Date billDt = billDate != null && billDate.trim().length() > 0 ?sdf.parse(genericUtility.getValidDateString(billDate, genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())):null; java.util.Date billDt = billDate != null && billDate.trim().length() > 0 ?sdf.parse(genericUtility.getValidDateString(billDate, genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())):null;
System.out.println("billDt--["+billDt+"]"); System.out.println("billDt--["+billDt+"]");
//if-else condition added by Varsha V on 19-06-18 as per suggetsed
if( crTerm != null && crTerm.length()>0)
{
discDate = finCommon.getCalcDiscountDate(crTerm, tranDt , effDt ,billDt , conn); discDate = finCommon.getCalcDiscountDate(crTerm, tranDt , effDt ,billDt , conn);
System.out.println("discDate----["+discDate+"]"); System.out.println("discDate----["+discDate+"]");
dateDiff = utilMethods.DaysAfter(discDate, tranDt); dateDiff = utilMethods.DaysAfter(discDate, tranDt);
...@@ -2210,8 +2280,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2210,8 +2280,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
startDate = billDate; startDate = billDate;
} }
try {
startDt = sdf.parse(startDate);
}
catch (Exception e) {
startDate = tranDate;
startDt = tranDt;
}
System.out.println("startDate-----["+startDate+"]"); System.out.println("startDate-----["+startDate+"]");
}
else
{
startDate = tranDate;
startDt = tranDt;
}
//if-else condition added by Varsha V on 19-06-18 as per suggetsed
System.out.println("startDt---["+startDt+"]tranDt---["+tranDt+"]discDate--["+discDate+"]"); System.out.println("startDt---["+startDt+"]tranDt---["+tranDt+"]discDate--["+discDate+"]");
if(tranDt.equals(startDt) || tranDt.after(startDt) && tranDt.equals(discDate) || tranDt.before(discDate)) if(tranDt.equals(startDt) || tranDt.after(startDt) && tranDt.equals(discDate) || tranDt.before(discDate))
{ {
...@@ -2227,7 +2310,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2227,7 +2310,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("adjAmt---["+adjAmt+"]"); System.out.println("adjAmt---["+adjAmt+"]");
System.out.println("dueDate---["+ dueDate +"]"); System.out.println("dueDate---["+ dueDate +"]");
dueDate = sdf.parse(genericUtility.getValidDateString(genericUtility.getColumnValueFromNode("due_date", parentNode1),genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())); //Changed by Varsha V on 19-06-18 because due date is in application date format
//dueDate = sdf.parse(genericUtility.getValidDateString(genericUtility.getColumnValueFromNode("due_date", parentNode1),genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()));
dueDate = sdf.parse(genericUtility.getColumnValueFromNode("due_date", parentNode1));
System.out.println("dueDate---["+ dueDate +"]"); System.out.println("dueDate---["+ dueDate +"]");
holdAmt = Double.parseDouble(genericUtility.getColumnValueFromNode("hold_amt", parentNode1)); holdAmt = Double.parseDouble(genericUtility.getColumnValueFromNode("hold_amt", parentNode1));
...@@ -2467,7 +2553,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2467,7 +2553,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
java.util.Date temp; java.util.Date temp;
if (startDate != null && startDate.trim().length()>0) if (startDate != null && startDate.trim().length()>0)
temp = (sdf.parse(genericUtility.getValidDateString(startDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()))); //changed by Varsha on 19-06-18 because startDate in application date format
//temp = (sdf.parse(genericUtility.getValidDateString(startDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat())));
temp = (sdf.parse(startDate));
else else
temp = null; temp = null;
...@@ -2668,7 +2756,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2668,7 +2756,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
detailBuff.append("<stan_code>").append("<![CDATA[" + stanCode + "]]>").append("</stan_code>"); detailBuff.append("<stan_code>").append("<![CDATA[" + stanCode + "]]>").append("</stan_code>");
detailBuff.append("<tran_ser>").append("<![CDATA[" + mTranSer + "]]>").append("</tran_ser>"); detailBuff.append("<tran_ser>").append("<![CDATA[" + mTranSer + "]]>").append("</tran_ser>");
detailBuff.append("<vouch_no>").append("<![CDATA[" + mVouchNo + "]]>").append("</vouch_no>"); detailBuff.append("<vouch_no>").append("<![CDATA[" + mVouchNo + "]]>").append("</vouch_no>");
detailBuff.append("<vouch_date>").append("<![CDATA[" + genericUtility.getValidDateString(mVouchDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()) + "]]>").append("</vouch_date>"); //changed by Varsha on 19-06-18 because vouch_date in application date format
//detailBuff.append("<vouch_date>").append("<![CDATA[" + genericUtility.getValidDateString(mVouchDate,genericUtility.getDBDateTimeFormat(),genericUtility.getApplDateFormat()) + "]]>").append("</vouch_date>");
detailBuff.append("<vouch_date>").append("<![CDATA[" + mVouchDate + "]]>").append("</vouch_date>");
detailBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>"); detailBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>");
detailBuff.append("<net_amt>").append("<![CDATA["+ mPayAmt+ "]]>").append("</net_amt>"); detailBuff.append("<net_amt>").append("<![CDATA["+ mPayAmt+ "]]>").append("</net_amt>");
detailBuff.append("<pay_amt>").append("<![CDATA[ " + mPayAmt+"]]>").append("</pay_amt>"); detailBuff.append("<pay_amt>").append("<![CDATA[ " + mPayAmt+"]]>").append("</pay_amt>");
......
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