Current File : /home/obabain/khb_obaba_in/SalesInvoiceMain.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
        <%@ include file="Connection.jsp" %>
        <%@include file="master.jsp" %>
         <%!String lpo=null;
    int inid=0;
    String date=null;
    %>
    <%    
	Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select * from ip_sales_invoice where sinvoice_id=(select max(sinvoice_id) from ip_sales_invoice) and branch_id="+loginid+"");
    while(rs.next())
    {
    lpo=rs.getString("sales_invoice_no");
    }
    rs=st.executeQuery("select NOW() as date");
    while(rs.next())
    {
    date=rs.getString("date");
    }
    
    %>
<!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>Sales Invoice</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"  rel="stylesheet">
    <link href="css/select2.min.css" rel="stylesheet">
    <link href="css/jquery.datetimepicker.css" rel="stylesheet">
  
</head>
<body>

<form  method="post"name= "so" action="SIMainDA.jsp">

<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">Sales Invoice</h3>
              </div>
             </div>
<div class="panel-body">
<div align="right" >
 <a href="ViewInvoices.jsp" style="background:#204b58;" class="btn btn-info"  >View</a>
 </div>
<div class="row">
<div class="form-group col-xs-2">
             
            <div class="onerow">
            Last Invoice Created:<span style="color:red;"><%=lpo %></span>
            </div>
            </div>
</div>
<div class="row">
<div class="form-group col-xs-2">
            <div class="onerow">
            <p><label for="status" style="margin:5px;">
            Invoice No.<span style="color:red;">*</span></label></p>
<input type="text"  class="form-control" name="invoiceno" id="sino">
            </div>
            

</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Invoice Date<span style="color:red;">*</span></label></p>
<input type="text"  class="form-control"  name="invoicedate" id="datetimepicker">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
P.O No.</label></p>
<input type="text" class="form-control" name="PoNo">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
P.O Date</label></p>
<input type="text" class="form-control" name="Podate2" id="datetimepicker2">
</div>
<div class="form-group col-xs-3">
<p><label for="status" style="margin:5px;">
Customer Name</label></p>
<select id="ddlsname" name="cname" class="form-control">
<option value="0">select</option>
<%Statement st1=con.createStatement();
ResultSet r1=st1.executeQuery("select * from ip_clients where branch_id="+loginid+" order by client_name asc");
while(r1.next())
{
%>
<option value="<%=r1.getString("client_id") %>"><%=r1.getString("client_name") %></option>
<%} %>
</select>
</div>

</div>
<div class="row">
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Place of Supply</label></p>
<input type="text" class="form-control" name="placeofsup" value="">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Time of Supply</label></p>
<input type="text" class="form-control" name="timeofsup" value="">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Transporter</label></p>
<input type="text" class="form-control" name="transp" value="">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Dispatch Through</label></p>
<input type="text" class="form-control" name="dispt" value="By Road">
</div>
<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Payment Terms</label></p>
<select name="paymethod" class="form-control" >
<option value="0">Select</option>
<%
Statement st4=con.createStatement();
ResultSet r2=st4.executeQuery("select * from ip_payment_methods");
while(r2.next())
{
%>
<option value="<%=r2.getString("payment_method_id") %>"><%=r2.getString("payment_method_name") %></option>
<%} %>
</select>
</div>
</div>
<div class="row">
<!-- <div class="form-group col-xs-2">
Due Date
<input type="text"  class="form-control"  name="duedate">
</div> -->


<div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">
Freight </label></p>
<select name="freight" class="form-control" >
<option>To Pay</option>
<option>Paid</option>
</select>
</div>
 <div class="form-group col-xs-2">
<p><label for="status" style="margin:5px;">E Way Bill No</label></p>
<input type="text"  class="form-control"  name="invgrp">
</div> 
<!-- <div class="form-group col-xs-2">
 <p> <label for="invgrp" style="margin:5px;">
Invoice Group</label></p>
<select  class="form-control" name="invgrp">
<option value="1">Invoice default</option>
<option value="2">Porder default</option>
<option value="3">Quote default</option>
</select>


