2021-05 03 14:21:45  
Nuevo(87101017,1)
		Caso :16 
2021-05 03 14:21:45  
cargar datos del sujeto(,,s,107,16)
	
				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=16 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 03 14:21:45  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 03 14:21:45  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
		CasoSeguimiento :28 
	EjecutarTarea_277() Formulario de reubicacion id_comp1117
				  1
		ValidarUsuario(277):1
			EjecutarPaso_454: form:42 , caso=16 id_comp 1117
				Mostrar form
 fin 2021-05-03  14:21:45
/******************************************************************************************************/

2021-05-03 14:21:45TraerCaso(16,107,)
 CargarCaso :16
2021-05 03 14:21:45  
CargarDatos: Caso :16
	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":"28","id":"28","1":"16","wf_caso_107_id":"16","2":"277","wf_tarea_id":"277","3":null,"core_usuario_id":null,"4":"2021-05-03 14:21:45","fec_asig":"2021-05-03 14:21:45","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 03 14:21:45  
cargar datos del sujeto(,,s,107,16)
	
				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=16 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 03 14:21:45  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 03 14:21:45  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
 fin 2021-05-03  14:21:45
/******************************************************************************************************/

2021-05-03 14:22:03TraerCaso(16,107,)
 CargarCaso :16
2021-05 03 14:22:03  
CargarDatos: Caso :16
	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":"28","id":"28","1":"16","wf_caso_107_id":"16","2":"277","wf_tarea_id":"277","3":null,"core_usuario_id":null,"4":"2021-05-03 14:21:45","fec_asig":"2021-05-03 14:21:45","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 03 14:22:03  
cargar datos del sujeto(,,s,107,16)
	
				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=16 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 03 14:22:03  
tabla dat adic
	select tabla from core_sujetoverificaciontipo where id=7
2021-05 03 14:22:03  
tabla :core_sujetoverificaciongeneral
	SELECT * FROM core_sujetoverificaciongeneral where id=87101017
2021-05 03 14:22:03  
Continuar(s,277,454,)
	EjecutarTarea_277() Formulario de reubicacion id_comp1117
				  1
		ValidarUsuario(277):1
			EjecutarPaso_454: form:42 , caso=16 id_comp 1117
				Paso::Guardar(Caso:16)
					Datos a guardar:
						Array
						(
						    [wf_proceso_id] => 107
						    [wf_paso_id] => 454
						    [wf_tarea_id] => 277
						    [wf_caso_id] => 16
						    [id] => 1117
						    [accion] => nextPaso
						    [reg] => s
						    [rta] => n
						    [cod_formulario2] => 42
						    [id_periodo] => 2021
						    [obs_ingreso] => 
						    [cod_bloque] => 242
						    [oid] => 
						    [oid_maestro] => 
						    [2533] => 124
						    [2534] => 2
						    [2535] => ZsZ
						    [2536] => 2021-05-01
						)
						
					OID: 22
					rta: 1 dato:22 tabla:sce.t42 
					CasoPaso:14
				CargarDatos_454(22)
							se carga 107_277_454_42_242_25362021-05-01
							se carga 107_277_454_42_242_2535ZsZ
							se carga 107_277_454_42_242_25342
							se carga 107_277_454_42_242_2533124
				SiguientePasoDe454: Funcion para ejecutar el siguiente paso 
			Condicion Tarea : true
		TerminarTarea(277,278)
			Ultimo seg :28 
			Ultimo seg :29 
	EjecutarTarea_278() Acta id_comp1117
				1  1
		ValidarUsuario(278):1
			EjecutarPaso_455: docs:102 , caso=16 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='xD';
					$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 rowspan="3" width="15%"><img src="'.$image_file.'" alt="a"  /></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.'</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;
					
					$radicado_ing='GSAU'.str_pad($fil_u['oid_rad'], 4, "0", STR_PAD_LEFT).'-'.$anio_rad;
					if(!$_REQUEST['NRS'] || $_REQUEST['NRS']!='s')
						$radicado_sal='GSAUR'.str_pad($fil_u['oid_rad'], 4, "0", STR_PAD_LEFT).'-'.$anio_rad;
					else
						$radicado_sal='SIN RADICADO DE SALIDA';
					
					
					$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);
					$fila1=$rs_art->fetchRow();
					
					$sqlArt2="SELECT 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 = $id_art;";
					$rs_art2=$con->Execute($sqlArt2);
					$fila2=$rs_art2->fetchRow();
					
					
					?>
					<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>
					<? echo $id_art; ?>
					<br>
					<? echo $id_obs; ?>
					<br>
					<? echo $fecha_reg; ?>
					<br>
					<? echo $id_sed; ?>
					<br />
					<br />
					<?php
					/*
						$sqlText="SELECT valor FROM public.core_config WHERE public.core_config.id=88;";
						$rs_text=$con->Execute($sqlText);
					    $texto=$rs_text->fetchRow();	
						echo $texto['valor'];
					*/
					?>
					
					
					<br><br>
					<strong>DATOS DEL ARTÍCULO:</strong><br>
					<table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3">
					
						<tr>
							<td width="19%"><strong>CÓDIGO: </strong><?php echo $fila1['id_cod_inv']; ?></td>
							<td width="19%"><strong>SERIAL: </strong><?php echo $fila1['id_ser_art']; ?></td>
							<td width="19%"><strong>NOMBRE: </strong><?php echo $fila1['id_nom_art']; ?></td>
							<td width="24%"><strong>DESCRIPCIÓN: </strong><?php echo $fila1['id_des']; ?></td>
							<td width="19%"><strong>REFERENCIA: </strong><?php echo $fila1['id_ref_art']; ?></td>
						</tr>
						<tr>
							<td><strong>FUNCIONARIO: </strong><?php echo $fila2['funcionario']; ?></td>
							<td><strong>SEDE: </strong><?php echo $fila2['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-05-01
					T107_277_454_42_242_2535:ZsZ
					T107_277_454_42_242_2534:2
					T107_277_454_42_242_2533:124
	Retorno :
	Array
	(
	    [ret] => inicioComponente_WF_DocSalida({"id":"1117","caso_id":"16","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\/699e12be28f22318e0537314bb6fb7ae.pdf\" target=\"_blank\" >De clic aqu&iacute; para descargar el archivo<\/a><\/div>"});
	    [suc] => 1
	)
	
 fin 2021-05-03  14:22:04
/******************************************************************************************************/