2021-05 10 15:20:56  
Nuevo(87101017,1)
		Caso :53 
2021-05 10 15:20:56  
cargar datos del sujeto(,,s,107,53)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_107 w
				inner join core_sujetoverificacion  s on w.id=53 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
				
2021-05 10 15:20:56  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 10 15:20:56  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
		CasoSeguimiento :99 
	EjecutarTarea_277() Formulario de reubicacion id_comp1117
				  1
		ValidarUsuario(277):1
			EjecutarPaso_454: form:42 , caso=53 id_comp 1117
				Mostrar form
 fin 2021-05-10  15:20:57
/******************************************************************************************************/

2021-05-10 15:20:57TraerCaso(53,107,)
 CargarCaso :53
2021-05 10 15:20:57  
CargarDatos: Caso :53
	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_107_seguimiento_id,wf_paso_id from wf_caso_107_pasos a1  group by wf_caso_107_seguimiento_id,wf_paso_id order by id
				)a
				inner join wf_caso_107_pasos p using(id,wf_caso_107_seguimiento_id)
				inner join ( select max(id) as wf_caso_107_seguimiento_id,wf_caso_107_id,wf_tarea_id from wf_caso_107_seguimiento where wf_caso_107_id =? group by wf_caso_107_id,wf_tarea_id order by wf_caso_107_id,wf_caso_107_seguimiento_id  ) b using(wf_caso_107_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_107_seguimiento a
				inner join (
				select max(b0.id) as id,b0.wf_caso_107_id,b0.wf_tarea_id from wf_caso_107_seguimiento b0  where b0.wf_caso_107_id =? group by b0.wf_caso_107_id,b0.wf_tarea_id order by wf_caso_107_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":"99","id":"99","1":"53","wf_caso_107_id":"53","2":"277","wf_tarea_id":"277","3":null,"core_usuario_id":null,"4":"2021-05-10 15:20:56","fec_asig":"2021-05-10 15:20:56","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"277","wf_tarea_id_sig":"277","8":null,"usr_asig":null,"9":null,"usr_resol":null}
2021-05 10 15:20:57  
cargar datos del sujeto(,,s,107,53)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_107 w
				inner join core_sujetoverificacion  s on w.id=53 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
				
2021-05 10 15:20:57  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 10 15:20:57  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
 fin 2021-05-10  15:20:57
/******************************************************************************************************/

2021-05-10 15:21:37TraerCaso(53,107,)
 CargarCaso :53
2021-05 10 15:21:37  
CargarDatos: Caso :53
	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_107_seguimiento_id,wf_paso_id from wf_caso_107_pasos a1  group by wf_caso_107_seguimiento_id,wf_paso_id order by id
				)a
				inner join wf_caso_107_pasos p using(id,wf_caso_107_seguimiento_id)
				inner join ( select max(id) as wf_caso_107_seguimiento_id,wf_caso_107_id,wf_tarea_id from wf_caso_107_seguimiento where wf_caso_107_id =? group by wf_caso_107_id,wf_tarea_id order by wf_caso_107_id,wf_caso_107_seguimiento_id  ) b using(wf_caso_107_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_107_seguimiento a
				inner join (
				select max(b0.id) as id,b0.wf_caso_107_id,b0.wf_tarea_id from wf_caso_107_seguimiento b0  where b0.wf_caso_107_id =? group by b0.wf_caso_107_id,b0.wf_tarea_id order by wf_caso_107_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":"99","id":"99","1":"53","wf_caso_107_id":"53","2":"277","wf_tarea_id":"277","3":null,"core_usuario_id":null,"4":"2021-05-10 15:20:56","fec_asig":"2021-05-10 15:20:56","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"277","wf_tarea_id_sig":"277","8":null,"usr_asig":null,"9":null,"usr_resol":null}
2021-05 10 15:21:37  
cargar datos del sujeto(,,s,107,53)
	
				select  s.*, m.nombre as nom_muni, c.nom_cat,fec_caso
				from  wf_caso_107 w
				inner join core_sujetoverificacion  s on w.id=53 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
				
2021-05 10 15:21:37  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 10 15:21:37  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
2021-05 10 15:21:37  
Continuar(s,277,454,)
	EjecutarTarea_277() Formulario de reubicacion id_comp1117
				  1
		ValidarUsuario(277):1
			EjecutarPaso_454: form:42 , caso=53 id_comp 1117
				Paso::Guardar(Caso:53)
					Datos a guardar:
						Array
						(
						    [wf_proceso_id] => 107
						    [wf_paso_id] => 454
						    [wf_tarea_id] => 277
						    [wf_caso_id] => 53
						    [id] => 1117
						    [accion] => nextPaso
						    [reg] => s
						    [rta] => n
						    [cod_formulario2] => 42
						    [id_periodo] => 2021
						    [obs_ingreso] => 
						    [cod_bloque] => 242
						    [oid] => 
						    [oid_maestro] => 
						    [2533] => 111
						    [2534] => 3
						    [2535] => REUBICACIÓN
						    [2536] => 2021-04-26
						)
						
					OID: 57
					rta: 1 dato:57 tabla:sce.t42 
					CasoPaso:63
				CargarDatos_454(57)
							se carga 107_277_454_42_242_25362021-04-26
							se carga 107_277_454_42_242_2535REUBICACIÓN
							se carga 107_277_454_42_242_25343
							se carga 107_277_454_42_242_2533111
				SiguientePasoDe454: Funcion para ejecutar el siguiente paso 
			Condicion Tarea : true
		TerminarTarea(277,278)
			Ultimo seg :99 
			Ultimo seg :100 
	EjecutarTarea_278() Acta id_comp1117
				1  1
		ValidarUsuario(278):1
			EjecutarPaso_455: docs:102 , caso=53 id_comp 1117
				Mostrar docs
					$tit_formato='ACTA DE REUBICACIÓ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 REUBICACIÓ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_art='  107_277_454_42_242_2533  ';
					$id_obs='  107_277_454_42_242_2535  ';
					$fecha_reg='  107_277_454_42_242_2536  ';
					$id_sed='  107_277_454_42_242_2534  ';	
					
					$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":"107","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'];
					
					/*$anio_rad='select extract (year from  fecha_core_usuario_id_creacion ) as anio from sce.t1  where wf_caso_id=?';
					$id_rad='{"pro":"107","cas":"'.$this->caso->id.'"}';
					$rs_u_rad=$con->Execute($anio_rad,$id_rad);
					$anio=$rs_u_rad['anio']-2000;*/
					$anio=date('Y')-2000;
					
					
					
					$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.id_ser_art='$id_art_tr';";
					$rs_art=$con->Execute($sqlArt);
					$filaa=$rs_art->fetchRow();
					
					
					$sqlArt2="SELECT t27.oid AS id, t29.id_nom AS funcionario, (t27.id_sed ||'-'|| t27.id_ubi) AS sede from sce.t35 t35 LEFT JOIN sce.t29 t29 ON t35.fun = t29.oid
					LEFT JOIN sce.t27 t27 ON t35.sed = t27.oid
					WHERE t35.art = (SELECT oid FROM sce.t30 WHERE sce.t30.id_ser_art='$id_art_tr');";
					$rs_art2=$con->Execute($sqlArt2);
					$filab=$rs_art2->fetchRow();
					$id_sed_ant=$filab['id'];
					
					   $sqlHistory= "INSERT INTO sce.t47 (id_art,id_sed) VALUES ($id_art, $id_sed_ant);";
					   $rs_his=$con->Execute($sqlHistory);
					
					
					?>
					<div align="center"><br />
					  <strong>SISTEMA DE INVENTARIOS<br />
					  GESTIÓN DE CAMBIOS<br /><br />
					  ACTA DE REUBICACIÓN DE ELEMENTOS<br />  
					  </strong><br /><br />
					</div>
					
					 Fecha de la reubicación: <?php echo $fecha_reg;?></td>
					 
					<br />
					<br />
					<?php
					    $sqlArtic="SELECT CAST (oid AS BIGINT) AS art FROM sce.t30 WHERE id_ser_art='$id_art_tr'";
					    $rs_artic=$con->Execute($sqlArtic);
					    $identificador=$rs_artic->fetchRow();
					    $sqlAAA="SELECT CAST (oid AS BIGINT) AS sed FROM sce.t27 where oid=$id_sed";
					    $rs_AAA=$con->Execute($sqlAAA);
					    $id_sedee=$rs_AAA->fetchRow();
					    $id_sede=$id_sedee['sed'];
					
					    $sqlSede="SELECT (t27.id_sed ||'-'|| t27.id_ubi) AS sede FROM sce.t27 WHERE sce.t27.oid = $id_sed;";
						$rs_sed=$con->Execute($sqlSede);
					    $texto2=$rs_sed->fetchRow();	 
						$sqlText="SELECT valor FROM public.core_config WHERE public.core_config.id=89;";
						$rs_text=$con->Execute($sqlText);
					    $texto=$rs_text->fetchRow();	
						echo $texto['valor'];
					    echo $texto2['sede'];
					    
					   
					    $sqlUpdte="UPDATE sce.t35 SET sed=$id_sede WHERE art =".$identificador['art'].";";
					    $rs_updte=$con->Execute($sqlUpdte);
					    
					
					?>
					
					
					
					<br><br>
					<strong>DATOS DEL ARTÍCULO:</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 $filaa['id_cod_inv']; ?></td>
							<td width="19%"><strong>SERIAL: </strong><?php echo $filaa['id_ser_art']; ?></td>
							<td width="19%"><strong>NOMBRE: </strong><?php echo $filaa['id_nom_art']; ?></td>
							<td width="24%"><strong>DESCRIPCIÓN: </strong><?php echo $filaa['id_des']; ?></td>
							<td width="19%"><strong>REFERENCIA: </strong><?php echo $filaa['id_ref_art']; ?></td>
						</tr>
					</table>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					    <tr>
							<td><strong>FUNCIONARIO: </strong><?php echo $filab['funcionario']; ?></td>
							<td><strong>SEDE: </strong><?php echo $filab['sede']; ?></td>		
						</tr>
					</table><br>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					    <tr>
							<td><strong>OBSERVACIÓN: </strong><?php echo $id_obs; ?></td>
						</tr>
					</table>
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					_____________________
					<br /> <? $a=' ';?>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Firma Encargado</strong>
					<br /><br /><br />
					Queda constancia del translado del artículo anteriormente citado sea transladado de la siguiente manera:
					<br><br>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					   <tr>
					        <th align="center"><strong>SEDE ANTERIOR</strong></th>
					        <th align="center"><strong><?php echo $a; ?></strong></th>
					        <th align="center"><strong>NUEVA SEDE</strong></th>
					   </tr>
					    <tr>
							<td align="center"><?php echo $filab['sede']; ?></td>
					        <td align="center"><strong>-></strong></td>
							<td align="center"><?php echo $texto2['sede']; ?></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;
					
					T107_277_454_42_242_2536:2021-04-26
					T107_277_454_42_242_2535:REUBICACIÓN
					T107_277_454_42_242_2534:3
					T107_277_454_42_242_2533:111
	Retorno :
	Array
	(
	    [ret] => inicioComponente_WF_DocSalida({"id":"1117","caso_id":"53","proceso_id":107,"tit":"Acta","tarea_id":278,"paso_id":455,"desc":"<strong>prueba<\/strong>: prueba","url":"<a href=\"http:\/\/201.182.250.54\/sisad16\/tmp\/290d5433f81b15b4d873ef95f0d299ed.pdf\" target=\"_blank\" >De clic aqu&iacute; para descargar el archivo<\/a><\/div>"});
	    [suc] => 1
	)
	
 fin 2021-05-10  15:21:37
/******************************************************************************************************/