Commit 7a0ec001 authored by prane's avatar prane

nfCheckPeriod method overloaded to allow future date for specific series else return error

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205252 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a6ea38f7
......@@ -11,7 +11,10 @@ import java.sql.Timestamp;
import java.sql.Types;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
......@@ -11307,10 +11310,12 @@ public class FinCommon
postDate = (Timestamp)glTrace.get("tran_date");
System.out.println("siteCode>>>>>"+siteCode);
System.out.println("postDate>>>>>"+new java.util.Date(postDate.getTime()));
//Changes and Commented By Ajay on 12-01-2018:START
//errCode = validatorEJB.nfCheckPeriod("FIN",new java.util.Date(postDate.getTime()),siteCode);
errCode = nfCheckPeriod("FIN",new java.util.Date(postDate.getTime()),siteCode,conn);
//Changes and Commented By Ajay on 12-01-2018:END
//Pavan Rane 16aug19 start[added refSer as argument in signature]
System.out.println("In fincommon nfCheckPeriod refSer["+refSer+"]");
//errCode = nfCheckPeriod("FIN",new java.util.Date(postDate.getTime()),siteCode,conn);
errCode = nfCheckPeriod("FIN",refSer, new java.util.Date(postDate.getTime()),siteCode,conn);
//Pavan Rane 14aug19 end[added refSer as argument in signature]
if(errCode.trim().length() > 0){
errString = itmDBAccessEJB.getErrorString("",errCode,"","",conn);
return errString;
......@@ -15544,7 +15549,13 @@ public class FinCommon
* @return Error code if fails
* @exception ITMException
*/
public String nfCheckPeriod(String modCode, java.util.Date tranDate , String siteCode, Connection conn) throws RemoteException, ITMException
//Pavan Rane 14aug19 start [nfCheckPeriod method overloaded to allow future date for specific series else return error]
public String nfCheckPeriod(String modCode, java.util.Date tranDate , String siteCode, Connection conn) throws RemoteException, ITMException
{
String errString = nfCheckPeriod(modCode, "", tranDate , siteCode, conn);
return errString;
}
public String nfCheckPeriod(String modCode, String refSer, java.util.Date tranDate , String siteCode, Connection conn) throws RemoteException, ITMException
{
//Connection con = null;
String errCode = ""; //$NON-NLS-1$
......@@ -15560,6 +15571,8 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
String dateString = ""; //$NON-NLS-1$
PreparedStatement pstmt = null;
String allowFutureDate = "";
String allowFtrDtRefSer = "";
boolean allowFlag = false;
java.util.Date todayDate = null;
// System.out.println("modCode:"+modCode+"tranDate:"+tranDate+"\nsiteCode"+siteCode);
try
......@@ -15877,10 +15890,37 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
if(tranDate.after(todayDate))
{
allowFutureDate = checkNull(getFinparams("999999","ALW_FUTURE_DATE_TRAN",conn));
/*if(!(allowFutureDate.equalsIgnoreCase("Y")))
{
errCode = "VTPRDFDALW";
}*/
//Pavan Rane 14aug19 start [to allow future date for specific series else return error]
if(!(allowFutureDate.equalsIgnoreCase("Y")))
{
allowFtrDtRefSer = checkNull(getFinparams("999999","ALW_FUTURE_REF_TRAN",conn));
System.out.println("nfCheckPeriod..allowFtrDtRefSer["+allowFtrDtRefSer+"] refSer["+refSer+"]");
if ("NULLFOUND".equals(allowFtrDtRefSer))
{
errCode = "VTPRDFDALW";
} else
{
String allowFtrDtRefSerArr[] = allowFtrDtRefSer.split(",");
ArrayList<String> allowFtrDtRefSerList = new ArrayList<String>(Arrays.asList(allowFtrDtRefSerArr));
for( String refSerVar : allowFtrDtRefSerList )
{
if((refSerVar.trim().equalsIgnoreCase(refSer.trim())))
{
allowFlag = true;
break;
}
}
if(!allowFlag)
{
errCode = "VTPRDFDALW";
}
}
}
//Pavan Rane 14aug19 end [to allow future date for specific series else return error]
}
}
//Ended by Varsha V on 26-10-18 to return error if future date is not allowed
......
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