Commit ef19ca8c authored by cpatil's avatar cpatil

merging from branch


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101326 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 10de8712
[Dolphin]
SortOrder=1
SortRole=date
Timestamp=2016,4,20,12,6,40
Version=3
ViewMode=1
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.sql.*;
import java.text.*;
......@@ -8142,7 +8143,7 @@ public class FinCommon
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
String errCode = "",errString = "",finEntity = "",siteCode = "";
String errCode = "",errString = "",finEntity = "",siteCode = "",errCode1="";
String sundryType = "",sundryCode = "",acctCode = "",cctrCode = "";
String deptCode = "",currCode = "",empCode = "",analCode = "",projCode = "";
String refType = "",refSer = "",refId = "",remarks = "",partyDocRef = "";
......@@ -8293,6 +8294,20 @@ public class FinCommon
}
//ended by rajendra on 17/10/07
//Added By Dhiraj Chavan on 18-APR-2016
errCode1=isSiteCctr(siteCode,cctrCode,conn);
System.out.println("@@@@@@@@@@@@@@isSiteCctr@@@@@@@@@@@@@@@"+errCode1);
if(errCode1 != null && errCode1.trim().length() > 0)
{
System.out.println("@@@@@@@@@@@@@@isSiteCctr@@@@@@@@@@@@@@@"+errCode1);
errString = itmDBAccessEJB.getErrorString("",errCode1,"","",conn);
return errString;
}
//ended by Dhiraj Chavan
sql = "select acct_prd,code from period where fr_date <= ? and to_date >= ? ";
System.out.println("SQL : "+sql);
pstmt = conn.prepareStatement(sql);
......@@ -8524,6 +8539,110 @@ public class FinCommon
System.out.println("Returning String from glTraceUpdate ::"+errString);
return errString;
}
//Added By Dhiraj Chavan on 18-APR-2016
public String isSiteCctr(String siteCode,String cctrCode,Connection conn) throws ITMException//Added by Dhiraj Chavan 18/04/16
, SQLException, RemoteException
{
System.out.println("inside isSiteCctr");
String var_value="",active_yn="",activateyn_flag="",errCode="",errString="";
long ll_cnt=0;
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
String sql="";
ITMDBAccessEJB itmDBAccessEJB =null;
itmDBAccessEJB= new ITMDBAccessEJB();
/*ValidatorEJB validatorEJB = new ValidatorEJB();*/
FinCommon fimcommon=new FinCommon();
var_value =fimcommon.getFinparams("999999","SITE_SPECIFIC_CCTR",conn);
System.out.println("@@@@@fimcommon.getFinparams@@@@"+var_value);
if(var_value==null || var_value.trim().length() == 0)
{
var_value="N";
System.out.println("@@getFinparams@@ckecking null"+var_value);
}
if(var_value.equals("Y") || var_value.equalsIgnoreCase("Y"))
{
sql="select count(1) from site_cctr where site_code=? and cctr_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,cctrCode);
rs = pstmt.executeQuery();
if(rs.next()){
ll_cnt=rs.getInt(1);
}
System.out.println("Count@Dhiraj code@@ll_cnt"+ll_cnt);
sql=null;
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if(ll_cnt > 0)
{
sql="select active_yn from site_cctr where site_code=? and cctr_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,cctrCode);
rs = pstmt.executeQuery();
if(rs.next()){
active_yn=rs.getString(1);
}
sql=null;
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("In if (ll_cnt > 0)"+sql+"@@active_yn"+active_yn);
}
if(active_yn.equals("N")||active_yn.equalsIgnoreCase("N"))
{
errCode="VTCCTRBLK";
}
}else
{
sql="select active_yn from site_cctr where site_code=? and cctr_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,cctrCode);
rs = pstmt.executeQuery();
if(rs.next()){
active_yn=rs.getString(1);
}
sql=null;
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if(active_yn.equals("N")||active_yn.equalsIgnoreCase("N"))
{
errCode="VTCCTRBLK";
}
}
return errCode;
}
//Ended By Dhiraj Dhiraj on 18-April-2016
//nvo_business_object_fin - gbf_get_project()
public String getProject(String refSer,String refId,Connection conn) throws ITMException//Added by Jiten
{
......@@ -9588,7 +9707,151 @@ public class FinCommon
System.out.println("Returning Strung :"+errString);
return errString;
}
public double getRequiredDecimal(double actVal, int prec) //Added by Jiten
//nvo_business_object_fin - gbf_check_gltran_drcr()
public String checkGlTranDrCrPreview(String refSer,String refId,Connection conn) throws ITMException //Added by Jiten
{
Statement stmt = null;
ResultSet rs = null;
double drAmt = 0,crAmt = 0,exch = 0;
double totDrAmt = 0,totCrAmt = 0,diffAmt = 0;
String sql = "",errString = "",postOnLine = "",acct = "",cctr = "";
ITMDBAccessEJB itmDBAccessEJB = null;
// GenericUtility genericUtility = null;
SimpleDateFormat sdf = null;
HashMap glTran = null;
try{
stmt = conn.createStatement();
// genericUtility = new GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
sql = "select case when dr_amt is null then 0 else dr_amt end * exch_rate," +
"case when cr_amt is null then 0 else cr_amt end * exch_rate " +
"from gltrace_preview where ref_ser = '"+refSer+"' and ref_id = '"+refId+"'";
System.out.println("SQL :"+sql);
rs = stmt.executeQuery(sql);
while(rs.next()){
drAmt = getRequiredDecimal(rs.getDouble(1), 2);
crAmt = getRequiredDecimal(rs.getDouble(2), 2);
totDrAmt = totDrAmt + drAmt;
totCrAmt = totCrAmt + crAmt;
totDrAmt = getRequiredDecimal(totDrAmt, 2);
totCrAmt = getRequiredDecimal(totCrAmt, 2);
//System.out.println("debitAmt----"+drAmt+"--creditAmt---"+crAmt+"---Total Debit Amt---"+totDrAmt+"---Total Credit Amt---"+totCrAmt);
}
rs.close();
if(totDrAmt == totCrAmt){
return "";
}
diffAmt = totDrAmt - totCrAmt;
diffAmt=getRequiredDecimal(diffAmt, 2);
System.out.println("Difference Amount----"+diffAmt);
//Added by Manoj dtd 27/06/2014 to check coin differemce limit
String coinDiffLimit=getFinparams("999999", "COIN_DIFF_LIMIT", conn);
coinDiffLimit=coinDiffLimit==null?"":coinDiffLimit;
if(coinDiffLimit.trim().length() == 0 || coinDiffLimit.trim().equalsIgnoreCase("NULLFOUND"))
{
coinDiffLimit = "1";
}
// if(Math.abs(diffAmt) > 1){
//Changed by Manoj dtd 27/06/2014 to check coin differemce limit
if(Math.abs(diffAmt) > Double.parseDouble(coinDiffLimit))
{
errString = itmDBAccessEJB.getErrorString("","VCOINDIFF1","","",conn);
return errString;
}
postOnLine = getFinparams("999999","POST_ON_LINE",conn);
if(postOnLine.equalsIgnoreCase("NULLFOUND")){
errString = itmDBAccessEJB.getErrorString("","VTENVAR1","","",conn);
return errString;
}else{
postOnLine = postOnLine.substring(0,1);
if("Y_N".indexOf(postOnLine) == -1){
errString = itmDBAccessEJB.getErrorString("","VTENVAR1","","",conn);
return errString;
}
}
if(postOnLine.equalsIgnoreCase("Y")){
acct = getFinparams("999999","COIN_ACCT",conn);
if(acct.equalsIgnoreCase("NULLFOUND")){
errString = itmDBAccessEJB.getErrorString("","VSENVAR1","","",conn);
return errString;
}
cctr = getFinparams("999999","COIN_CCTR",conn);
if(cctr.equalsIgnoreCase("NULLFOUND")){
cctr = "";
}
//acct = acct.substring(0,10);
//cctr = cctr.substring(0,4);
/*
sql = "select gltrace.tran_date, gltrace.eff_date, gltrace.fin_entity," +
"gltrace.acct_prd, gltrace.prd_code, gltrace.remarks," +
"gltrace.site_code, gltrace.entry_batch_no," +
"finent.curr_code " +
"from gltrace, finent where ( gltrace.fin_entity = finent.fin_entity ) and " +
"( gltrace.ref_ser = '"+refSer+"' ) and " +
"( gltrace.ref_id = '"+refId+"' )";
System.out.println("SQL :"+sql);
rs = stmt.executeQuery(sql);
if(rs.next()){
glTran = new HashMap();
glTran.put("tran_date",rs.getTimestamp(1));
glTran.put("eff_date",rs.getTimestamp(2));
glTran.put("fin_entity",rs.getString(3));
glTran.put("acct_prd",rs.getString(4));
glTran.put("prd_code",rs.getString(5));
glTran.put("remarks",rs.getString(6));
glTran.put("site_code",rs.getString(7));
glTran.put("tran_id__trace",rs.getString(8));
glTran.put("entry_batch_no",rs.getString(8));
glTran.put("curr_code",rs.getString(9));
}
glTran.put("acct_code",acct);
glTran.put("cctr_code",cctr);
glTran.put("emp_code","");
glTran.put("anal_code","");
glTran.put("proj_code","");
glTran.put("dept_code","");
if(diffAmt > 0){
glTran.put("dr_amt","0");
glTran.put("cr_amt",Double.toString(diffAmt));
}else{
glTran.put("dr_amt",Double.toString(0 - diffAmt));
glTran.put("cr_amt","0");
}
glTran.put("ref_ser",refSer);
glTran.put("ref_id",refId);
exch = 1;
glTran.put("dr_amt_base",Double.toString(exch * Double.parseDouble(glTran.get("dr_amt").toString())));
glTran.put("cr_amt_base",Double.toString(exch * Double.parseDouble(glTran.get("cr_amt").toString())));
errString = glTranUpdate(glTran,conn);
*/
}
}catch(Exception e){
System.out.println("Exception in checkGlTranDrCr [FinCommon]"+e);
e.printStackTrace();
throw new ITMException(e);
}finally{
try{
if(rs != null){rs.close();rs = null;}
if(stmt != null){stmt.close();stmt = null;}
}catch(Exception t){}
}
System.out.println("checkGlTranDrCrPreview errString :"+errString);
return errString;
}
public double getRequiredDecimal(double actVal, int prec) //Added by Jiten
{
NumberFormat numberFormat = NumberFormat.getIntegerInstance ();
Double DoubleValue = new Double (actVal);
......
......@@ -229,7 +229,9 @@ public class PayrollVoucherComIc extends ValidatorEJB implements PayrollVoucherC
double exchrate=0;
sitecode = genericUtility.getColumnValue("site_code__to",dom);
trandt = genericUtility.getColumnValue("tran_date__fr",dom);
sql="select a.curr_code from finent a, site b where b.fin_entity = a.fin_entity and b.site_code = ?";
currcodebase= genericUtility.getColumnValue("curr_code", dom);
System.out.println("Currency Code is"+ currcodebase );
/* sql="select a.curr_code from finent a, site b where b.fin_entity = a.fin_entity and b.site_code = ?";
System.out.println("SQL :: "+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sitecode);
......@@ -243,7 +245,7 @@ public class PayrollVoucherComIc extends ValidatorEJB implements PayrollVoucherC
pstmt.close();
pstmt = null;
currcode = genericUtility.getColumnValue("curr_code",dom);
valueXmlString.append("<curr_code>").append(currcodebase).append("</curr_code>\r\n");
valueXmlString.append("<curr_code>").append(currcodebase).append("</curr_code>\r\n");*/
sql="select descr from currency where curr_code = ?";
System.out.println("SQL :: "+sql);
pstmt = conn.prepareStatement(sql);
......@@ -258,20 +260,7 @@ public class PayrollVoucherComIc extends ValidatorEJB implements PayrollVoucherC
pstmt.close();
pstmt = null;
System.out.println("currdescr1 :: "+currdescr1);
valueXmlString.append("<descr>").append(currdescr1).append("</descr>\r\n");
if(currcodebase != null && currcodebase.trim().length() > 0)
{
exchrate=finCommon.getDailyExchRateSellBuy( currcode,currcodebase,sitecode,trandt,"B",conn);
valueXmlString.append("<exch_rate>").append(exchrate).append("</exch_rate>\r\n");
}
if(currcodebase != currcode)
{
valueXmlString.append("<exch_rate protect = \"0\">").append("<![CDATA[" + exchrate + "]]>").append("</exch_rate >");
}
else
{
valueXmlString.append("<exch_rate protect = \"1\">").append("<![CDATA[" + exchrate + "]]>").append("</exch_rate >");
}
valueXmlString.append("<curr_descr>").append(currdescr1).append("</curr_descr>\r\n");
}
else if(currentColumn.equalsIgnoreCase("site_code__fr"))
{
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,6 +15,6 @@ import javax.ejb.Local;
public interface PurchaseVoucherGltracePreviewLocal extends ActionHandlerLocal
{
public String preview(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String preview(String tranID,String xtraParams, String forcedFlag, Connection conn) throws RemoteException,ITMException;
}
......@@ -14,6 +14,6 @@ import javax.ejb.Remote;
@Remote
public interface PurchaseVoucherGltracePreviewRemote extends ActionHandlerRemote
{
public String preview(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String preview(String tranID,String xtraParams, String forcedFlag, Connection conn) throws RemoteException,ITMException;
}
[Dolphin]
SortOrder=1
SortRole=date
Sorting=2
Timestamp=2014,1,29,14,59,8
Timestamp=2016,4,20,12,7,43
Version=3
ViewMode=1
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,6 +4,7 @@
package ibase.webitm.ejb.fin.adv;
import ibase.webitm.utility.*;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
......@@ -37,7 +38,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
{ //PayVoucherComPrc
DistCommon distCommonObj = new DistCommon();
GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String process() throws RemoteException,ITMException
{
......@@ -53,7 +54,6 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
try
{
DistCommon distCommonObj = new DistCommon();
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
if(xmlString != null && xmlString.trim().length()!=0)
......@@ -105,17 +105,16 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
tabSeparatedData.append("<description>").append("Group0 description").append("</description>");
tabSeparatedData.append("<Header0>");
ConnDriver connDriver = new ConnDriver();
GenericUtility genericUtility = GenericUtility.getInstance();
//StringBuffer tabSeparatedData = new StringBuffer();
String userId = "",benefitType ="",freightType="",chargeType="",sqlItemCodeAl="",sqlItem="",siteCode = "",suppCodefr ="",acctCode ="";
String cctrCode ="",acctCodeadl ="",cctrCodeadl ="",currCode="";
String exchrate="";
String sitecodefr ="",siteCodeto ="",taxClass ="", taxChap="",taxEnv="",postVouch ="",remark="";
String sitecodefr ="",siteCodeto ="",taxClass ="", taxChap="",taxEnv="",postVouch ="",remark="",payableSite="";
String frDate="", toDate="" ,procdate="", pucOrder="";;
int count = 0;
String ordDate="",suppcode="",suppname="",itemcode="",lineno="",quantity="",unit="",taxamt="";
boolean recFound =false;
int cntact=0,cntcctr=0,cntsite=0,cntcurr=0;
int cntact=0,cntcctr=0,cntsite=0,cntcurr=0,cntsupfr=0,cntsupto=0,cntpayable=0;
int cntF=0,cntL=0,cntC=0;
SimpleDateFormat sdf = null;
try
......@@ -146,53 +145,128 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
toDate = GenericUtility.getInstance().getColumnValue("tran_date__to",headerDom);
procdate = GenericUtility.getInstance().getColumnValue("proc_date",headerDom);
singleVoucher = GenericUtility.getInstance().getColumnValue("single_voucher",headerDom);
payableSite = GenericUtility.getInstance().getColumnValue("site_code",headerDom);
System.out.println("tran_date__fr "+ frDate);
System.out.println("toDate"+ toDate);
//===============Convert date to TimeStamp date format===========
Timestamp dateFrom = null,dateTo = null;
Object date = null;
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
date = sdf.parse(frDate);
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
dateFrom = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
date = sdf.parse(toDate);
dateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
System.out.println(" DB dateFrom=>"+dateFrom+"=DB date to=>"+dateTo);
if(acctCode == null || acctCode.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("acct_code","VMACCODE1",userId);
return errString;
}
else
{
sql="select count(*) from accounts where acct_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cntact=rs.getInt(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("cntact" + cntact);
System.out.println("acctCode" + acctCode);
if(cntact==0)
{
errString = itmDBAccess.getErrorString("acct_code","VMACTCDMT",userId);
return errString;
}
}
//===============================================================
if(sitecodefr == null || sitecodefr.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("site_code__fr","VMSITECDFR",userId);
return errString;
}
else
{
sql="select count(*) from site where site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sitecodefr);
rs = pstmt.executeQuery();
if(rs.next())
{
cntsupfr=rs.getInt(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("cntsupfr" + cntsupfr);
System.out.println("site_code" + sitecodefr);
if(cntsupfr==0)
{
errString = itmDBAccess.getErrorString("site_code__fr","VMSITE",userId);
return errString;
}
}
if(siteCodeto == null || siteCodeto.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("site_code__to","VMSITECDTO",userId);
return errString;
}
else
{
sql="select count(*) from site where site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeto);
rs = pstmt.executeQuery();
if(rs.next())
{
cntsupto=rs.getInt(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
// String frDate1 = GenericUtility.getInstance().getValidDateString(frDate.substring(0,8),GenericUtility.getInstance().getApplDateFormat(),GenericUtility.getInstance().getDBDateFormat());
//String toDate1 = GenericUtility.getInstance().getValidDateString(toDate.substring(0,8),GenericUtility.getInstance().getApplDateFormat(),GenericUtility.getInstance().getDBDateFormat());
//System.out.println("FromDate :["+frDate1+"]");
//System.out.println("ToDate :["+toDate1+"]");
//Timestamp frDateTimestamp = Timestamp.valueOf(frDate1+" 00:00:00");
//Timestamp toDateTimestamp = Timestamp.valueOf(toDate1+" 00:00:00");
//// -------------Validation
if(acctCode!= null && acctCode.trim().length() > 0)
{
sql="select count(*) from accounts where acct_code=?";
System.out.println("cntsupto" + cntsupto);
System.out.println("siteCodeto" + siteCodeto);
if(cntsupto==0)
{
errString = itmDBAccess.getErrorString("site_code__to","VMSITE",userId);
return errString;
}
}
if(payableSite == null || payableSite.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("site_code","VMPSITECD",userId);
return errString;
}
else
{
sql="select count(*) from site where site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCode);
pstmt.setString(1, payableSite);
rs = pstmt.executeQuery();
if(rs.next())
{
cntact=rs.getInt(1);
cntpayable=rs.getInt(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
System.out.println("cntact" + cntact);
System.out.println("acctCode" + acctCode);
if(cntact==0)
System.out.println("cntpayable" + cntpayable);
System.out.println("payableSite" + payableSite);
if(cntpayable==0)
{
errString = itmDBAccess.getErrorString("acct_code","ACCT01",userId);
errString = itmDBAccess.getErrorString("site_code","VMSITE",userId);
return errString;
}
}
if(cctrCode!= null && cctrCode.trim().length() > 0)
{
}
if(cctrCode == null || cctrCode.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("cctr_code","VMCCTRE",userId);
return errString;
}
else
{
sql="select count(*) from costctr where cctr_code= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCode);
......@@ -209,17 +283,24 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
System.out.println("cntcctr" + cntcctr);
if(cntcctr == 0)
{
errString = itmDBAccess.getErrorString("cctr_code","VTCCTR",userId);
errString = itmDBAccess.getErrorString("cctr_code","VTCCTR1",userId);
return errString;
}
}
if(suppCodefr!= null && suppCodefr.trim().length() > 0)
{
}
System.out.println("suppCodefr"+ suppCodefr);
System.out.println("chargeType"+ chargeType);
if(chargeType.equalsIgnoreCase("F"))
{
sql="select count(*) from transporter where tran_code=?";
if(suppCodefr == null || suppCodefr.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("supp_code__fr","VMTRANCD1",userId);
return errString;
}
else
{
sql="select count(*) from transporter where tran_code= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCodefr);
rs = pstmt.executeQuery();
......@@ -231,13 +312,24 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
rs=null;
pstmt.close();
pstmt=null;
if(cntF <= 0)
System.out.println("cntF" + cntF);
System.out.println("suppCodefr" + suppCodefr);
if(cntF == 0)
{
errString = itmDBAccess.getErrorString("supp_code__fr","VMSITE1",userId);
errString = itmDBAccess.getErrorString("supp_code__fr","VTTRANS1",userId);
return errString;
}
}
}
else if(chargeType.equalsIgnoreCase("L"))
{
if(suppCodefr == null || suppCodefr.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("supp_code__fr","NULLSUPPCD",userId);
return errString;
}
else
{
sql="select count(*) from supplier where supp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCodefr);
......@@ -250,11 +342,15 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
rs=null;
pstmt.close();
pstmt=null;
if(cntL <= 0)
System.out.println("cntL" + cntL);
System.out.println("suppCodefr" + suppCodefr);
if(cntL == 0)
{
errString = itmDBAccess.getErrorString("supp_code__fr","VTSUPP1",userId);
return errString;
}
}
}
else if(chargeType.equalsIgnoreCase("C"))
......@@ -271,15 +367,20 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
rs=null;
pstmt.close();
pstmt=null;
if(cntC <= 0)
if(cntC < 0)
{
errString = itmDBAccess.getErrorString("supp_code__fr","VTTAXAUTH",userId);
//return errString;
}
}
}
if(currCode!= null && currCode.trim().length() > 0)
{
if(currCode == null || currCode.trim().length() == 0 )
{
errString = itmDBAccess.getErrorString("curr_code","VTCURR",userId);
return errString;
}
else
{
sql="select count(*) from currency where curr_code= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
......@@ -294,12 +395,14 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
pstmt=null;
if(cntsite == 0)
{
errString = itmDBAccess.getErrorString("curr_code","VTCURR1",userId);
errString = itmDBAccess.getErrorString("curr_code","CURRCODNE",userId);
return errString;
}
}
}
if(frDate == null || toDate == null)
{
errString = itmDBAccess.getErrorString("","VEDATE",userId);
return errString;
}
else
......@@ -317,8 +420,26 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
if (fromUtilDate.after(toUtilDate))
{
errString = itmDBAccess.getErrorString("","VFRTODATE",userId);
return errString;
}
}
Timestamp dateFrom = null,dateTo = null;
Object date = null;
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
date = sdf.parse(frDate);
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
dateFrom = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
date = sdf.parse(toDate);
dateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
System.out.println(" DB dateFrom=>"+dateFrom+"=DB date to=>"+dateTo);
/* if(dateTo != null && dateTo.before(dateFrom))
{
System.out.println("In COndition");
errString = itmDBAccessEJB.getErrorString("","VTDATE6 ",userId);
return errString;
}*/
String suppCodefr1="";
System.out.println("CHARGE TYPE" + chargeType);
suppCodefr1 = genericUtility.getColumnValue("supp_code__fr",headerDom);
......@@ -422,7 +543,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"pur_exp_reco.ref_id = despatch.desp_id and pur_exp_reco.charge_type = 'F' ))and" +
" ( despatch.site_code >='"+sitecodefr+"' ) AND " +
"( despatch.site_code <= '"+siteCodeto+"') AND " +
/* "( despatch.desp_date >= '"+dateFrom+"' ) AND " +
/* ibase3-webitm-fin5-7-0-34 "( despatch.desp_date >= '"+dateFrom+"' ) AND " +
"( despatch.desp_date <= '"+dateTo+"') AND " + */
"( despatch.desp_date >= ? ) AND " +
"( despatch.desp_date <= ?) AND " +
......@@ -596,8 +717,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
tabSeparatedData.append ("<ref_line_no>").append("<![CDATA[" + (rs.getString(25)==null?" ":rs.getString(25)) +"]]>").append("</ref_line_no>");
errString = tabSeparatedData.toString();
System.out.println("Count is #########"+count);
tabSeparatedData.append("</Detail2>");
tabSeparatedData.append("</Detail2>");
}
rs.close();
rs = null;
......@@ -616,7 +736,6 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"' ' as stan_fr,' ' as stan_to, '' as tran_id, " +
"' ' as gross_weight," +
" ' ' as no_art," +
"' ' as frt_amt ," +
" porddet.tot_amt," +
"0 flag_onoff ,' ' as bill_no ," +
"' ' as bill_date,porder.curr_code, " +
......@@ -706,53 +825,10 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
}
else
{
System.out.println("Sql:::::is Null ::::::::::::::");
errString = itmDBAccessEJB.getErrorString("","VTNOREC1","","",conn);
}
if(chargeType.equalsIgnoreCase("F"))
else if(chargeType.equalsIgnoreCase("F"))
{
System.out.println("freightType" +freightType);
if(freightType.equalsIgnoreCase("1"))
{
/*dw_data.dataobject = 'd_pur_exp_reco_freight'*/
sql = "select despatch.lr_no," +
"despatch.lr_date," +
"( case when despatch.stan_code__init is NULL then fn_station_descr(' ',despatch.stan_code__init) else despatch.dlv_city end ) as stan_fr," +
"despatch.desp_id," +
"(case when despatch.gross_weight is null then 0 else despatch.gross_weight end)," +
"(case when despatch.no_art is null then 0 else despatch.no_art end), " +
"(case when despatch.freight is null then 0 else despatch.freight end )," +
" (case when despatch.freight is null then 0 else despatch.freight end ) ," +
" ' ' as bill_no ," +
"0 flag_onoff," +
"despatch.curr_code," +
"despatch.site_code," +
"' ' as tran_date," +
"' ' as ord_date," +
"' ' as supp_code," +
"' ' as supp_name ," +
"' ' as descr," +
"' ' as item_code," +
"' ' as quantity ," +
"'S-DSP' as ref_ser, "+
" 0 AS exp_amt , " +
" 0 as clg_chg ," +
"0 as adl_amount , " +
"' ' as line_no FROM despatch, sorder " +
" WHERE ( sorder.sale_order = despatch.sord_no ) and " +
"(despatch.desp_id not in (select pur_exp_reco.ref_id from pur_exp_reco where pur_exp_reco.ref_ser = 'S-DSP' and pur_exp_reco.ref_id = despatch.desp_id and pur_exp_reco.charge_type = 'F' )) and " +
"(despatch.site_code >= '"+sitecodefr+"') and " +
" (despatch.site_code <= '"+siteCodeto+"') " +
"and (despatch.desp_date >= ?) " +
"and (despatch.desp_date <= ?) " +
"and (LTRIM(RTRIM(despatch.curr_code__frt)) = '"+currCode+"')" +
" and (despatch.confirmed = 'Y') " +
"and" +
"(sorder.frt_term IN ('P','B')) ";
}
else if(freightType.equalsIgnoreCase("2"))
if(freightType.equalsIgnoreCase("1"))
{
sql="select porcp.lr_no ," +
"porcp.lr_date," +
......@@ -766,10 +842,10 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"' ' as bill_no , " +
"porcp.curr_code, " +
"porcp.site_code," +
"'' as tran_date," +
"porcp.tran_date," +
"' ' as ord_date," +
"' ' as supp_code," +
"' ' as supp_name ," +
"porcp.supp_code," +
"supplier.supp_name ," +
"' ' as descr," +
"' ' as item_code," +
"' ' as quantity, " +
......@@ -781,7 +857,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
" WHERE ( porcp.tran_id not in (select pur_exp_reco.ref_id from pur_exp_reco where pur_exp_reco.ref_ser ='P-RCP' and " +
" pur_exp_reco.ref_id = porcp.tran_id and pur_exp_reco.charge_type = 'F'))" +
" and ( porcp.supp_code = supplier.supp_code ) and" +
"( porcp.tran_date <= ?) and " +
"( porcp.tran_date >= ?) and " +
"( porcp.tran_date <= ?) and " +
"( porcp.site_code >= '"+ sitecodefr + "') and " +
"( porcp.site_code <= '"+ siteCodeto +"') and" +
......@@ -791,7 +867,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"( porcp.freight_status IN ('T','B','T') ) and" +
"( porcp.confirmed = 'Y')";
}
else if(freightType.equalsIgnoreCase("3"))
else if(freightType.equalsIgnoreCase("2"))
{
sql="select porcp.lr_no," +
"porcp.lr_date," +
......@@ -806,10 +882,10 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
" ' ' as bill_no," +
" porcp.curr_code," +
"porcp.site_code," +
"'' as tran_date," +
"porcp.tran_date," +
"' ' as ord_date," +
"' ' as supp_code," +
"' ' as supp_name ," +
"porcp.supp_code," +
"supplier.supp_name ," +
"' ' as descr," +
"' ' as item_code," +
"' ' as quantity ," +
......@@ -821,7 +897,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"WHERE ( porcp.tran_id not in (select pur_exp_reco.ref_id from pur_exp_reco where pur_exp_reco.ref_ser ='P-RET' and " +
" pur_exp_reco.ref_id = porcp.tran_id and pur_exp_reco.charge_type = 'F')) " +
"and ( porcp.supp_code = supplier.supp_code ) and" +
"( porcp.tran_date <= ?) AND" +
"( porcp.tran_date >= ?) AND" +
"( porcp.tran_date <= ?) AND" +
"( porcp.site_code >= '"+ sitecodefr + "') AND " +
"( porcp.site_code <= '"+ siteCodeto +"') and" +
......@@ -831,7 +907,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"( porcp.freight_status IN ('P','B','T') ) and" +
"( porcp.confirmed = 'Y')";
}
else if(freightType.equalsIgnoreCase("4"))
else if(freightType.equalsIgnoreCase("3"))
{
sql="select distord_iss.lr_no, distord_iss.lr_date,fn_station_descr(distord_iss.site_code,' ') ," +
" fn_station_descr(distord_iss.site_code__dlv, ' ')," +
......@@ -843,7 +919,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
" 0 flag_onoff ," +
" ' ' as bill_no ," +
"distord_iss.curr_code as curr_code, " +
" distord_iss.site_code,'' as tran_date," +
" distord_iss.site_code,distord_iss.tran_date," +
"' ' as ord_date,' ' as supp_code," +
"' ' as supp_name ,' ' as descr,' ' as item_code,'' as quantity, " +
"'D-ISS' as ref_ser, "+
......@@ -861,7 +937,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
" distord_iss.confirmed = 'Y' and" +
"( distord_iss.frt_type IN ('P','B'))";
}
else if(freightType.equalsIgnoreCase("5"))
else if(freightType.equalsIgnoreCase("4"))
{
sql="select distord_rcp.lr_no , " +
......@@ -877,7 +953,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"' ' as bill_no," +
" distord_rcp.curr_code," +
"distord_rcp.site_code," +
"' ' as tran_date," +
"distord_rcp.tran_date," +
"' ' as ord_date," +
"' ' as supp_code," +
"' ' as supp_name ," +
......@@ -900,7 +976,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"( distord_rcp.confirmed = 'Y')";
System.out.println("Executing SQL :: "+sql);
}
else if(freightType.equalsIgnoreCase("6"))
else if(freightType.equalsIgnoreCase("5"))
{
//dw_data.dataobject = 'd_pur_exp_coniss_freight'
......@@ -939,12 +1015,12 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"( consume_iss.freight_type IN ('P','B'))";
}
else if(freightType.equalsIgnoreCase("7"))
else if(freightType.equalsIgnoreCase("6"))
{
sql="select sreturn.lr_no," +
" sreturn.lr_date," +
"fn_station_descr(' ', customer.stan_code)," +
"fn_station_descr(sreturn.site_code, ' '),sreturn.tran_id," +
"fn_station_descr(sreturn.site_code, ' '),sreturn.tran_id,sreturn.tran_id as tran_id," +
" 0 gross_weight ,"+
" 0 no_art ,"+
"(case when sreturn.frt_amt is null then 0 else sreturn.frt_amt end)," +
......@@ -952,7 +1028,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
" ' ' as bill_no," +
"sreturn.curr_code, " +
"sreturn.site_code," +
"'' as tran_date," +
"sreturn.tran_date," +
"' ' as ord_date," +
"' ' as supp_code," +
"' ' as supp_name ," +
......@@ -967,7 +1043,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
"WHERE ( sreturn.tran_id not in (select pur_exp_reco.ref_id from pur_exp_reco where pur_exp_reco.ref_ser ='S-RET' and " +
" pur_exp_reco.ref_id = sreturn.tran_id and pur_exp_reco.charge_type = 'F')) " +
"and ( sreturn.cust_code = customer.cust_code ) and" +
"( sreturn.tran_date <= ?) and" +
"( sreturn.tran_date >= ?) and" +
"( sreturn.tran_date <= ?) and" +
"( sreturn.site_code >= '"+ sitecodefr + "') and " +
"( sreturn.site_code <= '"+ siteCodeto +"') and" +
......@@ -1016,6 +1092,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
tabSeparatedData.append ("<ref_line_no>").append("<![CDATA[" + (rs.getString(25)==null?" ":rs.getString(25)) +"]]>").append("</ref_line_no>");
errString = tabSeparatedData.toString();
System.out.println("#####Counter#####"+ count);
System.out.println("IF");
tabSeparatedData.append("</Detail2>");
}
rs.close();
......@@ -1092,7 +1169,6 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
{
Document detailDom = null;
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
String retStr = "";
try
......@@ -1164,7 +1240,6 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
Statement st = null;
String errFrSret ="";
String frsFlag=null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();//Added by Jaimin 30/08/2007 requst-ID :DI78DIS028
Connection conn= null;//Added by Jaimin 30/08/2007 requst-ID :DI78DIS028
String type = genericUtility.getColumnValue("single_voucher",headerDom);//Added by jaimin 01/09/2007 requst-ID :DI78DIS028
......@@ -1296,6 +1371,8 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
lscurrcode = genericUtility.getColumnValue("curr_code",headerDom);
lssitefr = genericUtility.getColumnValue("site_code__fr",headerDom);
lssiteto = genericUtility.getColumnValue("site_code__to",headerDom);
postVouch = genericUtility.getColumnValue("post_vouch",headerDom);
System.out.println("Post voucher" +postVouch);
lstaxclass = checkNull(genericUtility.getColumnValue("tax_class",headerDom));
System.out.println("Tax Class@@@@@@@"+ lstaxclass);
lstaxchap = checkNull(genericUtility.getColumnValue("tax_chap",headerDom));
......@@ -1695,7 +1772,8 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
}
else
{
errString = itmDBAccessEJB.getErrorString("","VTAMT","","",conn);
errString = itmDBAccessEJB.getErrorString("","VTAMTNULL","","",conn);
return errString;
}
int z=0;
for(int n = 0;n < nodeListLength;n++)
......@@ -1707,7 +1785,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
String trandate1="",trandate2="",refdate1="",refdate2,tranID="",lssitecodedet="";
lcamt1 = GenericUtility.getInstance().getColumnValueFromNode("amount",detailNode);
System.out.println("lcamt1@@@@@" + lcamt1);
lcamt=Double.parseDouble(lcamt1);
lcamt = lcamt1 == null ? 0 : Double.parseDouble(lcamt1);
System.out.println("lcamt@@@" + lcamt);
lcamount = lcamount + lcamt;
trandate1 = GenericUtility.getInstance().getColumnValueFromNode("proc_date",detailNode);
......@@ -1805,6 +1883,8 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
pstmt = null;
}
else
{
sql = "insert into pur_exp_reco (tran_id,tran_date,site_code,ref_ser, ref_id ,ref_date ,charge_type ,curr_code ," +
" exch_rate , amount , net_amt ,net_amt__bc,tax_amt ,tax_class ,tax_chap,tax_env ," +
"chg_date ,chg_user, chg_term , confirmed ,conf_date,emp_code__aprv,bill_no,bill_date,lr_no)" +
......@@ -1844,12 +1924,16 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
System.out.println("Insert multiple Voucher count " + a);
pstmt.close();
pstmt = null;
}
z++;
System.out.println("Successfully INSERT into Payrol Voucher..................");
System.out.println("Z count" +z);
}
postVouch = genericUtility.getColumnValue("post_vouch",headerDom);
System.out.println("postVouch.equalsIgnoreCase()"+postVouch);
if(errString.length()==0 && postVouch.equalsIgnoreCase("Y"));
System.out.println("PostVoucher Condition value is"+ postVouch);
System.out.println("errString.length()==0"+ postVouch);
if( "Y".equalsIgnoreCase(postVouch))
{
System.out.println("PostVoucher"+ postVouch);
errString = Conf.confirm(tranIdPe, xtraParams, forcedFlag,conn); //nvo_miscvouch.gbf_retrieve_misc_vou(lstr_pur_exp_reco.voucher_no, lstr_pur_exp_reco.voucher_no,2,ls_errcode,ls_site_code)
......@@ -1857,21 +1941,28 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
Conf = null;
if(errString.indexOf("CONFSUCCES") > -1)
{
System.out.println("Sucessfully");
}
if(errString != null && errString.trim().length() > 0)
{
System.out.println("Return errString");
return errString;
}
tranIdPe="";
if(postVouch.equalsIgnoreCase("N"))
{
System.out.println("Post Voucher N");
}
System.out.println("Sucessfully");
}
if(errString != null && errString.trim().length() > 0)
{
System.out.println("Return errString");
return errString;
}
tranIdPe="";
if("N".equalsIgnoreCase(postVouch))
{
System.out.println("N.equalsIgnoreCase(postVouch)"+postVouch );
errString="CONFSUCCES";
System.out.println("errString1"+errString);
System.out.println("Post Voucher N");
}
System.out.println("lltrue"+lltrue);
lltrue++;
System.out.println("lltrue count is"+lltrue);
}while(lltrue != 1);
System.out.println("Out while");
......@@ -1969,8 +2060,10 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
lstaxchap = checkNull(genericUtility.getColumnValue("tax_chap",headerDom));
lstaxenv = checkNull(genericUtility.getColumnValue("tax_env",headerDom));
lsremarks = checkNull(genericUtility.getColumnValue("remarks",headerDom));
postVouch = genericUtility.getColumnValue("post_vouch",headerDom);
String loginUser = GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode");
String termID = GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId");
//select count(*) from site a, site b where a.FIN_ENTITY = b.FIN_ENTITY and a.site_code = ? and b.site_code = ?
sql="select count(*)from site a, site b where a.FIN_ENTITY = b.FIN_ENTITY and a.site_code = ? and b.site_code = ?";
......@@ -2226,7 +2319,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
lcamt1 = GenericUtility.getInstance().getColumnValueFromNode("amount",detailNode);
System.out.println("lcamt in multi voucher" + lcamt1);
lcamt=Double.parseDouble(lcamt1);
lcamt = lcamt1 == null ? 0 : Double.parseDouble(lcamt1);
System.out.println("lcamt in multi voucher" + lcamt);
lstranid = GenericUtility.getInstance().getColumnValueFromNode("tran_id",detailNode);
System.out.println("Ref_id is"+ lstranid);
......@@ -2351,9 +2444,10 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
lstranid="";
}
else
else
{
errString = itmDBAccessEJB.getErrorString("","VTAMT","","",conn);
errString = itmDBAccessEJB.getErrorString("","VTAMTNULL","","",conn);
return errString;
}
lcamt1 = GenericUtility.getInstance().getColumnValueFromNode("amount",detailNode);
......@@ -2505,34 +2599,32 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
pstmt = null;
}
}
postVouch = genericUtility.getColumnValue("post_vouch",headerDom);
System.out.println("Post Voucher is"+postVouch);
System.out.println("postVouch.equalsIgnoreCase()"+postVouch);
errString = postVoucherMulti(postVouch,tranIdPe, xtraParams, forcedFlag,conn);
}
System.out.println("postVouch.equalsIgnoreCase()"+postVouch);
if(errString.length()==0 && postVouch.equalsIgnoreCase("Y"));
{
System.out.println("PostVoucher"+ postVouch);
errString = Conf.confirm(tranIdPe, xtraParams, forcedFlag,conn); //nvo_miscvouch.gbf_retrieve_misc_vou(lstr_pur_exp_reco.voucher_no, lstr_pur_exp_reco.voucher_no,2,ls_errcode,ls_site_code)
}
Conf = null;
if(errString.indexOf("CONFSUCCES") > -1)
{
System.out.println("Sucessfully");
}
if(errString != null && errString.trim().length() > 0)
{
System.out.println("Return errString");
return errString;
}
tranIdPe="";
if(postVouch.equalsIgnoreCase("N"))
{
System.out.println("Post Voucher N");
}
System.out.println("lltrue"+lltrue);
lltrue++;
System.out.println("lltrue"+lltrue);
/*if(errString.length()==0 && postVouch.equalsIgnoreCase("Y"));
{
System.out.println("PostVoucher"+ postVouch);
errString = Conf.confirm(tranIdPe, xtraParams, forcedFlag,conn); //nvo_miscvouch.gbf_retrieve_misc_vou(lstr_pur_exp_reco.voucher_no, lstr_pur_exp_reco.voucher_no,2,ls_errcode,ls_site_code)
}
Conf = null;
if(errString.indexOf("CONFSUCCES") > -1)
{
System.out.println("Sucessfully");
}
if(errString != null && errString.trim().length() > 0)
{
System.out.println("Return errString");
return errString;
}
tranIdPe="";
if(postVouch.equalsIgnoreCase("N"))
{
System.out.println("Post Voucher N");
}*/
}
catch (SQLException sqx)
......@@ -2571,6 +2663,41 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
}
return errString;
}
private String postVoucherMulti(String postVouch,String tranIdPe,String xtraParams, String forcedFlag,Connection conn) throws RemoteException, ITMException
{
String errString="";
MiscValConf Conf = null;
Conf = new MiscValConf();
System.out.println("postVouch" +postVouch);
System.out.println("tranIdPe" +tranIdPe);
System.out.println("xtraParams" +xtraParams);
System.out.println("forcedFlag" +forcedFlag);
System.out.println("conn" +conn);
if(postVouch.equalsIgnoreCase("Y"))
{
System.out.println("PostVoucher"+ postVouch);
errString = Conf.confirm(tranIdPe, xtraParams, forcedFlag,conn); //nvo_miscvouch.gbf_retrieve_misc_vou(lstr_pur_exp_reco.voucher_no, lstr_pur_exp_reco.voucher_no,2,ls_errcode,ls_site_code)
}
Conf = null;
if(errString.indexOf("CONFSUCCES") > -1)
{
System.out.println("Sucessfully");
}
if(errString != null && errString.trim().length() > 0)
{
System.out.println("Return errString");
return errString;
}
tranIdPe="";
if(postVouch.equalsIgnoreCase("N"))
{
errString="CONFSUCCES";
System.out.println("errString2"+errString);
}
return errString;
}
private String gfmiscvoucherpe( String winname, String ref,ArrayList payHeadList, String lsvouchtype, ArrayList payDetailList, double lctaxamt,Timestamp currDate,String lssundrytype,String lsremarks,String ldlrdate, String lsbillno, String tranIdPe,String xtraParams, String postVouch,Connection conn)throws ITMException
{
String sql="";
......@@ -2737,7 +2864,7 @@ public class PayVoucherComPrc extends ProcessEJB implements PayVoucherComPrcLoca
System.out.println("cctr_code__adv"+lscctradv);
//finCommon.getFinparams("999999", "COMM_CALC", conn);
lsrndoff = finCommon.getFinparams("999999", "PAY_RND_OFF",conn);
if (!lsrndoff.equalsIgnoreCase("NULLFOUND"));
if (!lsrndoff.equalsIgnoreCase("NULLFOUND"))
{
llrndto = 1;
}
......
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