Commit b2e793db authored by kshinde's avatar kshinde

bug fix

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@181737 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 669d9917
...@@ -42,7 +42,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -42,7 +42,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
try try
{ {
conn = getConnection(); conn = getConnection();
resString = actionPay(tranId,xtraParams,"VOUCH",conn); resString = actionPay(tranId,xtraParams,"VOUCH",false,conn);
} }
catch(Exception e) catch(Exception e)
...@@ -55,7 +55,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -55,7 +55,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
return resString; return resString;
} }
public String actionPay(String tranId,String xtraParams, String tranSer,Connection conn) throws RemoteException , ITMException public String actionPay(String tranId,String xtraParams, String tranSer,boolean onConf,Connection conn) throws RemoteException , ITMException
{ {
System.out.println("---ActionHandler---@@@@@@@@xtraParams["+xtraParams+"]"); System.out.println("---ActionHandler---@@@@@@@@xtraParams["+xtraParams+"]");
//Connection conn = null; //Connection conn = null;
...@@ -259,7 +259,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -259,7 +259,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
//calculating discount for Voucher //calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(tranSer)) if("VOUCH".equalsIgnoreCase(tranSer))
{ {
sql="select purc_order,eff_date,bill_date from misc_voucher where tran_id = ?"; sql="select purc_order,eff_date,bill_date from voucher where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo ); pstmt.setString(1,refNo );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -287,7 +287,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -287,7 +287,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
+ "from crterm,crtermfc " + "from crterm,crtermfc "
+ "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'"; + "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder ); pstmt.setString(1,pCrTerm );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -299,8 +299,8 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -299,8 +299,8 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
pstmt.close(); pstmt.close();
rs.close(); rs.close();
ldDiscountDt =calcDiscountDate(pCrTerm,sdf.format(refDate),sdf.format(effDate),sdf.format(billDate),conn); ldDiscountDt = calcDiscountDate(pCrTerm,(sdf.format(refDate)),(sdf.format(effDate)),(sdf.format(billDate)),conn);
System.out.println("Test"+ldDiscountDt);
int liDateDiff=dayDiff(ldDiscountDt,today); 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'"; sql = "select fin_chg from crtermfc where ? between min_day and max_day and cr_term = ? and trim(line_no) = '1'";
...@@ -353,7 +353,15 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -353,7 +353,15 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
xmlBuff.append("<group0>"); xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>"); xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>"); xmlBuff.append("<Header0>");
xmlBuff.append("<objName><![CDATA[").append("misc_pay").append("]]></objName>");
if(onConf)
{
xmlBuff.append("<objName><![CDATA[").append("misc_pay_act").append("]]></objName>");
}
else
{
xmlBuff.append("<objName><![CDATA[").append("misc_pay").append("]]></objName>");
}
xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>"); xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>"); xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>"); xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
...@@ -395,8 +403,14 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -395,8 +403,14 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>"); xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("</Detail1>"); xmlBuff.append("</Detail1>");
if(onConf)
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"2\">"); {
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"2\">");
}
else
{
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"2\">");
}
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_ser><![CDATA[" + tranSerM+ "]]></tran_ser>"); xmlBuff.append("<tran_ser><![CDATA[" + tranSerM+ "]]></tran_ser>");
xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>"); xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>");
...@@ -577,11 +591,11 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -577,11 +591,11 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
if(lsStart.equalsIgnoreCase("R")) if(lsStart.equalsIgnoreCase("R"))
{ {
ldTranDt=Timestamp.valueOf(vouchDate); ldTranDt=Timestamp.valueOf(genericUtility.getValidDateString(vouchDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
else if(lsStart.equalsIgnoreCase("D")||lsStart.equalsIgnoreCase("Q")) else if(lsStart.equalsIgnoreCase("D")||lsStart.equalsIgnoreCase("Q"))
{ {
ldTranDt=Timestamp.valueOf(effDate); ldTranDt=Timestamp.valueOf(genericUtility.getValidDateString(effDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
else if(lsStart.equalsIgnoreCase("B")) else if(lsStart.equalsIgnoreCase("B"))
{ {
...@@ -694,6 +708,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -694,6 +708,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);
} }
return ldDuedate; return ldDuedate;
......
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