<?php include 'header.php';?>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

 
</style>
<?php 
date_default_timezone_set('Asia/Calcutta');
$today = date("Y-m-d");
$time = date("h:i A"); 
$currentyear = date("Y");
$currentmonth = date("m");

if($currentmonth>03) { 
$cuyear = date("Y");
$cuyear1 = date("y")+1;
} 
else { 
$cuyear = date("Y")-1;
$cuyear1 =  date("y");
} 
$f_year = "$cuyear"."-"."$cuyear1";

$delivery_challan_id=$_REQUEST['delivery_challan_id'];
$customer_id=$_REQUEST['customer_id'];
$tax_id=$_REQUEST['tax_id'];
$datepicker1=$_REQUEST['datepicker1'];

$qry3z = "select * from tax_invoice where  tax_id='$tax_id' and customer_id='$customer_id'";
$re3z= mysqli_query($conn,$qry3z);
while($row=mysqli_fetch_array($re3z))
		{  
		$from_date = $row['from_date'];
		
		
$to_date=$row['to_date'];
$name_of_goods=$row['name_of_goods'];
$delivery_note=$row['delivery_note'];
$mode_of_payment=$row['mode_of_payment'];
$suppelier_ref=$row['suppelier_ref'];
$other_ref=$row['other_ref'];
$terms_of_delivery=$row['terms_of_delivery'];
$mode_transport=$row['mode_transport'];
$invoice_no=$row['invoice_no'];
$invoice_date=$row['invoice_date'];

		}
		
		$queryls = "select * from invoice_series where auto_no!='' and year='$f_year'  ORDER BY auto_id";
//echo $queryls;
$resultls = mysqli_query($conn,$queryls);    
 while($row=mysqli_fetch_array($resultls))
                                                    {
                                                    $auto_no = $row['auto_no'];
													 $company_name = $row['company_name'];
                                                    }
    
                                                     
$auto_no_new=$auto_no+1;
$cont_seriesa= sprintf("%04d", $auto_no_new);
$invoice_no1="$cont_seriesa"."-"."$f_year";

?>

  <div class="content-page">
    <div class="content">
      <div class="container">
        <div class="row">
          <div class="col-sm-12">
            <div class="page-header-title">
              <button type="button" class="btn btn-dark  waves-effect waves-light" onclick="location.href='cancel_invoice.php?tax_id=<?php echo $_REQUEST['tax_id']?>'">Cancel </button>
             
			 
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
         <form name="chkForm" id="chkForm" action="insert_invoice_challan.php"  method="post">
		 <input type="hidden" name="customer_id" value="<?php echo $_REQUEST['customer_id']?>" />
		 
		 
		 		 <input type="hidden" name="tax_id" value="<?php echo $_REQUEST['tax_id']?>" />


		<main>
		<div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title"> Make Invoice From <?php echo $from ?> To <?php echo $to?>  <br /><span style="color:#FF0000"><strong><?php echo $_REQUEST['massage']?></strong></span></h3></div>
									
									
									
									
                                <div class="panel-body">
                                    <div class="row">
                                      
									  
													
												
													                                   <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Customer Name </label>
   <select name="customer_name" class="form-control">
<option value="" selected>Select Customer</option>
<?php 
$qry97 = "select * from mst_customer where customer_id='".$_REQUEST['customer_id']."'";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$customer_name = $row['customer_name'];
?>
<option value="<?php echo $customer_name?>" selected="selected"><?php echo $customer_name?></option>
<?php }?>
</select>	
                                                    </div>
													</div>
													
										              
                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Invoice  No</label>
														
														<input type="text" name="invoice_no" value="<?php echo $invoice_no1;?>" class="form-control" />
</div></div>    

                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Date</label>
														
														<input type="date" name="invoice_date" value="<?php echo $invoice_date; ?>" class="form-control" />
</div></div> <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Name of Goods</label>
														
														<textarea name="name_of_goods" class="form-control"><?php echo $name_of_goods;?></textarea>
</div></div>      
<div class="clearfix"></div>
      <table class="table table-striped table-bordered dt-responsive nowrap">

<tr>
<td>#</td>
<td>	Description of Goods</td>
<td>	HSN/SAC	</td>
<td>	Quantity
</td>
<td>	Rate</td>
<td>	Per	Amount	</td>			

</tr><?php 

$i=1; 
 $query2="select * from invoice_more_02 where tax_id = '".$_REQUEST['tax_id']."' AND customer_id = '".$_REQUEST['customer_id']."'  ORDER BY  tax_more_product_id ASC";
$result=mysqli_query($conn,$query2);
while($row=mysqli_fetch_array($result))

		{  
$description = $row['description'];
$HSN_code = $row['HSN_code'];
$rate=$row['rate'];
$amount=$row['amount'];
$qty=$row['qty'];
$tax_more_product_id=$row['tax_more_product_id'];
?>
<tr>
<td><?php echo $i; $i++;?></td>
    <input type="hidden" name="tax_more_product_id<? echo $tax_more_product_id?>" value="<? echo $tax_more_product_id?>">

<?php /*?><td><a href="delete_delivery_challan_more_product.php?delivery_challan_more_product_id=<?php echo $delivery_challan_more_product_id?>&&delivery_challan_id=<?php echo $_REQUEST['delivery_challan_id'];?>&&customer_id=<?php echo $_REQUEST['customer_id'];?>" class="btn waves-light" style="float:right; background-color:#65bd77; color: #FFFFFF">Del</a></td>
<?php */?>
<td><textarea  class="form-control" name="description<? echo $tax_more_product_id?>"><? echo $description;?></textarea>  
</td>

<td>  <select name="HSN_code<? echo $tax_more_product_id?>" class="form-control" required>
<?php if($HSN_code!=''){?>
<option value="<?php echo $HSN_code;?>" selected><?php echo $HSN_code?></option>
<?php } ?>
<?php 
$qry97 = "select * from HSN_code_master where product='finish'";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$HSN_code01 = $row['HSN_code'];

?><option value="<?php echo $HSN_code01?>"><?php echo $HSN_code01 ?></option>

<?php } ?>
</select>
</td>

