Commit 8e5b5e26 authored by kshinde's avatar kshinde

Bug fix in VouchPayAct MiscPayAct for req ID[F17KGTP004]

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@181426 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86245223
......@@ -68,10 +68,12 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
public String actionHandler(String tranId, String xtraParams, String forcedFlag) throws RemoteException, ITMException
{
String resString="";
Connection conn = null;
try
{
conn=getConnection();
VouchPayAct vouchpay=new VouchPayAct();
resString=vouchpay.actionPay(tranId, xtraParams, "M_VOUC");
resString=vouchpay.actionPay(tranId, xtraParams, "M-VOUC",conn);
}
catch(Exception e)
......
......@@ -38,9 +38,11 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
public String actionHandler(String tranId, String xtraParams, String forcedFlag) throws RemoteException, ITMException
{
String resString="";
Connection conn=null;
try
{
resString = actionPay(tranId,xtraParams,"M-VOUC");
conn = getConnection();
resString = actionPay(tranId,xtraParams,"VOUCH",conn);
}
catch(Exception e)
......@@ -53,15 +55,16 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
return resString;
}
public String actionPay(String tranId,String xtraParams, String VouchType) throws RemoteException , ITMException
public String actionPay(String tranId,String xtraParams, String tranSer,Connection conn) throws RemoteException , ITMException
{
System.out.println("---ActionHandler---@@@@@@@@xtraParams["+xtraParams+"]");
Connection conn = null;
//Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
ResultSet rs = null, rs1 = null, rs2 = null;
String retString = "",errString="";
String conf="",errCode="",payMode="",refNo="";
int refCount=0;
String sql="";
ITMDBAccessEJB itmDBAccessEJB=new ITMDBAccessEJB();
......@@ -74,7 +77,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
FinCommon finCommon = new FinCommon();
Timestamp tranDate=null,billDate=null,dueDate=null,refDate=null,effDate=null,ldDiscountDt=null,ldStartDate=null;
String billNo="",currCode="",acctCode="",cctrCode="",siteCode="",finEntity="",sundryType="",bankCode="",userName="",sundryCode="",tranSer="",
String billNo="",currCode="",acctCode="",cctrCode="",siteCode="",finEntity="",sundryType="",bankCode="",userName="",sundryCode="",tranSerM="",
purcOrder="",pCrTerm="",acctCodeDisc="",cctrCodeDisc="",startFrom="";
double exchRate=0.0d,totAmt=0.0d,advAmt=0.0d,holdAmt=0.0d,netPayable=0.0d,adjAmt=0.0d,lcDiscount=0.0d,lcDiscountAmt=0.0d,payAmt=0.0d,totAmount=0.0d;
E12GenericUtility genericUtility = new E12GenericUtility();
......@@ -82,7 +85,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
//Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
//conn.setAutoCommit(false);
......@@ -91,10 +94,17 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
//tranId=genericUtility.getColumnValue("tran_id", dom);
System.out.println("TranID["+tranId+"]");
String sql="Select confirmed,pay_mode from misc_voucher where tran_id= ?";
if("M-VOUC".equalsIgnoreCase(tranSer))
{
sql="Select confirmed,pay_mode from misc_voucher where tran_id= ?";
}
else
{
sql="Select confirmed,pay_mode from voucher where tran_id= ?";
}
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs=pstmt.executeQuery();
if(rs.next())
{
conf=rs.getString(1);
......@@ -109,9 +119,9 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
sql="select count(1) from misc_paydet where tran_ser= ? and vouch_no= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, VouchType);
pstmt.setString(1, tranSer);
pstmt.setString(2, tranId);
rs=pstmt.executeQuery();
if(rs.next())
{
refCount=rs.getInt(1);
......@@ -128,21 +138,21 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
if(!"Y".equalsIgnoreCase(conf))
{
errCode="VTELMNCNF2";
errString = itmDBAccessEJB.getErrorString("", errCode, "");
errString = itmDBAccessEJB.getErrorString("",errCode, "", "", conn);
return errString;
}
//validation if payment already present
else if(refCount>0)
{
errCode="VTPAYEXIST";
errString = itmDBAccessEJB.getErrorString("", errCode, "");
errString = itmDBAccessEJB.getErrorString("",errCode, "", "", conn);
return errString;
}
//validation if paymode is not Cash
else if(!"C".equalsIgnoreCase(payMode))
{
errCode="VTINMODE";
errString = itmDBAccessEJB.getErrorString("", errCode, "");
errString = itmDBAccessEJB.getErrorString("",errCode, "", "", conn);
return errString;
}
......@@ -163,19 +173,19 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
+ "MISC_PAYABLES.FIN_ENTITY,MISC_PAYABLES.TOT_AMT,MISC_PAYABLES.SUNDRY_TYPE,MISC_PAYABLES.BANK_CODE,"
+ "CASE WHEN MISC_PAYABLES.PAY_MODE IS NULL THEN '' ELSE MISC_PAYABLES.PAY_MODE END as PAY_MODE,MISC_PAYABLES.ADV_AMT,MISC_PAYABLES.TRAN_ID,MISC_PAYABLES.TRAN_SER,MISC_PAYABLES.ADJ_AMT,"
+ "MISC_PAYABLES.HOLD_AMT, fn_confirmed_by(misc_payables.tran_ser, misc_payables.ref_no) as username,"
+ "misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) as net_payable"
+ "FROM MISC_PAYABLES WHERE"
+ "misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) as net_payable "
+ "FROM MISC_PAYABLES WHERE "
//+ "( misc_payables.sundry_type like '' ) AND"
//+ "( misc_payables.sundry_code like '' ) AND"
+ "( misc_payables.ref_no = ? )"
+ "( misc_payables.ref_no = ? ) "
//+ "(misc_payables.pay_mode like 'C') AND"
//+ "misc_payables.entry_batch_no like ' '"
+ "ORDER BY MISC_PAYABLES.SUNDRY_TYPE ASC,"
+ "ORDER BY MISC_PAYABLES.SUNDRY_TYPE ASC, "
+ "MISC_PAYABLES.SUNDRY_CODE ASC,"
+ "MISC_PAYABLES.REF_NO ASC ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs=pstmt.executeQuery();
if(rs.next())
{
refNo=rs.getString("ref_no");
......@@ -201,8 +211,8 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
userName=rs.getString("username");
netPayable=rs.getDouble("NET_PAYABLE");
sundryCode=rs.getString("sundry_code");
tranSer=rs.getString("tran_ser");
payAmt=rs.getDouble("pay_amt");
tranSerM=rs.getString("tran_ser");
}
pstmt.close();
pstmt=null;
......@@ -210,207 +220,214 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
rs=null;
Timestamp today = new java.sql.Timestamp(System.currentTimeMillis());
sdf = new java.text.SimpleDateFormat(genericUtility.getApplDateFormat());
remarks = "Automatic Payment";
//bank details
sql = "select acct_code__bal, cctr_code__bal, acct_code__bc, cctr_code__bc,acct_code__cf, "+
"acct_code__cf_ap, cctr_code__cf, cctr_code__cf_ap from bank where bank_code = '"+bankCode+"'";
System.out.println("SQL : "+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
acctCodeBal = rs.getString("acct_code__bal");
cctrCodeBal = rs.getString("cctr_code__bal");
acctCodeBc = rs.getString("acct_code__bc");
cctrCodeBc = rs.getString("cctr_code__bc");
acctCodeCf = rs.getString("acct_code__cf");
acctCodeCfAp = rs.getString("acct_code__cf_ap");
cctrCodeCf = rs.getString("cctr_code__cf");
cctrCodeCfAp = rs.getString("cctr_code__cf_ap");
}
if(acctCodeCfAp == null || acctCodeCfAp.length() == 0)
{
acctCodeCfAp = acctCodeCf;
}
if(cctrCodeCfAp == null || cctrCodeCfAp.length() == 0)
{
cctrCodeCfAp = cctrCodeCf;
}
pstmt.close();
rs.close();
//calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(tranSer))
{
sql="select purc_order,eff_date,bill_date from misc_voucher where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo );
rs = pstmt.executeQuery();
if(rs.next())
{
purcOrder=rs.getString("purc_order");
effDate=rs.getTimestamp("eff_date");
}
pstmt.close();
rs.close();
sql="select cr_term from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
pCrTerm=rs.getString("cr_term");
}
pstmt.close();
rs.close();
sql="select crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from "
+ "from crterm,crtermfc "
+ "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble("fin_chg");
acctCodeDisc=rs.getString("acct_code__disc");
cctrCodeDisc=rs.getString("cctr_code__disc");
startFrom=rs.getString("start_from");
}
pstmt.close();
rs.close();
ldDiscountDt =calcDiscountDate(pCrTerm,sdf.format(refDate),sdf.format(effDate),sdf.format(billDate),conn);
int liDateDiff=dayDiff(ldDiscountDt,today);
sql = "select fin_chg from crtermfc where ? between min_day and max_day and cr_term = ? and trim(line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, liDateDiff);
pstmt.setString(2, pCrTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble(1);
}
pstmt.close();
rs.close();
if("R".equalsIgnoreCase(startFrom))
{
ldStartDate=refDate;
}
else if("D".equalsIgnoreCase(startFrom) || "Q".equalsIgnoreCase(startFrom))
{
ldStartDate=effDate;
}
else if("B".equalsIgnoreCase(startFrom))
{
ldStartDate=billDate;
}
if((today.after(ldStartDate) || today.equals(ldStartDate)) && (today.before(ldDiscountDt) || today.equals(ldDiscountDt)))
{
lcDiscountAmt=(payAmt*lcDiscount)/100;
}
}
//calculating total amount
totAmount = totAmt - lcDiscountAmt;
System.out.println("Pay Amt : "+payAmt + "Total Amt : "+totAmt);
//09062007 (set currCode bc with Curr Code
currCodeBc = currCode;
StringBuffer xmlBuff = new StringBuffer();
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>");
xmlBuff.append("<objName><![CDATA[").append("misc_pay").append("]]></objName>");
xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
xmlBuff.append("<description>").append("Header0 members").append("</description>");
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<tran_date><![CDATA[" + sdf.format(today) + "]]></tran_date>");
xmlBuff.append("<tran_type><![CDATA[" + tranType + "]]></tran_type>");
xmlBuff.append("<sundry_code><![CDATA[" + sundryCode + "]]></sundry_code>");
xmlBuff.append("<pay_mode><![CDATA[" + payMode + "]]></pay_mode>");
xmlBuff.append("<ref_date><![CDATA[" + sdf.format(refDate) + "]]></ref_date>");
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
xmlBuff.append("<net_amt__bc><![CDATA[" + totAmount + "]]></net_amt__bc>");
xmlBuff.append("<site_code><![CDATA[" + siteCode + "]]></site_code>");
xmlBuff.append("<fin_entity><![CDATA[" + finEntity + "]]></fin_entity>");
xmlBuff.append("<acct_code__bal><![CDATA[" +acctCodeBal + "]]></acct_code__bal>");
xmlBuff.append("<cctr_code__bal><![CDATA[" + cctrCodeBal + "]]></cctr_code__bal>");
xmlBuff.append("<auto_paid><![CDATA["+'Y'+"]]></auto_paid>");
xmlBuff.append("<confirmed><![CDATA["+'N'+ "]]></confirmed>");
xmlBuff.append("<curr_code><![CDATA[" + currCode + "]]></curr_code>");
xmlBuff.append("<acct_code__bc><![CDATA[" + acctCodeBc + "]]></acct_code__bc>");
xmlBuff.append("<bank_code><![CDATA[" + bankCode + "]]></bank_code>");
xmlBuff.append("<exch_rate><![CDATA[" + exchRate + "]]></exch_rate>");
xmlBuff.append("<cctr_code__bc><![CDATA[" + cctrCodeBc + "]]></cctr_code__bc>");
xmlBuff.append("<curr_code__bc><![CDATA[" +currCodeBc + "]]></curr_code__bc>");
xmlBuff.append("<exch_rate__bc><![CDATA[" + exchRate + "]]></exch_rate__bc>");
xmlBuff.append("<acct_code__cf><![CDATA[" + acctCodeCfAp + "]]></acct_code__cf>");
xmlBuff.append("<cctr_code__cf><![CDATA[" + cctrCodeCfAp + "]]></cctr_code__cf>");
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("</Detail1>");
Timestamp today = new java.sql.Timestamp(System.currentTimeMillis());
sdf = new java.text.SimpleDateFormat(genericUtility.getApplDateFormat());
remarks = "Automatic Payment";
//bank details
sql = "select acct_code__bal, cctr_code__bal, acct_code__bc, cctr_code__bc,acct_code__cf, "+
"acct_code__cf_ap, cctr_code__cf, cctr_code__cf_ap from bank where bank_code = '"+bankCode+"'";
System.out.println("SQL : "+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
acctCodeBal = rs.getString("acct_code__bal");
cctrCodeBal = rs.getString("cctr_code__bal");
acctCodeBc = rs.getString("acct_code__bc");
cctrCodeBc = rs.getString("cctr_code__bc");
acctCodeCf = rs.getString("acct_code__cf");
acctCodeCfAp = rs.getString("acct_code__cf_ap");
cctrCodeCf = rs.getString("cctr_code__cf");
cctrCodeCfAp = rs.getString("cctr_code__cf_ap");
}
if(acctCodeCfAp == null || acctCodeCfAp.length() == 0)
{
acctCodeCfAp = acctCodeCf;
}
if(cctrCodeCfAp == null || cctrCodeCfAp.length() == 0)
{
cctrCodeCfAp = cctrCodeCf;
}
pstmt.close();
rs.close();
//calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(VouchType))
{
sql="select purc_order,eff_date,bill_date from misc_voucher where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo );
rs = pstmt.executeQuery();
if(rs.next())
{
purcOrder=rs.getString("purc_order");
effDate=rs.getTimestamp("eff_date");
}
pstmt.close();
rs.close();
sql="select cr_term from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
pCrTerm=rs.getString("cr_term");
}
pstmt.close();
rs.close();
sql="select crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from "
+ "from crterm,crtermfc "
+ "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble("fin_chg");
acctCodeDisc=rs.getString("acct_code__disc");
cctrCodeDisc=rs.getString("cctr_code__disc");
startFrom=rs.getString("start_from");
}
pstmt.close();
rs.close();
ldDiscountDt =calcDiscountDate(pCrTerm,sdf.format(refDate),sdf.format(effDate),sdf.format(billDate),conn);
int liDateDiff=dayDiff(ldDiscountDt,today);
sql = "select fin_chg from crtermfc where ? between min_day and max_day and cr_term = ? and trim(line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, liDateDiff);
pstmt.setString(2, pCrTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble(1);
}
pstmt.close();
rs.close();
if("R".equalsIgnoreCase(startFrom))
{
ldStartDate=refDate;
}
else if("D".equalsIgnoreCase(startFrom) || "Q".equalsIgnoreCase(startFrom))
{
ldStartDate=effDate;
}
else if("B".equalsIgnoreCase(startFrom))
{
ldStartDate=billDate;
}
if((today.after(ldStartDate) || today.equals(ldStartDate)) && (today.before(ldDiscountDt) || today.equals(ldDiscountDt)))
{
lcDiscountAmt=(payAmt*lcDiscount)/100;
}
}
//calculating total amount
totAmount = payAmt - lcDiscountAmt;
System.out.println("Pay Amt : "+payAmt + "Total Amt : "+totAmt);
//09062007 (set currCode bc with Curr Code
currCodeBc = currCode;
StringBuffer xmlBuff = new StringBuffer();
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>");
xmlBuff.append("<objName><![CDATA[").append("misc_pay").append("]]></objName>");
xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
xmlBuff.append("<description>").append("Header0 members").append("</description>");
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<tran_date><![CDATA[" + sdf.format(today) + "]]></tran_date>");
xmlBuff.append("<tran_type><![CDATA[" + tranType + "]]></tran_type>");
xmlBuff.append("<sundry_code><![CDATA[" + sundryCode + "]]></sundry_type>");
xmlBuff.append("<pay_mode><![CDATA[" + payMode + "]]></pay_mode>");
xmlBuff.append("<ref_date><![CDATA[" + refDate + "]]></ref_date>");
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
xmlBuff.append("<net_amt__bc><![CDATA[" + totAmount + "]]></net_amt__bc>");
xmlBuff.append("<site_code><![CDATA[" + siteCode + "]]></site_code>");
xmlBuff.append("<acct_code__bal><![CDATA[" +acctCodeBal + "]]></acct_code__bal>");
xmlBuff.append("<cctr_code__bal><![CDATA[" + cctrCodeBal + "]]></cctr_code__bal>");
xmlBuff.append("<auto_paid><![CDATA["+'Y'+"]]></auto_paid>");
xmlBuff.append("<confirmed><![CDATA["+'N'+ "]]></confirmed>");
xmlBuff.append("<acct_code__bc><![CDATA[" + acctCodeBc + "]]></acct_code__bc>");
xmlBuff.append("<cctr_code__bc><![CDATA[" + cctrCodeBc + "]]></cctr_code__bc>");
xmlBuff.append("<curr_code__bc><![CDATA[" +currCodeBc + "]]></curr_code__bc>");
xmlBuff.append("<exch_rate__bc><![CDATA[" + exchRate + "]]></exch_rate__bc>");
xmlBuff.append("<acct_code__cf><![CDATA[" + acctCodeCfAp + "]]></acct_code__cf>");
xmlBuff.append("<cctr_code__cf><![CDATA[" + cctrCodeCfAp + "]]></cctr_code__cf>");
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("</Detail1>");
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_ser><![CDATA[" + tranSer + "]]></tran_ser>");
xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>");
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
xmlBuff.append("<pay_amt><![CDATA[" + totAmount + "]]></pay_amt>");
xmlBuff.append("<curr_code><![CDATA[" + currCode + "]]></curr_code>");
xmlBuff.append("<exch_rate__vouch><![CDATA[" + exchRate + "]]></exch_rate__vouch>");
xmlBuff.append("<acct_code__ap><![CDATA[" + acctCode + "]]></acct_code__ap>");
xmlBuff.append("<cctr_code__ap><![CDATA[" + cctrCode + "]]></cctr_code__ap>");
xmlBuff.append("<sundry_type><![CDATA[" + sundryType + "]]></sundry_type>");
xmlBuff.append("<sundry_code><![CDATA[" + sundryCode + "]]></sundry_code>");
xmlBuff.append("<bank_charges><![CDATA[" + 0 + "]]></bank_charges>");
//xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<line_no><![CDATA[" + 1 + "]]></line_no>");
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("<net_pay_amt><![CDATA[" + totAmount + "]]></net_pay_amt>");
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("xmlBuff.toString() ["+xmlBuff.toString() + "]");
//calling process Request
retString=saveData(xtraParams, siteCode, xmlBuff.toString(), conn);
if( retString.indexOf("Success") != -1 || retString==null)
{
return (itmDBAccessEJB.getErrorString("","VOUCHSUCC",""));
}
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"2\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_ser><![CDATA[" + tranSerM+ "]]></tran_ser>");
xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>");
xmlBuff.append("<vouch_no><![CDATA[" + refNo + "]]></vouch_no>");
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
xmlBuff.append("<pay_amt><![CDATA[" + totAmount + "]]></pay_amt>");
xmlBuff.append("<curr_code><![CDATA[" + currCode + "]]></curr_code>");
xmlBuff.append("<exch_rate__vouch><![CDATA[" + exchRate + "]]></exch_rate__vouch>");
xmlBuff.append("<diff_amt__exch><![CDATA[" + 0 + "]]></diff_amt__exch>");
xmlBuff.append("<acct_code__ap><![CDATA[" + acctCode + "]]></acct_code__ap>");
xmlBuff.append("<cctr_code__ap><![CDATA[" + cctrCode + "]]></cctr_code__ap>");
xmlBuff.append("<sundry_type><![CDATA[" + sundryType + "]]></sundry_type>");
xmlBuff.append("<sundry_code><![CDATA[" + sundryCode + "]]></sundry_code>");
xmlBuff.append("<bank_charges><![CDATA[" + 0 + "]]></bank_charges>");
//xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<line_no><![CDATA[" + 1 + "]]></line_no>");
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("<net_pay_amt><![CDATA[" + totAmount + "]]></net_pay_amt>");
xmlBuff.append("</Detail2>");
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("xmlBuff.toString() ["+xmlBuff.toString() + "]");
//calling process Request
retString=saveData(xtraParams, siteCode, xmlBuff.toString(), conn);
if( retString.indexOf("Success") != -1 || retString==null)
{
conn.commit();
return (itmDBAccessEJB.getErrorString("","VOUCHSUCC", "", "", conn));
}
}
catch(Exception e)
{
......@@ -441,6 +458,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
}
if( conn != null && ! conn.isClosed() )
{
conn.close();
conn = null;
}
......
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