<script language="javascript">
document.getElementById('xndocumento').value = '';
</script>

<?php
session_start();

include("conexion.php");

@$xserie = $_REQUEST['xserie'];
@$xpagodocumento = $_REQUEST['xpagodocumento'];


$r = mysqli_query($conexion,"SELECT * FROM comprobante_serie c WHERE comser_serie='$xserie' AND comtip_codigo_fk='$xpagodocumento';");
while($row=mysqli_fetch_array($r)){
	$xcor = "0000000".$row['comser_correlativo'];
	$xcodigo = substr($xcor, strlen($xcor)-7, 7);
	
	$ncomprobante = $xserie."-".$xcodigo;
	
	//echo $ncomprobante;
	?>
	<script language="javascript">
	//alert("ncomprobante: <?php echo $ncomprobante; ?>");
	</script>
	<?php
	
	
	
	?>	
	<script language="javascript">
	//document.getElementById('xndocumento').value = '<?php echo $ncomprobante;?>';
	document.getElementById('xndocumento_nota').value = '<?php echo $ncomprobante;?>';	
	</script>
	<?php	
}

?>

