<?php  
session_start();
require_once ("../../config/Cado.php");
require_once ("../canjeproveedor/cCanjeproveedor.php");
$oCanjeproveedor = new cCanjeproveedor();
require_once ("../formatos/formato.php");
	$dts=$oCanjeproveedor->mostrar_uno($_POST['canid']);
	$dt = mysqli_fetch_array($dts);
	$rucemp=$dt['tb_empresa_ruc'];
	$nomcom=$dt['tb_empresa_nomcom'];
	$nompro=$dt['tb_proveedor_nom'];
	$doc=$dt['tb_proveedor_doc'];
	$rep = $dt['tb_canjeproveedor_aval'];
	$fec = $dt['tb_canjeproveedor_fec'];
	$mon =  $dt['tb_canjeproveedor_mon'];
if($dt['tb_moneda_id']==1){
	$lblmon = 'S/';
}else if($dt['tb_moneda_id']==2){
	$lblmon = 'US$';
}
mysqli_free_result($dts);
?>
<style type="text/css">
.ui-autocomplete
{
    z-index: 99999; 
}
</style>
<div class="col-lg-12 col-md-12 col-xs-12" >
<form id="for_canjeletras" >
	
		<div class="modal-header">
        	<h5 class="modal-title"> CANJE DE LETRAS <span class="pull-right"> </span> </h5>
      	</div>
 			<div class="col-lg-12 col-md-6 col-xs-12 no-padding">
			
			
 				<div class="row"> 
				
 				<div class="col-lg-4 col-sm-4 col-xs-12"> 
 					<label for="txt_canje_gir">Girador:</label> 
 					<input type="text" name="txt_canje_gir" id="txt_canje_gir" readonly  value="<?php echo $doc.' | '.$nompro; ?>" class="form-control" >
 				</div>
 				<div class="col-lg-2 col-sm-4 col-xs-12"> 
 					<label for="txt_canje_acep">Aceptante:</label> 
 					<input type="text" name="txt_canje_acep" id="txt_canje_acep" readonly value="<?php echo $rucemp.' | '.$nomcom; ?>" class="form-control" >
 				</div>
 				<div class="col-lg-2 col-sm-4 col-xs-12"> 
 					<label for="txt_canje_fec">Fecha de Giro:</label> 
 					<input type="text" name="txt_canje_fec" id="txt_canje_fec" readonly class="form-control" value="<?php echo $fec;?>" >
 				</div>
				<div class="col-lg-3 col-sm-4 col-xs-12"> 
					<label for="txt_canje_aval">Aval:</label> 
					<input type="text" name="txt_canje_aval" id="txt_canje_aval" readonly value="<?php echo $rep; ?>" class="form-control" >
				</div>
				<div class="col-lg-1 col-sm-4 col-xs-12"> 
					<label for="txt_canje_mon">Monto:</label> 
					<input type="text" name="txt_canje_mon" id="txt_canje_mon" readonly value="<?php echo $mon; ?>" class="form-control" >
				</div>
			<div class="col-lg-12 col-sm-12 col-xs-12" style="height: 5px;"></div>
			
			<div id="div_canje_doc_vista" class="col-lg-6 col-sm-12 col-xs-12 " ></div>
			<div id="div_canje_car_tabla_vista" class="col-lg-6 col-sm-12 col-xs-12"></div>
		
			</div>
			</div>
 										
</form>
 	<div class="box-footer float-right ">
		<button title="CERRAR VENTANA" style="cursor:pointer" type="button" data-dismiss="modal" class="btn btn-danger "> <i class="fa fa-times"></i> </button>
	</div>
</div>
<script type="text/javascript">
//canje_pago_agregar('restablecer');
canje_documentos_tabla_vista('',<?php echo $_POST['canid']; ?>);
//canje_pago_tabla();
function canje_documentos_tabla_vista(act,canid)
{
	$.ajax({
		type: "POST",
		url: "../canjeproveedor/canje_documento_tabla_vista.php",
		async:false,
		dataType: "html",                  
		data: ({
			action:	 act,
			canid:canid
		}),
		beforeSend: function() {
			$('#div_canje_doc_vista').addClass("ui-state-disabled");
		},
		success: function(html){
			$('#div_canje_doc_vista').html(html);
		},
		complete: function(){			
			$('#div_canje_doc_vista').removeClass("ui-state-disabled");
		}
	});
}
canje_letras_tabla_vista('',<?php echo $_POST['canid']; ?>);
</script>