<td>    <input type="text" class="form-control"  id="qty<? echo $tax_more_product_id?>"name="qty<? echo $tax_more_product_id?>" value="<? echo $qty?>"> 
</td>
<td>    <input type="text" class="form-control"  id="rate<? echo $tax_more_product_id?>"name="rate<? echo $tax_more_product_id?>" value="<? echo $rate?>"> 
</td>


<td>
    <input type="text" class="form-control"  id="total<? echo $tax_more_product_id?>"name="amount<? echo $tax_more_product_id?>" value="<? echo $amount?>"> 
</td>



</tr> <script>
$('#rate<? echo $delivery_challan_more_product_id;?>,#qty<? echo $delivery_challan_more_product_id;?>').on('input',function(){
    var qty<? echo $delivery_challan_more_product_id;?> = parseFloat($('#qty<? echo $delivery_challan_more_product_id;?>').val()) || 0;
	var rate<? echo $delivery_challan_more_product_id;?> = parseFloat($('#rate<? echo $delivery_challan_more_product_id;?>').val()) || 0;
    $('#total<? echo $delivery_challan_more_product_id;?>').val(rate<? echo $delivery_challan_more_product_id;?> * qty<? echo $delivery_challan_more_product_id;?>);   
	 
});</script>


             
                 <?php 
				 
				 }
				 
				 ?>                               
				 
				 
				 
				 
				 
				 
				 
				 <div class="col-sm-12 col-xs-12">
                    </div></table>                       
                                     
							
									   <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label> Delivery Note</label>
														
														<input type="text" name="delivery_note" value="<?php echo $delivery_note;?>" class="form-control" />
</div></div>    
									 
									
				<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label> Mode/Terms of Payment</label>
														
														<input type="text" name="mode_of_payment" value="<?php echo $mode_of_payment;?>" class="form-control" />
</div></div>    
									 
														 
				<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>supplier's Ref.</label>
														
														<input type="text" name="suppelier_ref" value="<?php echo $suppelier_ref;?>" class="form-control" />
</div></div>    
									 
											 
									 
					<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Other Reference(S)</label>
														
														<input type="text" name="other_ref" value="<?php echo $other_ref;?>" class="form-control" />
</div></div>    
									 
											 	 	
				
				<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Terms of Delivery</label>
														
														<input type="text" name="terms_of_delivery" value="<?php echo $terms_of_delivery;?>" class="form-control" />
</div></div>    
									 
							
				<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Mode of Transport</label>
														
														<input type="text" name="mode_transport" value="<?php echo $mode_transport;?>" class="form-control" />
</div></div>    
									 
							
				
				
				
				
				
				
			 <div class="col-sm-12 col-xs-12">
                    
				
				
     <div class="m-t-20">
                                                    <div class="form-group">
                                                        <div>
													<input name="Submit"  type="submit" value="Save"  onclick="validate()" class="btn btn-sm btn-primary"/>
													
							
                                                        </div>
                                                    </div>
                                               </div>
                                            </div>
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
        </main>
        </form>
		
		
		
        
      </div>
    </div>
<script  src="./script.js"></script>
 <script src="vendors/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="vendors/bower_components/moment/min/moment-with-locales.min.js"></script>
        <script src="vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
        <script src="vendors/bower_components/switchery/dist/switchery.min.js"></script>
        <script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
        <script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
        
        <!-- Bootstrap Tagsinput JavaScript -->
        <script src="vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
        
        <!-- Bootstrap Touchspin JavaScript -->
        <script src="vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>
        
        <!-- Multiselect JavaScript -->
        <script src="vendors/bower_components/multiselect/js/jquery.multi-select.js"></script>
        
         
        <!-- Bootstrap Switch JavaScript -->
        <script src="vendors/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
        
        <!-- Bootstrap Datetimepicker JavaScript -->
        <script type="text/javascript" src="vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>

        
        <!-- Form Advance Init JavaScript -->
        <script src="dist/js/form-advance-data.js"></script>
        
        <!-- Slimscroll JavaScript -->
        <script src="dist/js/jquery.slimscroll.js"></script>
    
        <!-- Fancy Dropdown JS -->
        <script src="dist/js/dropdown-bootstrap-extended.js"></script>
        
        <!-- Owl JavaScript -->
        <script src="vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>
    
        <!-- Init JavaScript -->
        <script src="dist/js/init.js"></script>   <script src="assets/js/bootstrap.min.js"></script>
	<!-- Select2 JavaScript -->
		<script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
		
		<!-- Bootstrap Select JavaScript -->
		<script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/modernizr.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
<!-- Mirrored from themesdesign.in/xadmino/form-elements.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Feb 2021 12:05:08 GMT -->
</html>