Current File : //home/obabain/khb_obaba_in/PurchaseReportPdf.jsp |
<%@ page language="java" import="java.util.Date" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="Connection.jsp" %>
<%
String from=request.getParameter("from");
String to=request.getParameter("to");
String supplid=request.getParameter("supplier_id");
Statement st=con.createStatement();
Statement st1=con.createStatement();
ResultSet rs = null;
%>
<!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=ISO-8859-1">
<link href="css/Mystyle.css" rel="stylesheet">
<script src="js/jscolor.js"></script>
<title>Insert title here</title>
</head>
<body>
<div><div style="padding-bottom:30px;" align="center"><u><b><font size="4">Supplier Balance Report</font><br></b> From <%=from %> To <%=to %></u>
<%
Date date = new Date();
out.print( "<h5 align=\"center\">" +date.toString()+"</h5>");
%></div>
<table class="pdftable">
<thead>
<tr>
<th>Sl.No.</th>
<th>PO No.</th>
<th>Supplier</th>
<th>Created Date</th>
<th>Amount</th>
<th>Tax</th>
<th>Total Amt.</th>
</tr>
</thead>
<tbody>
<%
int j=1;
if(from.length()==0 & supplid.length()!=0)
{
rs=st1.executeQuery("select tb.*,(select sum(item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)amt,(select supplier_name from ip_suppliers where supplier_id=tb.supplier_id)cust,(select sum(item_subtotal-item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)tax from ip_porders tb where supplier_id="+supplid+"");
}
else if(from.length()==0 & supplid.length()==0)
{
rs=st1.executeQuery("select tb.*,(select sum(item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)amt,(select supplier_name from ip_suppliers where supplier_id=tb.supplier_id)cust,(select sum(item_subtotal-item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)tax from ip_porders tb");
}
else if(supplid.length()==0){
rs=st1.executeQuery("select tb.*,(select sum(item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)amt,(select supplier_name from ip_suppliers where supplier_id=tb.supplier_id)cust,(select sum(item_subtotal-item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)tax from ip_porders tb where porder_date_created between '"+from+"' and '"+to+"'");
}
else{
rs=st1.executeQuery("select tb.*,(select sum(item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)amt,(select supplier_name from ip_suppliers where supplier_id=tb.supplier_id)cust,(select sum(item_subtotal-item_quantity*item_price) from ip_porder_items where porder_id=tb.porder_id)tax from ip_porders tb where porder_date_created between '"+from+"' and '"+to+"' AND supplier_id="+supplid+"");
}
while(rs.next()){
%>
<tr>
<td><%=j %></td>
<td><%=rs.getString("porder_number") %></td>
<td><%=rs.getString("cust") %></td>
<td><%=rs.getString("porder_date_created") %></td>
<td><%=rs.getString("amt") %></td>
<td><%=rs.getString("tax") %></td>
<td><%=rs.getString("total") %></td>
<%
j++;}%>
</tr>
</tbody>
</table>
</div>
</body>
</html>