Commit 8cea3bbf authored by vdhoble's avatar vdhoble

for F14KSUN004


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98560 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c301e5ef
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="ibase.system.config.ConnDriver" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="ibase.webitm.utility.GenericUtility" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
table ,td {
border: 1px solid black;
border-collapse: collapse;
font-size: small;
}
th{
width: auto;
font-size: small;
font-weight: bold;
}
.heading{
font-size: medium;
text-align:center;
font-weight: bold;
}
.detail{
width: auto;
}
table td.descr{
white-space:nowrap
}
</style>
</head>
<body>
<%! private String checkNull(String inp)
{
if(inp == null)
inp = " ";
return inp.trim();
}
%>
<%
String xtraParams ="", forcedFlag ="";
Connection conn = null;
boolean connStatus=false;
String sql ="";
String effectiveRefDate = "",tranDate = "",confDate = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
ArrayList abc = null;
ArrayList supplierPaymentList = null;
ArrayList<ArrayList> supplierPaymentList1 =null;
GenericUtility genericUtility = null;
try{
String param = null;
String paramvalue = null;
genericUtility = new GenericUtility();
Enumeration enum1 = request.getParameterNames();
while( enum1.hasMoreElements() )
{
param = (String)enum1.nextElement();
paramvalue = request.getParameter(param);
System.out.println("param ["+param+"] paramvalue ["+paramvalue+"]");
}
String paramList[];
String vouchNo = "";
String thirdParam = "";
if ( paramvalue.indexOf("~") != -1 )
{
paramList = paramvalue.split("~");
vouchNo = paramList[0];
thirdParam = paramList[1];
}
System.out.println("vouchNo >>>>>>>"+vouchNo);
out.println("Payment Information for Voucher : "+vouchNo);
System.out.println("thirdParam >>>>>>>"+thirdParam);
if ( conn == null )
{
System.out.println("New Connection created");
ConnDriver connDriver = null;
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
connStatus = true;
}
supplierPaymentList1 = new ArrayList<ArrayList>();
sql = "select ref_no,ref_date,status,tran_id,sundry_code,pay_mode,bank_code,net_amt,curr_code,confirmed,conf_date,tran_date from misc_payment where tran_id in(select tran_id from misc_paydet where vouch_no = ? )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,vouchNo);
rs = pstmt.executeQuery();
while(rs.next())
{
supplierPaymentList = new ArrayList();
effectiveRefDate = genericUtility.getValidDateString(rs.getString("ref_date"),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat());
System.out.print("Tran ID == "+rs.getString("tran_id")+ " Tran Date == "+rs.getString("tran_date"));
System.out.print("Ref Date : "+rs.getString("ref_date"));
tranDate = genericUtility.getValidDateString(rs.getString("tran_date"),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat());
if(rs.getString("conf_date") != null && rs.getString("conf_date").trim().length() > 0)
{
confDate = genericUtility.getValidDateString(rs.getString("conf_date"),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat());
}
System.out.print("Confirm Date : "+confDate);
supplierPaymentList.add(rs.getString("tran_id"));
supplierPaymentList.add(tranDate);
System.out.print("Tran ID == "+rs.getString("tran_id")+ " Tran Date == "+tranDate);
System.out.print(" Ref NO : " +rs.getString("ref_no"));
supplierPaymentList.add(checkNull(rs.getString("ref_no")));
supplierPaymentList.add(checkNull(effectiveRefDate));
supplierPaymentList.add(checkNull(rs.getString("status")));
supplierPaymentList.add(checkNull(rs.getString("sundry_code")));
supplierPaymentList.add(checkNull(rs.getString("pay_mode")));
supplierPaymentList.add(checkNull(rs.getString("bank_code")));
supplierPaymentList.add(checkNull(rs.getString("net_amt")));
supplierPaymentList.add(checkNull(rs.getString("curr_code")));
supplierPaymentList.add(checkNull(rs.getString("confirmed")));
supplierPaymentList.add(checkNull(confDate));
System.out.println("ArrayList Size>>>>>>>>>"+supplierPaymentList.size());
supplierPaymentList1.add(supplierPaymentList);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/* if(conn != null ){
System.out.println("connection"+conn);
conn.commit();
conn.close();
conn = null;
} */
}
catch(Exception e)
{
e.printStackTrace();
System.out.println( "@@@@@ Exception occured:: " );
}
finally{
try{
if( rs != null )
rs.close();
rs = null;
if( pstmt != null )
pstmt.close();
pstmt = null;
if( conn != null )
conn.close();
conn = null;
}catch( Exception ex ){}
}
System.out.println("ArrayList Size for Supplier Payment>>>>>>>>>"+supplierPaymentList1.size());
%>
<br>
<br>
<table border ='0'>
<thead>
<td class='heading'>Transaction ID</td><td class='heading'>Transaction Date</td>
<td class='heading'>UTR Number</td><td class='heading'>Date</td><td class='heading'>Status</td>
<td class='heading'>Sundry Code</td><td class='heading'>Pay Mode</td><td class='heading'>Bank Code</td>
<td class='heading'>Net Amount </td><td class='heading'>Currency Code</td><td class='heading'>Confirmed Status</td><td class='heading'>Confirm Date</td>
</thead>
<tbody>
<%!
public static boolean isNum(String s)
{
boolean ret = true;
try {
Double.parseDouble(s);
}catch (NumberFormatException e) {
ret = false;
}
return ret;
}
%>
<% for(int i=0;i<supplierPaymentList1.size();i++)
{
abc = supplierPaymentList1.get(i);
%>
<tr>
<%for(int j=0;j<abc.size();j++)
{
boolean val = isNum(abc.get(j).toString());
if(val)
{
%>
<td class="descr" align="right"><%= abc.get(j) %></td>
<%
}
else{
%>
<td class="descr" align="left"><%= abc.get(j) %></td>
<%
}
}
%>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>
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