Current File : //home/obabain/public_html/abc/ViewReceiptByNo.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
      <%@ include file="Connection.jsp" %>
      <%
      String id=request.getParameter("id");
Statement st=con.createStatement();
ResultSet rs = null;
rs=st.executeQuery("select tb.*,(select ledger_name from account_ledger where l_id=tb.particular)parti,IFNULL((select ledger_name from account_ledger where l_id=tb.account),'')acc from account_voucher_main tb where voucher_id="+id+" and voucher_type='receipt'");
while(rs.next())
{
	 payno=rs.getString("voucher_no");
	 paydate=rs.getString("voucher_date");
	 acc=rs.getString("acc");
	 amt=rs.getString("credit_amt");
	 narr=rs.getString("narration");
}


%>
<%!
String payno=null;
String paydate=null;
String acc=null;
String amt=null;
String narr=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">
<title>Insert title here</title>
</head>
<body>
<%@include file="master.jsp" %>
<form>

<div class="content">
<div class="row">
<div class="col-md-9"  style="background-color:white;">
<div class="panel panel-default" >
       <div class="panel-heading main-color-bg">
        <h3 class="panel-title">Receipt Voucher</h3>
              </div>
             </div>
<div class="panel-body">
<a href="Receiptvoucher.jsp" style="background:#204b58;" class="pull-right btn btn-info">New</a>
 <div class="row" >    
       <div class="col-xs-6">
          <label for="lastname" style="color:red;">Voucher No.</label> 
          <%=payno %>
          
          </div>  
          <div class="col-xs-2 ">
          <label for="lastname" style="margin-left:5px;">Date</label> 
         <%=paydate %>
          </div> 
          <%-- <div class="col-xs-3">
       <label for="lastname" style="margin-left:5px;"> Account</label>
       <%=amt %>
       </div>     --%>
       </div>
       <div class="row">
       <table class="table " style="width:60%; margin-left:12px;">
       <thead>
       <tr class="info">
       <th>Particular</th>
       <th style="text-align:right;">Amount</th>
       </tr>
       </thead>
       <tbody>
        <%
       rs=st.executeQuery("select tb.*,IFNULL((select ledger_name from account_ledger where l_id=tb.particular),'')parti,sum(tb.debit_amt)am from account_voucher_sub tb where voucher_id="+id+" group by particular order by vid");
       while(rs.next())
       {
    	   %>
    	   
    	  
       <tr>
       <td style="margin-left:60px;" valign="top"><%=rs.getString("parti") %>
      <%
       Statement st1=con.createStatement();
       ResultSet rs1=st1.executeQuery("select tb.*,(case when tb.type='B' then (select sales_invoice_no from ip_sales_invoice where sinvoice_id=tb.bill_no) else bill_no end )bill from account_voucher_sub tb where voucher_id="+id+" and particular="+rs.getString("particular")+"");
       while(rs1.next())
       {
       %>
       <br>
       <%if(rs1.getString("type").equals("B"))
       {
    	   
    	   %>
    	   Agst Ref:  <span><%=rs1.getString("bill") %></span>
    	   <span style="margin-left:150px;"><%=rs1.getString("debit_amt") %>Dr</span>
    	   <%
       }}
    	   %>
       </td>
       <td align="right"  ><%=rs.getString("am") %></td>
       </tr>
        <% 
       }
       %>
        <tr>
       <td></td>
       <td ></td>
       </tr>
       <tr>
       <td></td>
       <td align="right"><b><%=amt %></b></td>
       </tr>
       </tbody>
       </table>
       <table class="table" style="width:60%; margin-left:12px;">
       <tbody>
       <tr>
       <td>
       <b>Through:</b><br><span style="margin-left:60px;"><%=acc %></span>
       <br>
       <b>on account of:</b><br><span style="margin-left:60px;"><%=narr %></span>
       </td>
       <td>
       
       </td>
       </tr>
       </tbody>
       </table>
       </div>
 <div class="modal-footer" id="contact_submit">
         <input type="button" value="Back" style="background:#204b58;" class="pull-left btn btn-info" onclick="goBack()" />
      
     
        
       
       
      </div> 
</div>
</div>
</div>
</div>

<%@include file="footer.jsp" %>
</form>
<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>
</body>
</html>