Current File : /home/obabain/autoclutchess_obaba_in/PurchaseInvoiceMainn.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>
<%@include file="master.jsp" %>
<%!int inid=0;
String lpo=null;
String date=null;
String polno=null;%>
<%
ResultSet rs=null;
Statement st=con.createStatement();
rs=st.executeQuery("select * from ip_puchase_invoice2 where pinvoice_id=(select max(pinvoice_id) from ip_puchase_invoice2) and branch_id="+loginid+"");
while(rs.next())
{
lpo=rs.getString("purchase_invoice_no");
}
rs=st.executeQuery("select NOW() as date");
while(rs.next())
{
date=rs.getString("date");
}
ResultSet rn=st.executeQuery("select * from grn_increment where type='PO'");
while(rn.next())
{
polno=rn.getString("sl_no");
}
%>
<!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="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">
<title>Purchase</title>
</head>
<body>
<script>
// JavaScript popup window function
function basicPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=300,width=700,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes')
}
</script>
<form method="post" name="po" action="piMainn.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">Purchase Invoice</h3>
</div>
</div>
<div class="panel-body">
<div align="right" >
<a href="ViewInvoicePurchase1.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="invno" style="margin:5px;" >
GRN No.<span style="color:red;">*</span></label></p>
<input type="text" name="grno1" class="form-control" value="<%=polno%>" >
</div>
</div>
<div class="form-group col-xs-2">
<div class="onerow">
<p> <label for="invno" style="margin:5px;" >
GRN Date.<span style="color:red;">*</span></label></p>
<input type="date" name="grndate" class="form-control" value="<%=polno%>" >
</div>
</div>
<div class="form-group col-xs-2">
<div class="onerow">
<p> <label for="invno" style="margin:5px;" >
Invoice No.<span style="color:red;">*</span></label></p>
<input type="text" name="invno" class="form-control" id="invno">
</div>
</div>
<div class="form-group col-xs-2"><p> <label for="podate" style="margin:5px;" >
Invoice date<span style="color:red;">*</span></label></p>
<input type="text" class="form-control" name="podate" id="datetimepicker" required>
</div>
<!--
<div class="form-group">
Expires
<input type="text" class="form-control" name="expdate" placeholder="mm/dd/yyyy">
</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">PO-Order default</option>
<option value="2">Invoice default</option>
<option value="3">Quote default</option>
</select>
</div>
</div>
<div class="row">
<div class="form-group col-xs-3">
<div class="onerow">
<p> <label for="sname" style="margin:5px;" >
Supplier</label></p>
<select name="sname" class="form-control">
<option value="0">select</option>
<%
Statement stt=con.createStatement();
rs=stt.executeQuery("select * from ip_suppliers where branch_id="+loginid+" order by supplier_name asc");
while(rs.next())
{
%>
<option value="<%=rs.getString("supplier_id") %>"><%=rs.getString("supplier_name") %></option>
<%
}
%>
</select>
</div>
</div>
<div class="form-group col-xs-2">
<p> <label for="paymethod" style="margin:5px;" >
Payment Terms</label></p>
<select name="paymethod" class="form-control">
<%
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 class="form-group col-xs-2"><p> <label for="paymethod" 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 class="form-group col-xs-2">
<p> <label class="control-label"><b>Supplier Type</b></label></p>
<select name="suppliertype" class="select4 form-control" id="ddlFruits">
<option value=""></option>
<option value="Withoutpo">Without PO</option>
<option value="Other" >PO Order</option>
</select>
</div>
<div id="dvPassport" style="display: none">
<div >
<div class="form-group col-xs-2">
<p> <label for="paymethod" style="margin:5px;" >
P.O No.</label></p>
<select name="pono" class="itemselect form-control">
<option value="0">select</option>
<%
Statement stt1=con.createStatement();
rs=stt1.executeQuery("select * from ip_porders2 order by porder_id desc");
while(rs.next())
{
%>
<option value="<%=rs.getString("porder_number") %>"><%=rs.getString("porder_number") %> -<%=rs.getString("porder_date_created")%></option>
<%
}
%>
</select>
<!-- <input type="text" class="form-control" name="pono" id="pono"> -->
</div>
<div class="form-group col-xs-2"><p> <label for="paymethod" style="margin:5px;" >
P.O date</label></p>
<input type="text" class="revno form-control" name="podate" id="datetimepicker2">
</div>
</div>
</div>
<div class="form-group col-xs-2">
<p> <label for="gurl" style="margin:5px;">
Indent No</label></p>
<input type="text" class="form-control" name="indent">
</div>
<div class="form-group col-xs-2">
<p> <label for="gurl" style="margin:5px;">
Indent Date</label></p>
<input type="date" class="form-control" name="indentdate">
</div>
</div>
<div class="row" >
<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="PurchaseInvoiceMain.jsp">Reset</a>
<input type="submit" value="Next" class="btn btn-info" style="background:#204b58" onclick="validate();">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<%@include file="footer.jsp" %>
</form>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("#ddlFruits").change(function () {
if ($(this).val() == "Other") {
$("#dvPassport").show();
} else {
$("#dvPassport").hide();
}
});
});
</script>
<script type="text/javascript">
function validate()
{
// var t2=document.po.expdate.value;
var t3=document.getElementById("invno").value;
var t1=document.getElementById("datetimepicker").value;
var t4=document.getElementById("pono").value;
if( t1==null || t1=="" )
alert('Fill all mandatory fields');
g}
</script>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</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"
//mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
});
jQuery('#datetimepicker2').datetimepicker({
timepicker:false,
todayBtn: "linked"
//mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
});
</script>
<script>
$(document).on("change",".itemselect",function(){
var p=[];
var a=$(".itemselect:last").find("option:selected").text();
p=a.split('-');
$(".item:last").val(p[0]);
$(".descr:last").val(p[2]);
$(".revno:last").val(p[1]);
$(".drawno:last").val(p[3]);
$(".materialgroup:last").val(p[4]);
$(".price:last").val(p[5]);
$(".discount:last").val(p[6]);
$(".curr:last").val(p[7]);
$(".ouom:last").val(p[8]);
$(".sloc:last").val(p[9]);
});
</script>
</body>
</html>