<?php
session_start();
date_default_timezone_set('America/Lima');
require_once ("../../config/Cado.php");
require_once ("../venta/cVenta.php");
$oVenta = new cVenta();
require_once("../formatos/formato.php");
require_once ("../notacredito/cNotacredito.php");
$oNotacredito = new cNotacredito();

$dtsnotcre= $oNotacredito->mostrarUno($_POST['notcre_id']);
	$dtnc= mysqli_fetch_array($dtsnotcre);
		
	$numdoc = $dtnc['tb_notacredito_numdoc'];
	$fec	= $dtnc['tb_notacredito_fec'];
	$mot	= $dtnc['tb_notacredito_motivo'];
	$tot	= $dtnc['tb_notacredito_tot'];
	$venid	= $dtnc['tb_venta_id'];
			
	mysqli_free_result($dtsnotcre);
	
	
	$dtsven= $oVenta->mostrarUno_ticket($venid);
	$dtven= mysqli_fetch_array($dtsven);

	$ven_numDoc	=$dtven['numdoc'];
	$cliNom=$dtven['tb_cliente_nom'];
	$cliDoc=$dtven['doc'];
	$cliDir=$dtven['dir'];
	$cliId=$dtven['cliid'];
	
	


?>
<style type="text/css">
.ui-autocomplete
{
    z-index: 99999; 
}
</style>
<div class="col-lg-12 col-sm-12 col-12" >
	<form id="for_notcre" action="POST">
	<div class="col-lg-12" style="font-weight:bold;font-size:2rem;">		
		Información de Nota de credito			
	</div>
	
	
	
					<div class="row">
					
					<div class="col-lg-3 col-sm-3 col-6">
						<label for="">Fecha:</label>
						<input name="" type="text"  class="form-control " id="" value="<?php echo $fec?>"  maxlength="10"> 
					</div>	
					
					<div class="col-lg-3 col-sm-3 col-6">
						<label for="">N° Doc:</label>
						<input name="" type="text" class="form-control" id="" 
						style="text-align:right;font-weight:bold; font-size:14px;color:#F93154" value="<?php echo $numdoc?>" >						 
 					</div>
					
					<div class="col-lg-6 col-sm-6 col-6">
						<label for="">RUC/DNI:</label>
						<input name="" type="text"  class="form-control " id="" value="<?php echo $cliDoc ?>"  maxlength="10"> 
					</div>	
				
				
					<div class="col-lg-6 col-sm-6 col-6">
						<label for="">Cliente:</label>
						<input name="" type="text"  class="form-control " id="" value="<?php echo $cliNom ?>"  maxlength="10"> 
					</div>	
				
				
				
					<div class="col-lg-3 col-sm-3 col-6">
						<label for="">Motivo:</label>
						<input name="" type="text"  class="form-control " id="" value="<?php echo $mot ?>"  maxlength="10"> 
					</div>	
				
				
					<div class="col-lg-3 col-sm-3 col-6">
						<label>N° Doc. relacionado:</label>
						<input type="text" id="txt_docnum" name="txt_docnum" class="form-control" value="<?php echo $ven_numDoc; ?>" /> 
					</div>
							
		
			
			<div  class="col-lg-12 col-sm-12 col-12" height="15px" >	</div> 
			
			<div  class="col-lg-12 col-sm-12 col-12" >				
			<div id="div_doc" ></div> 	
			</div> 
			
	
			<input name="action_notcre" id="action_notcre" type="hidden" value="<?php echo $_POST['action']?>">
		
		</div> 		
		
		<div  class="col-lg-12 col-sm-12 col-12"  style="display: inline-block; white-space: nowrap;" height="15px" >	</div> 
		
	</form>   
	
	
	<div class="box-footer float-right ">
		<span STYLE="cursor:pointer" title="CERRAR VENTANA"  data-dismiss="modal" class="btn btn-default">CERRAR</span>
	</div>
	
	</div>
				
<script type="text/javascript">

	
	function notacredito_detalle_tabla()
	{
		$.ajax({
			type: "POST",
			url: '../notacredito/notacredito_detalle_tabla_vista.php',
			async:true,
			dataType: "html",                      
			data: ({
				notcre_id : '<?php echo $_POST['notcre_id']; ?>'
			}),
			beforeSend: function(){
				
				$('#div_doc').addClass("ui-state-disabled");
			},
			success: function(html){
				$('#div_doc').html(html);
			},
			complete: function(){			
				$('#div_doc').removeClass("ui-state-disabled");
			
			}
		});     
	}
	

		
	$(function(){
			
			
	notacredito_detalle_tabla();
			
			
		
	

				

	});
	</script>