<?php
session_start();
include("clases/covensol_seg_c_seguimiento.php");
$objseg = new covensol_seg_c_seguimiento();
$objseg->io_conexiones->decodificar_post();
$datos = $objseg->io_conexiones->asignar_post();
$datos['doc_gen_banco']=0;
$datos['cod_pro']='';
$datos['ced_bene']='';
if($datos['tipo_destino']=='P'){$datos['cod_pro']=$datos['codigo'];}
if($datos['tipo_destino']=='B'){$datos['ced_bene']=$datos['codigo'];}

//DOCUMENTOS QUE NACEN EN SEP O COMPRAS(SOC)
if($datos['tipo_destino']=='P' and $datos['cod_pro']){
	 ?>
		<br><br><br><br>
		<table width="1300" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		  <tr>
			<td width="1300" align="center"><strong style="font-size:14px"><br>DOCUMENTOS GENERADOS EN COMPRAS<br>&nbsp;</strong></td>
		  </tr>
		</table>		
	 <?php  
	 $resp = $objseg->BuscaOrdenesCompra($datos);
}
if( ($datos['tipo_destino']=='P' or $datos['tipo_destino']=='B') and ($datos['ced_bene'] or $datos['cod_pro']) ){
     ?>
		<br><br><br><br>
		<table width="1300" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		  <tr>
			<td width="1300" align="center"><strong style="font-size:14px"><br>DOCUMENTOS GENERADOS EN SEP<br>&nbsp;</strong></td>
		  </tr>
		</table>		
	 <?php  
	$resp = $objseg->BuscaSEP($datos);
}

//DOCUMENTOS QUE NACEN EN CXP
if( ($datos['tipo_destino']=='P' or $datos['tipo_destino']=='B') and ($datos['ced_bene'] or $datos['cod_pro']) ){
    ?>
	<br><br><br><br>
    <table width="1300" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td width="1300" align="center"><strong style="font-size:14px"><br>DOCUMENTOS GENERADOS EN CUENTAS POR PAGAR<br>&nbsp;</strong></td>
      </tr>
	</table>	
	<?php     
	$datos['estpre'] = 2;
	$resp = $objseg->BuscaRecepciones($datos);
}

//DOCUMENTOS QUE NACEN EN SCB(TESORERIA)

if( ($datos['tipo_destino']=='P' or $datos['tipo_destino']=='B') and ($datos['ced_bene'] or $datos['cod_pro']) ){
	?>
	<br><br><br><br>
    <table width="1300" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td width="1300" align="center"><strong style="font-size:14px"><br>DOCUMENTOS GENERADOS EN BANCO<br>&nbsp;</strong></td>
      </tr>
	</table>
	<br>
	<?php     
	$datos['doc_gen_banco'] = 1;
	$resp = $objseg->BuscaMovBco($datos);
}


?>
 
 