2021-06 16 00:36:54 Nuevo(87101017,1) Caso :169 2021-06 16 00:36:54 cargar datos del sujeto(,,s,99,169) select s.*, m.nombre as nom_muni, c.nom_cat,fec_caso from wf_caso_99 w inner join core_sujetoverificacion s on w.id=169 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-06 16 00:36:54 tabla dat adic select tabla from core_sujetoverificaciontipo where id=7 2021-06 16 00:36:54 tabla :core_sujetoverificaciongeneral SELECT * FROM core_sujetoverificaciongeneral where id=87101017 CasoSeguimiento :305 EjecutarTarea_273() Formulario dar de baja id_comp1107 1 ValidarUsuario(273):1 EjecutarPaso_442: form:39 , caso=169 id_comp 1107 Mostrar form fin 2021-06-16 00:36:54 /******************************************************************************************************/ 2021-06-16 00:36:54TraerCaso(169,99,) CargarCaso :169 2021-06 16 00:36:54 CargarDatos: Caso :169 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_99_seguimiento_id,wf_paso_id from wf_caso_99_pasos a1 group by wf_caso_99_seguimiento_id,wf_paso_id order by id )a inner join wf_caso_99_pasos p using(id,wf_caso_99_seguimiento_id) inner join ( select max(id) as wf_caso_99_seguimiento_id,wf_caso_99_id,wf_tarea_id from wf_caso_99_seguimiento where wf_caso_99_id =? group by wf_caso_99_id,wf_tarea_id order by wf_caso_99_id,wf_caso_99_seguimiento_id ) b using(wf_caso_99_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_99_seguimiento a inner join ( select max(b0.id) as id,b0.wf_caso_99_id,b0.wf_tarea_id from wf_caso_99_seguimiento b0 where b0.wf_caso_99_id =? group by b0.wf_caso_99_id,b0.wf_tarea_id order by wf_caso_99_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":"305","id":"305","1":"169","wf_caso_99_id":"169","2":"273","wf_tarea_id":"273","3":null,"core_usuario_id":null,"4":"2021-06-16 00:36:54","fec_asig":"2021-06-16 00:36:54","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"273","wf_tarea_id_sig":"273","8":null,"usr_asig":null,"9":null,"usr_resol":null} 2021-06 16 00:36:54 cargar datos del sujeto(,,s,99,169) select s.*, m.nombre as nom_muni, c.nom_cat,fec_caso from wf_caso_99 w inner join core_sujetoverificacion s on w.id=169 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-06 16 00:36:54 tabla dat adic select tabla from core_sujetoverificaciontipo where id=7 2021-06 16 00:36:54 tabla :core_sujetoverificaciongeneral SELECT * FROM core_sujetoverificaciongeneral where id=87101017 fin 2021-06-16 00:36:54 /******************************************************************************************************/ 2021-06-16 00:37:16TraerCaso(169,99,) CargarCaso :169 2021-06 16 00:37:16 CargarDatos: Caso :169 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_99_seguimiento_id,wf_paso_id from wf_caso_99_pasos a1 group by wf_caso_99_seguimiento_id,wf_paso_id order by id )a inner join wf_caso_99_pasos p using(id,wf_caso_99_seguimiento_id) inner join ( select max(id) as wf_caso_99_seguimiento_id,wf_caso_99_id,wf_tarea_id from wf_caso_99_seguimiento where wf_caso_99_id =? group by wf_caso_99_id,wf_tarea_id order by wf_caso_99_id,wf_caso_99_seguimiento_id ) b using(wf_caso_99_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_99_seguimiento a inner join ( select max(b0.id) as id,b0.wf_caso_99_id,b0.wf_tarea_id from wf_caso_99_seguimiento b0 where b0.wf_caso_99_id =? group by b0.wf_caso_99_id,b0.wf_tarea_id order by wf_caso_99_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":"305","id":"305","1":"169","wf_caso_99_id":"169","2":"273","wf_tarea_id":"273","3":null,"core_usuario_id":null,"4":"2021-06-16 00:36:54","fec_asig":"2021-06-16 00:36:54","5":null,"core_usuario_id_resol":null,"6":null,"fec_resol":null,"7":"273","wf_tarea_id_sig":"273","8":null,"usr_asig":null,"9":null,"usr_resol":null} 2021-06 16 00:37:16 cargar datos del sujeto(,,s,99,169) select s.*, m.nombre as nom_muni, c.nom_cat,fec_caso from wf_caso_99 w inner join core_sujetoverificacion s on w.id=169 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-06 16 00:37:16 tabla dat adic select tabla from core_sujetoverificaciontipo where id=7 2021-06 16 00:37:16 tabla :core_sujetoverificaciongeneral SELECT * FROM core_sujetoverificaciongeneral where id=87101017 2021-06 16 00:37:16 Continuar(s,273,442,) EjecutarTarea_273() Formulario dar de baja id_comp1107 1 ValidarUsuario(273):1 EjecutarPaso_442: form:39 , caso=169 id_comp 1107 Paso::Guardar(Caso:169) Datos a guardar: Array ( [wf_proceso_id] => 99 [wf_paso_id] => 442 [wf_tarea_id] => 273 [wf_caso_id] => 169 [id] => 1107 [accion] => nextPaso [reg] => s [rta] => n [cod_formulario2] => 39 [id_periodo] => 2021 [obs_ingreso] => [cod_bloque] => 239 [oid] => [oid_maestro] => [2518] => 30 [2519] => prueba nnmj|23 [2520] => 2021-06-02 ) OID: 137 rta: 1 dato:137 tabla:sce.t39 CasoPaso:204 CargarDatos_442(137) se carga 99_273_442_39_239_25202021-06-02 se carga 99_273_442_39_239_2519prueba nnmj|23 se carga 99_273_442_39_239_251830 SiguientePasoDe442: Funcion para ejecutar el siguiente paso Condicion Tarea : true TerminarTarea(273,274) Ultimo seg :305 Ultimo seg :306 EjecutarTarea_274() Acta de baja id_comp1107 1 1 ValidarUsuario(274):1 EjecutarPaso_443: docs:100 , caso=169 id_comp 1107 Mostrar docs $tit_formato='ACTA DE DADO DE BAJA'; /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ 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='SEGUIMIENTO DE BAJA DE ARTÃCULOS'; $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="2%" border="0.2" cellspacing="0" bordercolor="#000000" cellpadding="3" style="font-size:8pt" > <tr> <td rowspan="2" width="25%"> <img src="'.$image_file2.'" alt="a" /> </td> <td colspan="2" width="50%"><div align="center"><strong>BAJA DE ELEMENTOS</strong></div></td> <td width="25%" align="center"><strong>Código:</strong> '.$codigo.'</td> </tr> <tr> <td align="center"><strong>FORMATO</strong></td> <td align="center"><div>'.$titulo.'</div></td> <td align="center"><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 18 Nro. 28-16 Segundo Piso <br/>PBX: 4848860-www.siticol.com, 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=' 99_273_442_39_239_2518 '; $id_obs=' 99_273_442_39_239_2519 '; $fecha_reg=' 99_273_442_39_239_2520 '; $porciones = explode(",", $id_artSlct); //$id_artSlct = preg_replace('([^0-9])', '', $id_artSlct); //$id_artSlcttr=trim($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":"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; $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); $fila1a=$rs_art->fetchRow(); $sqlArt2="SELECT id_cat_art,id_pro_art,id_fac,id_fec_com,id_val FROM sce.t30 WHERE t30.oid=$id_art;"; $rs_art2=$con->Execute($sqlArt2); $fila2a=$rs_art2->fetchRow(); ?> <br /><br /><br /> <div align="center"><br /> <strong>SISTEMA DE INVENTARIOS<br /><br /> ACTA DE BAJA DE ELEMENTOS<br /> </strong><br /> </div> Fecha de la baja: <?php echo $fecha_reg;?></td> <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 $fila1a['id_cod_inv']; ?></td> <td width="19%"><strong>SERIAL: </strong><?php echo $fila1a['id_ser_art']; ?></td> <td width="19%"><strong>NOMBRE: </strong><?php echo $fila1a['id_nom_art']; ?></td> <td width="24%"><strong>DESCRIPCIÓN: </strong><?php echo $fila1a['id_des']; ?></td> <td width="19%"><strong>REFERENCIA: </strong><?php echo $fila1a['id_ref_art']; ?></td> </tr> <tr> <td><strong>CATEGORÃA: </strong><?php echo $fila2a['id_cat_art']; ?></td> <td><strong>PROVEEDOR: </strong><?php echo $fila2a['id_pro_art']; ?></td> <td><strong>Nº FACTURA: </strong><?php echo $fila2a['id_fac']; ?></td> <td><strong>FECHA COMPRA: </strong><?php echo $fila2a['id_fec_com']; ?></td> <td><strong>VALOR: </strong>$<?php echo $fila2a['id_val']; ?></td> </tr> </table> <table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3" > <tr> <td align="center"><strong>OBSERVACIÓN</strong></td> </tr> <tr> <td align="center"><?php echo $id_obs; ?></td> </tr> </table><br /> <strong>COMPONENTES ASOCIADOS:</strong><br> <table width="100%" border="0.1" cellspacing="0" bordercolor="#000000" cellpadding="3"> <tr> <th align="center"><strong>Nº</strong></th> <th align="center"><strong>COMPONENTE</strong></th> <th align="center"><strong>CANTIDAD</strong></th> <th align="center"><strong>DETEALLE</strong></th> <th align="center"><strong>OBSERVACIÓN</strong></th> </tr> <?php $sqlUpd=" UPDATE sce.t30 SET id_est_act=2 WHERE oid=$id_art;"; $rs_upd = $con->Execute($sqlUpd); $id_art_tr=trim($id_art); $sqlHistCount=" SELECT COUNT(t38.oid) FROM sce.t38 t38 LEFT JOIN sce.t37 t37 ON t38.oid_maestro=t37.oid WHERE t37.id_art='$id_art';"; $rs_histcount = $con->Execute($sqlHistCount); $sqlComp="SELECT t31.id_com,t31.id_can,t31.id_det,t31.id_obs FROM sce.t31 LEFT JOIN sce.t30 ON sce.t31.oid_maestro = sce.t30.oid WHERE sce.t30.oid = $id_art;"; $arrComp=array(); $con->setFetchMode(ADODB_FETCH_ASSOC); $rs_comp = $con->Execute($sqlComp);$num=1; while ($filaComp = $rs_comp->fetchRow()) { ?> <tr> <td align="center">Componente <?php echo $num; ?></td> <td align="center"><?php echo $filaComp['id_com']; ?></td> <td align="center"><?php echo $filaComp['id_can']; ?></td> <td align="center"><?php echo $filaComp['id_det']; ?></td> <td align="center"><?php echo $filaComp['id_obs']; ?></td> </tr> <br /> <?php $num+=1; } ?> </table> <br /> <br /> <br /> <br /> _____________________ <br /> <strong>Firma Encargado</strong> <br /> <h3><i>Historial de cambios del artÃculo:</i></h3><br /> <?php $sqlHist="SELECT t38.fecha_core_usuario_id_modificacion AS fecha, t37.id_est AS estado, t37.id_obs AS descripcion, t38.id_can, t38.id_com, t38.id_det, t38.id_obs AS observacion FROM sce.t38 t38 LEFT JOIN sce.t37 t37 ON t38.oid_maestro=t37.oid WHERE t37.id_art='$id_art_tr';"; $con->setFetchMode(ADODB_FETCH_ASSOC); $rs_hist = $con->Execute($sqlHist); ?> Este artÃculo presenta los siguientes reportes en el cambio de su historial: <br> <?php ?> <table width="100%" border="0.1" cellspacing="0" bordercolor="#000020" cellpadding="3" > <tr> <th align="center"><strong>Fecha </strong></th> <th align="center"><strong>Estado </strong></th> <th align="center"><strong>Descripción </strong></th> <th align="center"><strong>Cantidad </strong></th> <th align="center"><strong>Componente </strong></th> <th align="center"><strong>Detalle </strong></th> <th align="center"><strong>Observación </strong></th> </tr> <?php while ($filaHist = $rs_hist->fetchRow()) { ?> <tr> <td align="center"> <?php echo $filaHist['fecha']; ?></td> <td align="center"> <?php if($filaHist['estado']==1){ echo "Disponible";} else if($filaHist['estado']==2){echo "No Disponible";} else {echo " ";} ?></td> <td align="center"> <?php echo $filaHist['descripcion']; ?></td> <td align="center"> <?php echo $filaHist['id_can']; ?></td> <td align="center"> <?php echo $filaHist['id_com']; ?></td> <td align="center"> <?php echo $filaHist['id_det']; ?></td> <td align="center"> <?php echo $filaHist['observacion']; ?></td> </tr> <?php } ?> </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; T99_273_442_39_239_2520:2021-06-02 T99_273_442_39_239_2519:prueba nnmj|23 T99_273_442_39_239_2518:1812,Art de prueba y,1812 Retorno : Array ( [ret] => inicioComponente_WF_DocSalida({"id":"1107","caso_id":"169","proceso_id":99,"tit":"Acta de baja","tarea_id":274,"paso_id":443,"desc":"<strong>Acta de baja <\/strong>: Acta de baja ","url":"<a href=\"http:\/\/201.182.250.54\/sisad16\/tmp\/0ab00107b5be579b09d626950d48462f.pdf\" target=\"_blank\" >De clic aquí para descargar el archivo<\/a><\/div>"}); [suc] => 1 ) fin 2021-06-16 00:37:17 /******************************************************************************************************/