2022-07 08 16:42:28  
Nuevo(87101017,1)
		Caso :134 
2022-07 08 16:42:28  
cargar datos del sujeto(,,s,113,134)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_113 w
				inner join core_sujetoverificacion  s on w.id=134 AND s.id =w.core_sujetoverificacion_id
				inner join plan_municipio m on s.plan_municipio_id=m.id
				inner join core_sujetocategoria c on s.core_sujetocategoria_id=c.id
				
2022-07 08 16:42:28  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2022-07 08 16:42:28  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
		CasoSeguimiento :227 
	EjecutarTarea_285() Form id_comp1132
				  198
		ValidarUsuario(285):1
			EjecutarPaso_461: form:44 , caso=134 id_comp 1132
				Mostrar form
 fin 2022-07-08  16:42:28
/******************************************************************************************************/

2022-07-08 16:42:28TraerCaso(134,113,)
 CargarCaso :134
2022-07 08 16:42:28  
CargarDatos: Caso :134
	cargar datos de ejecucion de los ultimos pasos 
		select p.*,b.wf_tarea_id as tarea_id,
				u.apellido||' '||u.nombre|| ': '||u.cargo as usr_ejec
				from
				(select max(id) as id, wf_caso_113_seguimiento_id,wf_paso_id from wf_caso_113_pasos a1  group by wf_caso_113_seguimiento_id,wf_paso_id order by id
				)a
				inner join wf_caso_113_pasos p using(id,wf_caso_113_seguimiento_id)
				inner join ( select max(id) as wf_caso_113_seguimiento_id,wf_caso_113_id,wf_tarea_id from wf_caso_113_seguimiento where wf_caso_113_id =? group by wf_caso_113_id,wf_tarea_id order by wf_caso_113_id,wf_caso_113_seguimiento_id  ) b using(wf_caso_113_seguimiento_id)
				left join  usuarios  u using(core_usuario_id)  where tabla not in ('sce.t53')
		Error :
	cargar datos de ejecucion de las tareas (las ultimas si el proceso tiene ciclos) 
		select a.*, u.apellido||' '||u.nombre|| ': '||u.cargo as usr_asig  , ur.apellido||' '||ur.nombre|| ': '||ur.cargo as usr_resol from
				wf_caso_113_seguimiento a
				inner join (
				select max(b0.id) as id,b0.wf_caso_113_id,b0.wf_tarea_id from wf_caso_113_seguimiento b0  where b0.wf_caso_113_id =? group by b0.wf_caso_113_id,b0.wf_tarea_id order by wf_caso_113_id,id
				) b using(id)
				left join  usuarios  u using(core_usuario_id)
				left join  usuarios  ur on ur.core_usuario_id=core_usuario_id_resol
			{"0":"227","id":"227","1":"134","wf_caso_113_id":"134","2":"285","wf_tarea_id":"285","3":null,"core_usuario_id":null,"4":"2022-07-08 16:42:28","fec_asig":"2022-07-08 16:42:28","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"285","wf_tarea_id_sig":"285","8":null,"usr_asig":null,"9":null,"usr_resol":null}
2022-07 08 16:42:28  
cargar datos del sujeto(,,s,113,134)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_113 w
				inner join core_sujetoverificacion  s on w.id=134 AND s.id =w.core_sujetoverificacion_id
				inner join plan_municipio m on s.plan_municipio_id=m.id
				inner join core_sujetocategoria c on s.core_sujetocategoria_id=c.id
				
2022-07 08 16:42:29  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2022-07 08 16:42:29  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
 fin 2022-07-08  16:42:29
/******************************************************************************************************/

2022-07-08 16:42:56TraerCaso(134,113,)
 CargarCaso :134
2022-07 08 16:42:56  
CargarDatos: Caso :134
	cargar datos de ejecucion de los ultimos pasos 
		select p.*,b.wf_tarea_id as tarea_id,
				u.apellido||' '||u.nombre|| ': '||u.cargo as usr_ejec
				from
				(select max(id) as id, wf_caso_113_seguimiento_id,wf_paso_id from wf_caso_113_pasos a1  group by wf_caso_113_seguimiento_id,wf_paso_id order by id
				)a
				inner join wf_caso_113_pasos p using(id,wf_caso_113_seguimiento_id)
				inner join ( select max(id) as wf_caso_113_seguimiento_id,wf_caso_113_id,wf_tarea_id from wf_caso_113_seguimiento where wf_caso_113_id =? group by wf_caso_113_id,wf_tarea_id order by wf_caso_113_id,wf_caso_113_seguimiento_id  ) b using(wf_caso_113_seguimiento_id)
				left join  usuarios  u using(core_usuario_id)  where tabla not in ('sce.t53')
		Error :
	cargar datos de ejecucion de las tareas (las ultimas si el proceso tiene ciclos) 
		select a.*, u.apellido||' '||u.nombre|| ': '||u.cargo as usr_asig  , ur.apellido||' '||ur.nombre|| ': '||ur.cargo as usr_resol from
				wf_caso_113_seguimiento a
				inner join (
				select max(b0.id) as id,b0.wf_caso_113_id,b0.wf_tarea_id from wf_caso_113_seguimiento b0  where b0.wf_caso_113_id =? group by b0.wf_caso_113_id,b0.wf_tarea_id order by wf_caso_113_id,id
				) b using(id)
				left join  usuarios  u using(core_usuario_id)
				left join  usuarios  ur on ur.core_usuario_id=core_usuario_id_resol
			{"0":"227","id":"227","1":"134","wf_caso_113_id":"134","2":"285","wf_tarea_id":"285","3":null,"core_usuario_id":null,"4":"2022-07-08 16:42:28","fec_asig":"2022-07-08 16:42:28","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"285","wf_tarea_id_sig":"285","8":null,"usr_asig":null,"9":null,"usr_resol":null}
2022-07 08 16:42:56  
cargar datos del sujeto(,,s,113,134)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_113 w
				inner join core_sujetoverificacion  s on w.id=134 AND s.id =w.core_sujetoverificacion_id
				inner join plan_municipio m on s.plan_municipio_id=m.id
				inner join core_sujetocategoria c on s.core_sujetocategoria_id=c.id
				
2022-07 08 16:42:56  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2022-07 08 16:42:56  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
2022-07 08 16:42:56  
Continuar(s,285,461,)
	EjecutarTarea_285() Form id_comp1132
				  198
		ValidarUsuario(285):1
			EjecutarPaso_461: form:44 , caso=134 id_comp 1132
				Paso::Guardar(Caso:134)
					Datos a guardar:
						Array
						(
						    [wf_proceso_id] => 113
						    [wf_paso_id] => 461
						    [wf_tarea_id] => 285
						    [wf_caso_id] => 134
						    [id] => 1132
						    [accion] => nextPaso
						    [reg] => s
						    [rta] => n
						    [cod_formulario2] => 44
						    [id_periodo] => 2022
						    [obs_ingreso] => 
						    [cod_bloque] => 244
						    [oid] => 
						    [oid_maestro] => 
						    [2541] => 2078
						    [2542] => 236
						    [2543] => RETIRO
						    [2544] => 2022-07-08
						)
						
					OID: 95
					rta: 1 dato:95 tabla:sce.t44 
					CasoPaso:115
				CargarDatos_461(95)
							se carga 113_285_461_44_244_25442022-07-08
							se carga 113_285_461_44_244_2543RETIRO
							se carga 113_285_461_44_244_2542236
							se carga 113_285_461_44_244_25412078
				SiguientePasoDe461: Funcion para ejecutar el siguiente paso 
			Condicion Tarea : true
		TerminarTarea(285,286)
			Ultimo seg :227 
			Ultimo seg :228 
	EjecutarTarea_286() Acta id_comp1132
				198  198
		ValidarUsuario(286):1
			EjecutarPaso_462: docs:105 , caso=134 id_comp 1132
				Mostrar docs
					$tit_formato='ACTA DE REASIGNACIÓN DE ELEMENTOS';
					
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					require_once($root.'/lib/tcpdf/config/lang/eng.php');
					require_once($root.'/lib/tcpdf/tcpdf.php');
					
					//--------------------------------------------------------------------------
					class MYPDF extends TCPDF {
					
					    //Page header
					    public function Header() {
					        // Logo
					      
					//echo str_replace('$root_js',$root_js,$CONFIG['CABECERA_FORMATOS_HTML']);
					$codigo='GCSP-F-135';
					$versión='001';
					$fecha=getdate();
					$titulo='ACTA DE REASIGNACIÓN DE ELEMENTOS';
					
					
					$cab=$CONFIG['CABECERA_REPORTES'];
					$h="'".str_replace(array('$root_js','_LOGO_','_TITULO_','_CODFORM_','_VERSION_','_FECHAACTUAL_','border="1"'),
					array($root_js,$root_js.$CONFIG['LOGO_REPORTES'],'BANCO DE PROGRAMAS Y PROYECTOS DE INVERSIÓN DEPARTAMENTAL',' BPI-FVR01',' 01',' 03-12-2014','border="1" bordercolor="#000000"'),
					$cab)."'";
					 $image_file = K_PATH_IMAGES.'logo_uds_3.png';
					 $image_file2 = K_PATH_IMAGES.'logo_ani.jpg';
					$htm='<table width="100%" height="5%" border="0.2" cellspacing="0" bordercolor="#000000" cellpadding="3" style="font-size:8pt" >
					  <tr>
					    <td rowspan="3" width="15%"><img src="'.$image_file2.'" alt="a"  /></td>
					    <td colspan="2" width="50%"><div align="center"><strong>SISTEMA INTEGRADO DE INVENTARIOS</strong></div></td>
					    <td width="20%"><strong>Código:</strong> '.$codigo.'</td>
					  </tr>
					  <tr>
					    <td width="12%"><strong>PROCESO</strong></td>
					    <td width="38%"><div align="center">GESTIÓN DE CAMBIOS</div></td>
					    <td><strong>Versión:</strong> '.$versión.'</td>
					  </tr>
					  <tr>
					    <td><strong>FORMATO</strong></td>
					    <td><div align="center">'.$titulo.'</div></td>
					    <td><strong>Fecha:</strong> '.$fecha['year'].'-'.$fecha['mon'].'-'.$fecha['mday'].'</td>
					  </tr>
					</table>';
					
					     $this->writeHTMLCell( 0,  0, '', '', $htm,  0,1, 0,  true,  'top',  true);
					
					
					    }
					
					    // Page footer
					    public function Footer() {
					        // Position at 15 mm from bottom
					        $this->SetY(-18);
							$this->writeHTMLCell( 0,  0, '', '', "<div align=\"center\">Avenida Calle 26 Nro. 59-51 Torre 4 y/o Calle 24A Nro. 59-42 Torre 4 Piso 2 <br/>PBX: 4848860-www.ani.gov.co, Nit 830125996-9 </div>",  0,1, 0,  true,  'top',  true);
						}
					}
					//--------------------------------------------------------------------------
					
					// create new PDF document
					$pdf = new MYPDF('p', 'mm', 'letter', true, 'UTF-8', false);
					
					// set document information
					$pdf->SetCreator(PDF_CREATOR);
					$pdf->SetAuthor('Siti');
					$pdf->SetTitle('Seguimiento');
					$pdf->SetSubject('Certificado');
					$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
					
					// set default header data
					$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
					
					// set header and footer fonts
					$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
					$pdf->setFooterFont(Array(PDF_FONT_NAME_MAIN, '', 8));
					
					// set default monospaced font
					$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
					
					// set margins
					$pdf->SetMargins(PDF_MARGIN_LEFT, 45, PDF_MARGIN_RIGHT);
					$pdf->SetHeaderMargin(13);
					$pdf->SetFooterMargin(40);
					
					// set auto page breaks
					$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
					
					// set image scale factor
					$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
					//set some language-dependent strings
					$pdf->setLanguageArray($l);
					
					// ---------------------------------------------------------
					
					// NOTE: 2D barcode algorithms must be implemented on 2dbarcode.php class file.
					
					// set font
					$pdf->SetFont('times', '', 10); 
					
					// add a page
					$pdf->AddPage();
					
					// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
					$fils=4;
					$cols=3;
					$logo_empresa=$CONFIG['LOGO_EMPRESA'];
					$codigo=$root_js.'build/view/common/marco/index.php?particular=001&accion=I&proc='.$CONFIG['PROCESO_STICKER'];
					$izq=10+2;$der=10;$arr=10; $abj=10;
					
					$sxp=$fils*$cols;
					$tot=$rangoF-$rangoI+1;
					$pags=ceil(($tot)/$sxp);
					$anchoR=216-$izq-$der;
					$altoR=279-$arr-$abj;
					$anchoS=$anchoR/$cols;
					$margenSV=2;
					$margenSH=5;
					$altoS=$altoR/$fils;
					$altoImg=10;
					$altoText=8;
					$altoC=50;
					
					// set style for barcode
					$style = array(
					    'border' => 2,
					    'vpadding' => 'auto',
					    'hpadding' => 'auto',
					    'fgcolor' => array(0,0,0),
					    'bgcolor' => false, //array(255,255,255)
					    'module_width' => 1, // width of a single module in points
					    'module_height' => 1 // height of a single module in points
					);
					
					$pdf->SetFont('times', '', 9, '', false);
					$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
					
					$s=0;$p=1;$consc=$rangoI;
					$y=$arr;
					$x=$izq;
					// create some HTML content
					ob_start();
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					
					$id_artSlct='  113_285_461_44_244_2541  ';
					$id_obs='  113_285_461_44_244_2543  ';
					$fecha_reg='  113_285_461_44_244_2544  ';
					$id_fun='  113_285_461_44_244_2542  ';	
					
					
					$porciones = explode(",", $id_artSlct);
					
					
					//$id_artSlct = preg_replace('([^0-9])', '', $id_artSlct);
					//$id_artSlcttr=trim($porciones[0]);
					$porciones = explode(",", $id_artSlct);
					$id_artSlcttr=trim($porciones[0]);
					
					$sqlidart="SELECT oid FROM sce.t30 WHERE id_cod_inv='$id_artSlcttr'";
					$rs_xxd=$con->Execute($sqlidart);
					$id_artx=$rs_xxd->fetchRow();
					$id_art=$id_artx['oid'];
					
					
					
					
					$sql="select oid_rad, extract (year from  fecha_core_usuario_id_creacion )-2000 as anio_rad from sce.t1 where wf_caso_id=? order by oid desc";
					$id='{"pro":"113","cas":"'.$this->caso->id.'"}';
					$rs_u=$con->Execute($sql,$id);
					$fil_u=$rs_u->fetchRow();
					$oid_1=$fil_u['oid_rad'];
					$anio_rad=$fil_u['anio_rad'];
					
					
					
					
					$id_art_tr=trim($id_art);
					
					$sqlArt="SELECT id_cod_inv,id_ser_art,id_nom_art,id_des,id_ref_art FROM sce.t30 WHERE t30.oid=$id_art;";
					$rs_art=$con->Execute($sqlArt);
					$filax=$rs_art->fetchRow();
					
					$sqlFun="SELECT  t29.id_nom AS nombre, t29.id_ape AS apellido FROM sce.t29 t29 
					WHERE t29.oid = $id_fun;";
					$rs_fun=$con->Execute($sqlFun);
					$filay=$rs_fun->fetchRow();
					
					
					$sqlArtFun="SELECT t30.id_ser_art AS serial,  t30.id_nom_art AS articulo, t30.id_des as descripcion FROM sce.t30 t30 LEFT JOIN 
					sce.t35 t35 ON  t30.oid=t35.art LEFT JOIN sce.t29 t29 ON t35.fun=t29.oid 
					WHERE t29.oid = $id_fun;";
					$rs_afun=$con->Execute($sqlArtFun);
					
					
					
					
					?>
					<div align="center"><br />
					  <strong>SISTEMA DE INVENTARIOS<br />
					  GESTIÓN DE CAMBIOS<br /><br />
					  ACTA DE REASIGNACIÓN DE ELEMENTOS<br />  
					  </strong><br /><br />
					</div>
					
					 Fecha de la reasignación: <?php echo $fecha_reg;?></td>
					 
					<br />
					<br />
					
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					  <tr>
					    <td><strong>FUNCIONARIO </strong></td>	
					    <td><?php echo $filay['nombre']; echo " ".$filay['apellido'] ?></td>	
						</tr>
					</table>
					<br><strong>Artículos asociados:</strong><br>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					  <tr> 
					    <th align="center"><strong>Serial</strong></th>
					    <th align="center"><strong>Artículo</strong></th>
					    <th align="center"><strong>Descripción</strong></th>
					  </tr>
					  <?php while($filaz=$rs_afun->fetchRow()) {?>
					  <tr>
						  <td align="center"><?php echo $filaz['serial']; ?></td>	
					    <td align="center"><?php echo $filaz['articulo']; ?></td>	
					    <td align="center"><?php echo $filaz['descripcion']; ?></td>	
						</tr>
					  <?php } ?>
					</table>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					  <tr>
							<th align="center"><strong>OBSERVACIÓN </strong></th>
						</tr>
					  <tr>
							<td align="center"><?php echo $id_obs; ?></td>
						</tr>
					</table>
					<br><br><br>
					<strong>ARTÍCULO REASIGNADO:</strong><br><br>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					
						<tr>
							<td width="19%"><strong>CÓDIGO: </strong><?php echo $filax['id_cod_inv']; ?></td>
							<td width="19%"><strong>SERIAL: </strong><?php echo $filax['id_ser_art']; ?></td>
							<td width="19%"><strong>NOMBRE: </strong><?php echo $filax['id_nom_art']; ?></td>
							<td width="24%"><strong>DESCRIPCIÓN: </strong><?php echo $filax['id_des']; ?></td>
							<td width="19%"><strong>REFERENCIA: </strong><?php echo $filax['id_ref_art']; ?></td>
						</tr>
					</table>
					
					
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					_____________________
					<br /> <? ;?>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Firma Encargado</strong>
					<br /><br /><br />
					<?php 
					  $sqlFunAnt="SELECT t29.oid AS id, t29.id_nom AS nombre, t29.id_ape AS apellido FROM sce.t30 t30 LEFT JOIN 
					  sce.t35 t35 ON  t30.oid=t35.art LEFT JOIN sce.t29 t29 ON t35.fun=t29.oid 
					  WHERE t30.oid = $id_art;";
					  $rs_funAnt=$con->Execute($sqlFunAnt);
					  $filaFunAnt=$rs_funAnt->fetchRow();
					    $id_fun_ant=$filaFunAnt['id'];
					    $sqlHistory= "INSERT INTO sce.t46 (id_art,id_fun) VALUES ($id_art, $id_fun_ant);";
					   $rs_his=$con->Execute($sqlHistory);
					
					
					  $sqlUpdate= "UPDATE sce.t35 SET fun=$id_fun WHERE art=$id_art;";
					  $rs_xyz=$con->Execute($sqlUpdate);
					  
					?>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					  <tr>
					    <th><strong>FUNCIONARIO ANTERIOR </strong></th>	
					    <th><strong>NUEVO FUNCIONARIO</strong></th>	
						</tr>
					  <tr>
					    <td><?php echo $filaFunAnt['nombre']; echo " ".$filaFunAnt['apellido'] ?></td>	
					    <td><?php echo $filay['nombre']; echo " ".$filay['apellido'] ?></td>	
						</tr>
					</table>
					
					<?
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					/*-------------------------------------------------------------------------------*/ 
					$html=ob_get_clean();
					// output the HTML content
					$pdf->writeHTML($html, true, false,false,false);
					// reset pointer to the last page
					$pdf->lastPage();
					$nomdoc=md5(time()).'.pdf';
					$pdf->Output($root."/tmp/".$nomdoc, 'F');
					$url=$root_js.'tmp/'.$nomdoc;
					
					T113_285_461_44_244_2544:2022-07-08
					T113_285_461_44_244_2543:RETIRO
					T113_285_461_44_244_2542:236
					T113_285_461_44_244_2541:1133,PUESTO DE 1.50 X 0.60SENCILLO,S/N
	Retorno :
	Array
	(
	    [ret] => inicioComponente_WF_DocSalida({"id":"1132","caso_id":"134","proceso_id":113,"tit":"Acta","tarea_id":286,"paso_id":462,"desc":"<strong>Reasignacion<\/strong>: ","url":"<a href=\"http:\/\/201.182.250.54\/sisad16\/tmp\/83f432869b606c74972c93414a06b6ec.pdf\" target=\"_blank\" >De clic aqu&iacute; para descargar el archivo<\/a><\/div>"});
	    [suc] => 1
	)
	
 fin 2022-07-08  16:42:58
/******************************************************************************************************/