</div> -->
<%-- <div class="form-group col-xs-2">
<div class="onerow">
  <p><label for="status" style="margin:5px;">
Status</label></p>
<select class="form-control" name="status">
<%
Statement sts=con.createStatement();
ResultSet rt=sts.executeQuery("select * from ip_status");
while(rt.next())
{
	 %>
<option value="<%=rt.getString("id")%>"><%=rt.getString("description")%></option>
<%} %>
</select>
</div>
</div> --%>

<!-- <div class="form-group">
Quotation No
<input type="text" class="form-control" name="qtno">
</div> -->

</div>
<!-- <div class="row">
<div class="form-group col-xs-2">
 <p><label for="status" style="margin:5px;">
            E-Way Bill</label></p>
<input type="text" class="form-control" name="eway">
</div>
<div class="form-group col-xs-2">
            <div class="onerow">
            <p><label for="status" style="margin:5px;">
            Bank Name</label></p>
<input type="text" class="form-control" name="bnkname">
</div>
</div>
<div class="form-group col-xs-2">
 <p><label for="status" style="margin:5px;">
            A/C No.</label></p>
<input type="text" class="form-control" name="acno">
</div>
<div class="form-group col-xs-2">
 <p><label for="status" style="margin:5px;">
            IFSC code</label></p>
<input type="text" class="form-control" name="ifsc">
</div>
<div class="form-group col-xs-2">
 <p><label for="status" style="margin:5px;">
            Branch</label></p>
<input type="text" class="form-control" name="branch">
</div>
</div> -->
<div class="modal-footer" id="contact_submit">
<input type="button" value="Back" style="background:#204b58;" class="btn btn-info pull-left"  onclick="goBack()"/>
			<a class="btn btn-default" href="SalesInvoiceMain.jsp">Reset</a>
			<input type="submit" value="Next" style="background:#204b58" class="btn btn-info" onclick="validate();">
			</div>
			
</div>
</div>

</div>
</div>
<%@include file="footer.jsp" %>
</form>
<script type="text/javascript">
function validate()
{
	 
	 // var t2=document.po.expdate.value;
	  var t3=document.getElementById("quotno").value;
	 var t1=document.getElementById("datetimepicker").value;
	  var t4=document.getElementById("pono").value;
	  
	  
	  if( t1==null || t1=="" || t4==null || t4=="" )
		  
		 alert('Fill all mandatory fields');

		  
}
</script>

<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>
<script type="text/javascript">
function validate()
{
	 
	 // var t2=document.po.expdate.value;
	  //var t3=document.getElementById("quotno").value;
	 var t1=document.getElementById("datetimepicker").value;
	  var t4=document.getElementById("sino").value;
	  //var t2=document.getElementById("datetimepicker2").value;
	  
	  
	  if( t1==null || t1=="" || t4==null || t4=="" )
		  
		 alert('Fill all mandatory fields');
	  

		  
}
</script>


 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></script>
    <script src="js/select2.min.js"></script>
    <script src="js/jquery.datetimepicker.full.js"></script>
   
    <script>
    $('select').select2();
    </script>
     <script>
     jQuery('#datetimepicker').datetimepicker({
    	 timepicker:false,
    	 todayBtn: "linked",
    	 format:'d/m/y'
    	 //mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
    	});
     
     jQuery('#datetimepicker2').datetimepicker({
    	 timepicker:false,
    	 todayBtn: "linked",
    	 format:'d/m/y'
    	 //mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
    	});
     $(document).ready(function(){
    	 var d=new Date();
    	 var da=  d.getDate() + "/" + (d.getMonth()+1) + "/" +d.getFullYear();
    	 $('#datetimepicker').val(da);
     });
     $(document).ready(function(){
    	 var d=new Date();
    	 var da=  d.getDate() + "/" + (d.getMonth()+1) + "/" +d.getFullYear();
    	 $('#datetimepicker2').val(da);
     });
     
    </script>
</body>
</html>