1 | <?php |
---|
2 | /** |
---|
3 | * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana |
---|
4 | * @file accion_especifica_de_proyecto_seguimiento.module |
---|
5 | * Drupal part Module to code proyectos operativos module |
---|
6 | * Copyright 2012 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or modify |
---|
9 | * it under the terms of the GNU General Public License as published by |
---|
10 | * the Free Software Foundation; either version 2 of the License, or |
---|
11 | * (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
21 | * |
---|
22 | * @author CENDITEL Merida - Ing. Diego Uzcategui |
---|
23 | * @date 2013-02-07 // (anno-mes-dia) |
---|
24 | * @version 0.1 |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | /** |
---|
29 | * Pagina que muestra los seguimientos de todos los meses de una ae (cuadro resumen de seguimientos) |
---|
30 | */ |
---|
31 | function seguimiento_accion_especifica_deproyecto_page($proyecto = 0, $ae = 0) { |
---|
32 | global $user; |
---|
33 | drupal_set_title(t('Seguimiento y Control de Acción EspecÃfica de Proyecto Operativo')); |
---|
34 | |
---|
35 | $mes_fase_seg = _obtener_mes_fase_seguimiento_proyecto($proyecto); |
---|
36 | if (_proyecto_seguimiento_mes_mover_estado_access($proyecto, $mes_fase_seg, $message = true)); |
---|
37 | |
---|
38 | $output = ''; |
---|
39 | $output .= '<br>'; |
---|
40 | |
---|
41 | $output .= _mostrar_datos_ae($proyecto, $ae); |
---|
42 | $output .= _mostrar_indicadores_metafisica_seg_ae($proyecto, $ae); |
---|
43 | $output .= _mostrar_indicadores_financieros_seg_ae($proyecto, $ae); |
---|
44 | |
---|
45 | $output .= _mostrarleyendazonacritica(); |
---|
46 | |
---|
47 | return $output; |
---|
48 | } |
---|
49 | |
---|
50 | /** |
---|
51 | * Pagina que carga los datos generales de una accion especifica (datos del proyecto y datos de la accion) |
---|
52 | */ |
---|
53 | function _mostrar_datos_ae($proyecto = 0, $ae = 0) { |
---|
54 | $output = ''; |
---|
55 | |
---|
56 | //cargar el nodo del proyecto al que pertenece |
---|
57 | $node_type = content_types('proyectos_operativos'); |
---|
58 | $fields = $node_type['fields']; |
---|
59 | $output .= '<fieldset>'; |
---|
60 | $output .= '<legend>' . t('Datos del Proyecto al que pertenece la Acción EspecÃfica') . '</legend>'; |
---|
61 | $output .= '<b>' . $fields['field_proyecto_codigo']['widget']['label'] . ':</b> ' . $proyecto->field_proyecto_codigo[0]['value'] . '<br>'; |
---|
62 | $output .= '<b>' . t('Nombre del Proyecto') . ':</b> '.$proyecto->titulo_asignado.'<br>'; |
---|
63 | $output .= '<b>' . $fields['field_proyecto_monto_anual']['widget']['label'] . ':</b> '.number_format($proyecto->field_proyecto_monto_anual[0]['value'], 0, ',', '.').' Bs<br>'; |
---|
64 | $output .= '</fieldset>'; |
---|
65 | |
---|
66 | $tablas = array();//tabla de ubicacion geografica |
---|
67 | $header = array(); |
---|
68 | $header[] = array('data' => t('PaÃs')); |
---|
69 | $header[] = array('data' => t('Estado')); |
---|
70 | $header[] = array('data' => t('Municipio')); |
---|
71 | $header[] = array('data' => t('Parroquia')); |
---|
72 | $header[] = array('data' => t('Latitud')); |
---|
73 | $header[] = array('data' => t('Longitud')); |
---|
74 | $rows = array(); |
---|
75 | $varlugar = array(); |
---|
76 | $padres = array_reverse(taxonomy_get_parents_all($ae->field_accion_esp_localizacion[0]['value'])); |
---|
77 | $varlugar[0] = isset($padres[0]) ? $padres[0]->name : '-'; |
---|
78 | $varlugar[1] = isset($padres[1]) ? $padres[0]->name : '-'; |
---|
79 | $varlugar[2] = isset($padres[2]) ? $padres[0]->name : '-'; |
---|
80 | $varlugar[3] = isset($padres[3]) ? $padres[0]->name : '-'; |
---|
81 | $row[] = array('data' => $varlugar[0],); |
---|
82 | |
---|
83 | $row[] = array('data' => $varlugar[1],); |
---|
84 | $row[] = array('data' => $varlugar[2],); |
---|
85 | $row[] = array('data' => $varlugar[3],); |
---|
86 | $id_field1 = 'field_accion_esp_latitud'; |
---|
87 | $row[] = array('data' => $ae->{$id_field1}[0]['value'],); |
---|
88 | $id_field1 = 'field_accion_esp_longitud'; |
---|
89 | $row[] = array('data' => $ae->{$id_field1}[0]['value'],); |
---|
90 | $rows[] = $row; |
---|
91 | $tablas[]= theme('table', $header, $rows); |
---|
92 | |
---|
93 | $output .= '<fieldset><legend>' . t('Datos de la Acción EspecÃfica') . '</legend>'; |
---|
94 | $output .= '<b>' . t('Nombre de la AE') . ':</b> ' . $ae->titulo_asignado . '<br>'; |
---|
95 | $id_field1 = 'field_accion_esp_fechai'; |
---|
96 | $fecha = explode(' ', $ae->{$id_field1}[0]['value']); |
---|
97 | $fecha = explode('-', $fecha[0]); |
---|
98 | $output .= '<b>' . t('Fecha de Inicio'). ':</b> ' . $fecha[2] . '/' . $fecha[1] . '/' . $fecha[0] . '<br>'; |
---|
99 | $id_field1 = 'field_accion_esp_fechaf'; |
---|
100 | $fecha = explode(' ', $ae->{$id_field1}[0]['value']); |
---|
101 | $fecha = explode('-', $fecha[0]); |
---|
102 | $output .= '<b>' . t('Fecha Fin') . ':</b> ' . $fecha[2] . '/' . $fecha[1] . '/' . $fecha[0] . '<br>'; |
---|
103 | $id_field1 = 'field_accion_esp_ejecutor'; |
---|
104 | $output .= '<b>' . t('Ejecutor') . ':</b> '.$ae->{$id_field1}[0]['value'].'<br>'; |
---|
105 | $output .= implode('', $tablas).'<br>'; |
---|
106 | $output .= '</fieldset>'; |
---|
107 | |
---|
108 | return $output; |
---|
109 | } |
---|
110 | |
---|
111 | /** |
---|
112 | * Pagina que carga la tabla de indicadores de meta fisica de la accion especifica |
---|
113 | */ |
---|
114 | function _mostrar_indicadores_metafisica_seg_ae($proyecto = 0, $ae = 0) { |
---|
115 | $output = ''; |
---|
116 | |
---|
117 | $ftypes = array( |
---|
118 | 'value' => t('January'), |
---|
119 | 'value_1' => t('February'), |
---|
120 | 'value_2' => t('March'), |
---|
121 | 'value_3' => t('April'), |
---|
122 | 'value_4' => t('May'), |
---|
123 | 'value_5' => t('June'), |
---|
124 | 'value_6' => t('July'), |
---|
125 | 'value_7' => t('August'), |
---|
126 | 'value_8' => t('September'), |
---|
127 | 'value_9' => t('Octuber'), |
---|
128 | 'value_10' => t('November'), |
---|
129 | 'value_11' => t('December'), |
---|
130 | ); |
---|
131 | |
---|
132 | $meses = json_decode(MESES); |
---|
133 | |
---|
134 | //tabla de indicadores financieros de la accion especifica |
---|
135 | $tablas = array(); |
---|
136 | |
---|
137 | //_proyectos_reformulacion_load($node->proyecto_asignado); |
---|
138 | $header = array(); |
---|
139 | $header[] = array('data' => t('Mes')); |
---|
140 | $header[] = array('data' => t('Planificado')); |
---|
141 | $header[] = array('data' => t('Ejecutado')); |
---|
142 | $header[] = array('data' => t('% de Logro')); |
---|
143 | $header[] = array('data' => t('Estatus de Ejecución')); |
---|
144 | $header[] = array('data' => t('Información Complementaria')); |
---|
145 | $header[] = array('data' => t('Opciones Disponibles'),); |
---|
146 | //calcular planificado |
---|
147 | $planificadoMes = array(); |
---|
148 | $acumuladoPlanificado = 0; |
---|
149 | $id_field1 = 'field_accion_esp_metaf'; |
---|
150 | $i = 0; |
---|
151 | |
---|
152 | /* |
---|
153 | print '<pre>'; |
---|
154 | print_r($ae->{$id_field1}); |
---|
155 | print '</pre>'; |
---|
156 | */ |
---|
157 | |
---|
158 | foreach($ae->{$id_field1} as $nombrescampo) { |
---|
159 | foreach($ftypes as $ids =>$texto) { |
---|
160 | //calcular variacion en el planificado de la meta fisica |
---|
161 | $mes = $i; |
---|
162 | $variacion_planificado_mes = _seguimiento_mesactual_metafisica_ae_deproyecto_reformulaciones_load($ae, $mes); |
---|
163 | $planificadoMes[$i] = $nombrescampo[$ids] + $variacion_planificado_mes; |
---|
164 | $acumuladoPlanificado += $planificadoMes[$i]; |
---|
165 | $i++; |
---|
166 | } |
---|
167 | } |
---|
168 | |
---|
169 | //cargar y procesar informacion de ejecutado meta fisica y informacion complementaria |
---|
170 | $Ejecutado = array(); |
---|
171 | $infocomplementaria_metafisica = array(); |
---|
172 | $AcumuladoEjecutado = 0; |
---|
173 | |
---|
174 | $consulta_metafisica_seguimiento_meses = _seguimiento_metafisica_todosmes_ae_deproyecto_load($ae); |
---|
175 | /* |
---|
176 | print '<pre>'; |
---|
177 | print_r($consulta_metafisica_seguimiento_meses); |
---|
178 | |
---|
179 | print '</pre><br>'; |
---|
180 | */ |
---|
181 | // foreach($meses as $mes => $id) { |
---|
182 | $asinadovalor=0; |
---|
183 | foreach ($consulta_metafisica_seguimiento_meses as $consulta_seguimiento_mes) {//colocando valor en consulta |
---|
184 | /* |
---|
185 | print '<pre>'; |
---|
186 | print_r($consulta_seguimiento_mes); |
---|
187 | print '</pre><br>'; |
---|
188 | */ |
---|
189 | |
---|
190 | $mes = $consulta_seguimiento_mes['mes']; |
---|
191 | // if($mes == $consulta_seguimiento_mes['mes']){ |
---|
192 | $asinadovalor=1; |
---|
193 | $Ejecutado[$mes] = $consulta_seguimiento_mes['ejecutadometafisica']; |
---|
194 | $infocomplementaria_metafisica[$mes] = isset($consulta_seguimiento_mes['infocomplementaria_metafisica'])? $consulta_seguimiento_mes['infocomplementaria_metafisica']:''; |
---|
195 | $AcumuladoEjecutado += is_numeric($Ejecutado[$mes]) ? $Ejecutado[$mes] : 0;//aumenta acumulador |
---|
196 | } |
---|
197 | // } |
---|
198 | /* if ($asinadovalor == 0){ |
---|
199 | $Ejecutado[$mes] = 'N/A'; |
---|
200 | $infocomplementaria_metafisica[$mes] = ''; |
---|
201 | } |
---|
202 | }*/ |
---|
203 | |
---|
204 | //creacion de la tabla (solo asignacion de valores) |
---|
205 | $rows = array(); |
---|
206 | $i = 0; |
---|
207 | foreach ($ftypes as $ids =>$texto) { |
---|
208 | $estatus_ejecucion = _calcularzonacritica($planificadoMes[$i], $Ejecutado[$i]); |
---|
209 | $porczonacritica = $estatus_ejecucion['porczonacritica']; |
---|
210 | $textozona = $estatus_ejecucion['textozona']; |
---|
211 | $colorzona = $estatus_ejecucion['colorzona']; |
---|
212 | $colorfontzona = $estatus_ejecucion['colorfontzona']; |
---|
213 | |
---|
214 | $row = array(); |
---|
215 | $row[] = array('data' => $texto,); |
---|
216 | //$mesi = $i +1 ; |
---|
217 | $mesi = $i; |
---|
218 | //si el mes esta dentro del periodo de duracion de la accion especifica |
---|
219 | //if(_mes_dentro_de_duracion_ae_proyecto($ae, $mesi)){ |
---|
220 | $row[] = array('data' => number_format($planificadoMes[$mesi], 0, ',', '.'),); |
---|
221 | $valor = isset($Ejecutado[$mesi]) ? number_format($Ejecutado[$mesi], 0, ',', '.') : 'N/A'; |
---|
222 | $row[] = array('data' => $valor,); |
---|
223 | $row[] = array('data' => $porczonacritica,); |
---|
224 | $row[] = array('data' => $textozona, 'style' => 'font-weight: bold;background:' . $colorzona . '; color:' . $colorfontzona); |
---|
225 | $row[] = array('data' => $infocomplementaria_metafisica[$mesi],); |
---|
226 | //if($mes_seguimiento_proyecto_y_aes-1 == $i){ |
---|
227 | //if(_mes_habilitado_para_seguimiento($mesi) && _proyecto_operativo_seguimiento_modificar_mes_access($proyecto, $mesi)){ |
---|
228 | if(_mes_habilitado_para_seguimiento($mesi + 1) && _proyecto_operativo_seguimiento_modificar_mes_access($proyecto, $mesi)){ |
---|
229 | $links = array(); |
---|
230 | //'proyectosop/' . $proyecto->nid . '/seguimiento/ae/' . $ae->nid . '/partidas/' . $i . '/edit' |
---|
231 | $links[] = '<b>'.l(t('Modificar'), 'proyectosop/' . $proyecto->nid . '/seguimiento/ae/' . $ae->nid . '/' . $mesi . '/edit/comentario_metafisica').'</b>'; |
---|
232 | $row[] = array('data' => theme('item_list', $links),); |
---|
233 | //$row[] = array('data' => '<b>'.l(t('Modificar'), 'node/' . $node->nid . '/seguimiento_aeproyecto/partidas/'. $i . '/edit').'</b>',); |
---|
234 | }else{ |
---|
235 | $row[] = array('data' => '',); |
---|
236 | } |
---|
237 | /* }else{ |
---|
238 | $row[] = array('data' => '-',);//planificado |
---|
239 | $row[] = array('data' => '-',);//ejecutado |
---|
240 | $row[] = array('data' => '-',);//porcentaje |
---|
241 | $row[] = array('data' => '-',);//estatus de ejecucion |
---|
242 | $row[] = array('data' => '-',);//info complementaria |
---|
243 | $row[] = array('data' => '-',); |
---|
244 | }*/ |
---|
245 | $rows[] = $row; |
---|
246 | $i++; |
---|
247 | } |
---|
248 | $row = array(); |
---|
249 | if ($ae->es_acumulativo) { |
---|
250 | $row[] = array('data' => t('Acumulado'),); |
---|
251 | $row[] = array('data' => number_format($acumuladoPlanificado, 0, ',', '.'),); |
---|
252 | $row[] = array('data' => number_format($AcumuladoEjecutado, 0, ',', '.'),);//total ejecutado |
---|
253 | $row[] = array('data' => '', 'colspan' => 6); |
---|
254 | } |
---|
255 | |
---|
256 | $rows[] = $row; |
---|
257 | $tablas[]= theme('table', $header, $rows); |
---|
258 | |
---|
259 | if (count($tablas)) { |
---|
260 | |
---|
261 | $output .= '<fieldset><legend>' . t('Indicadores de la Meta FÃsica de la Acción EspecÃfica') . '</legend>'; |
---|
262 | |
---|
263 | $id_field1 = 'field_accion_esp_bien'; |
---|
264 | $output .= '<b>' . t('Descripción del Bien y Servicio') . ':</b> ' . $ae->{$id_field1}[0]['value'] . '<br>'; |
---|
265 | $term_id = isset($ae->variaciones) && isset($ae->variaciones['field_accion_esp_metaf_'. $ae->nid][0]['unidad']) ? $ae->variaciones['field_accion_esp_metaf_'. $ae->nid][0]['unidad'] : $ae->field_accion_esp_unidadm[0]['value']; |
---|
266 | $id_field1 = 'field_accion_esp_unidadm'; |
---|
267 | $term = taxonomy_get_term($term_id); |
---|
268 | $output .= '<b>' . t('Unidad de Medida') . ':</b> ' . $term->name . '<br><br>'; |
---|
269 | $output .= implode('', $tablas) . '</fieldset>'; |
---|
270 | } |
---|
271 | |
---|
272 | return $output; |
---|
273 | } |
---|
274 | |
---|
275 | /** |
---|
276 | * Pagina que carga la tabla de indicadores de meta fisica de la accion especifica |
---|
277 | */ |
---|
278 | function _mostrar_indicadores_financieros_seg_ae($proyecto = 0, $ae = 0) { |
---|
279 | |
---|
280 | $output = ''; |
---|
281 | $ftypes = array( |
---|
282 | 'value' => t('January'), |
---|
283 | 'value_1' => t('February'), |
---|
284 | 'value_2' => t('March'), |
---|
285 | 'value_3' => t('April'), |
---|
286 | 'value_4' => t('May'), |
---|
287 | 'value_5' => t('June'), |
---|
288 | 'value_6' => t('July'), |
---|
289 | 'value_7' => t('August'), |
---|
290 | 'value_8' => t('September'), |
---|
291 | 'value_9' => t('Octuber'), |
---|
292 | 'value_10' => t('November'), |
---|
293 | 'value_11' => t('December'), |
---|
294 | ); |
---|
295 | |
---|
296 | $meses = json_decode(MESES); |
---|
297 | //tabla de indicadores financieros de la accion especifica |
---|
298 | $tablas = array(); |
---|
299 | |
---|
300 | $header = array(); |
---|
301 | $header[] = array('data' => t('Mes')); |
---|
302 | $header[] = array('data' => t('Asignado')); |
---|
303 | $header[] = array('data' => t('Comprometido')); |
---|
304 | $header[] = array('data' => t('Causado')); |
---|
305 | $header[] = array('data' => t('Pagado')); |
---|
306 | $header[] = array('data' => t('% de Inversión')); |
---|
307 | $header[] = array('data' => t('Estatus de la Inversión')); |
---|
308 | $header[] = array('data' => t('Información Complementaria')); |
---|
309 | $header[] = array('data' => t('Opciones Disponibles'),); |
---|
310 | |
---|
311 | //calcular asignado |
---|
312 | $asignadoMes = array(); |
---|
313 | $i=0; |
---|
314 | foreach($ftypes as $ids =>$texto) { |
---|
315 | $asignadoMes[$i]=0; |
---|
316 | $i += 1; |
---|
317 | } |
---|
318 | |
---|
319 | $acumuladoAsignado = 0; |
---|
320 | $id_field1 = 'field_accion_esp_programacion'; |
---|
321 | foreach($ae->{$id_field1} as $partidascampo) {//recorrido a grupo de partidas |
---|
322 | $i=0; |
---|
323 | foreach($ftypes as $ids =>$texto) { |
---|
324 | $asignadoMes[$i] += $partidascampo[$ids]; |
---|
325 | $acumuladoAsignado += $partidascampo[$ids]; |
---|
326 | $i += 1; |
---|
327 | } |
---|
328 | } |
---|
329 | |
---|
330 | //calcular la variación por reformulaciones |
---|
331 | for($i=0; $i<12; $i++){ |
---|
332 | if(_mes_dentro_de_duracion_ae_proyecto($ae, $i)){ |
---|
333 | $mes = $i; |
---|
334 | $variacion_asignado = _seguimiento_mesactual_total_ae_deproyecto_reformulaciones_load($ae, $mes); |
---|
335 | $variacion_asignado = isset($variacion_asignado)? $variacion_asignado : 0; |
---|
336 | $asignadoMes[$i] += $variacion_asignado; |
---|
337 | $acumuladoAsignado += $variacion_asignado; |
---|
338 | |
---|
339 | } |
---|
340 | } |
---|
341 | |
---|
342 | //calcular comprometido, causado, pagado |
---|
343 | $totalComprometido = array(); |
---|
344 | $totalCausado = array(); |
---|
345 | $totalPagado = array(); |
---|
346 | $infocomplementaria_financiera = array(); |
---|
347 | $AcumuladoTotalComprometido = 0; |
---|
348 | $AcumuladoTotalCausado = 0; |
---|
349 | $AcumuladoTotalPagado = 0; |
---|
350 | |
---|
351 | foreach($meses as $it => $id) { |
---|
352 | |
---|
353 | $mes = $it; |
---|
354 | $consulta_totales_seguimiento_mes = _seguimiento_mesactual_partida_ae_deproyecto_totales_load($ae, $mes); |
---|
355 | |
---|
356 | $totalComprometido[$mes] = isset($consulta_totales_seguimiento_mes['segmespartidastotales']['totalcomprometido'])? $consulta_totales_seguimiento_mes['segmespartidastotales']['totalcomprometido']: 'N/A'; |
---|
357 | $totalCausado[$mes] = isset($consulta_totales_seguimiento_mes['segmespartidastotales']['totalcausado'])?$consulta_totales_seguimiento_mes['segmespartidastotales']['totalcausado']: 'N/A'; |
---|
358 | $totalPagado[$mes] = isset($consulta_totales_seguimiento_mes['segmespartidastotales']['totalpagado'])?$consulta_totales_seguimiento_mes['segmespartidastotales']['totalpagado']: 'N/A'; |
---|
359 | $infocomplementaria_financiera[$mes] = isset($consulta_totales_seguimiento_mes['segmes']['infocomplementaria_metafinanciera'])? $consulta_totales_seguimiento_mes['segmes']['infocomplementaria_metafinanciera']:''; |
---|
360 | |
---|
361 | $AcumuladoTotalComprometido += is_numeric($totalComprometido[$mes]) ? $totalComprometido[$mes] : 0; |
---|
362 | $AcumuladoTotalCausado += is_numeric($totalCausado[$mes]) ? $totalCausado[$mes] : 0; |
---|
363 | $AcumuladoTotalPagado += is_numeric($totalPagado[$mes]) ? $totalPagado[$mes] : 0; |
---|
364 | } |
---|
365 | //$mes_seguimiento_proyecto_y_aes = variable_get('accion_especifica_de_proyecto_seguimiento_mes_seguimiento', 0); |
---|
366 | |
---|
367 | //Asignacion de valores para la creacion de la tabla |
---|
368 | $rows = array(); |
---|
369 | $i = 0; |
---|
370 | |
---|
371 | foreach($ftypes as $ids =>$texto) { |
---|
372 | |
---|
373 | $estatus_inversion = _calcularzonacritica($asignadoMes[$i], $totalCausado[$i]); |
---|
374 | $porczonacritica = $estatus_inversion['porczonacritica']; |
---|
375 | $textozona = $estatus_inversion['textozona']; |
---|
376 | $colorzona = $estatus_inversion['colorzona']; |
---|
377 | $colorfontzona = $estatus_inversion['colorfontzona']; |
---|
378 | |
---|
379 | $row = array(); |
---|
380 | $row[] = array('data' => $texto,); |
---|
381 | $mesi = $i; |
---|
382 | //si el mes esta dentro del periodo de duracion de la accion especifica |
---|
383 | // if (_mes_dentro_de_duracion_ae_proyecto($ae, $mesi)) { |
---|
384 | $valor = is_numeric($asignadoMes[$i]) ? number_format($asignadoMes[$i], 0, ',', '.') : $asignadoMes[$i]; |
---|
385 | $row[] = array('data' => $valor,); |
---|
386 | $valor = is_numeric($totalComprometido[$mesi]) ? number_format($totalComprometido[$mesi], 0, ',', '.') : $totalComprometido[$mesi]; |
---|
387 | $row[] = array('data' => $valor,); |
---|
388 | $valor = is_numeric($totalCausado[$mesi]) ? number_format($totalCausado[$mesi], 0, ',', '.') : $totalCausado[$mesi]; |
---|
389 | $row[] = array('data' => $valor,); |
---|
390 | $valor = is_numeric($totalPagado[$mesi]) ? number_format($totalPagado[$mesi], 0, ',', '.') : $totalPagado[$mesi]; |
---|
391 | $row[] = array('data' => $valor,); |
---|
392 | $row[] = array('data' => $porczonacritica,); |
---|
393 | $row[] = array('data' => $textozona, 'style' => 'font-weight: bold;background:' . $colorzona . '; color:' . $colorfontzona); |
---|
394 | $row[] = array('data' => $infocomplementaria_financiera[$mesi],); |
---|
395 | $links = array(); |
---|
396 | //'proyectosop/%proyectosop/seguimiento/ae/%accion_especifical/partidas/%messegaepartida/view' |
---|
397 | |
---|
398 | if (is_numeric($totalComprometido[$mesi])) { |
---|
399 | $links[] = l(t('Seguimiento por partidas'), 'proyectosop/' . $proyecto->nid . '/seguimiento/ae/' . $ae->nid . '/' . $mesi . '/view'); |
---|
400 | } |
---|
401 | |
---|
402 | if(_mes_habilitado_para_seguimiento($mesi + 1) && _proyecto_operativo_seguimiento_modificar_mes_access($proyecto, $mesi)){ |
---|
403 | $links[] = '<b>'.l(t('Modificar'), 'proyectosop/' . $proyecto->nid . '/seguimiento/ae/' . $ae->nid . '/' . ($mesi) . '/edit/comentario_informacionfinanciera').'</b>'; |
---|
404 | } |
---|
405 | $row[] = array('data' => theme('item_list', $links),); |
---|
406 | /* }else{ |
---|
407 | $row[] = array('data' => '-',); |
---|
408 | $row[] = array('data' => '-',); |
---|
409 | $row[] = array('data' => '-',); |
---|
410 | $row[] = array('data' => '-',); |
---|
411 | $row[] = array('data' => '-',); |
---|
412 | $row[] = array('data' => '-',); |
---|
413 | $row[] = array('data' => '-',); |
---|
414 | $row[] = array('data' => '-',); |
---|
415 | }*/ |
---|
416 | |
---|
417 | $rows[] = $row; |
---|
418 | $i++; |
---|
419 | } |
---|
420 | $row = array(); |
---|
421 | if ($ae->es_acumulativo) { |
---|
422 | $row[] = array('data' => t('Acumulado'),); |
---|
423 | $row[] = array('data' => number_format($acumuladoAsignado, 0, ',', '.'),); |
---|
424 | $row[] = array('data' => number_format($AcumuladoTotalComprometido, 0, ',', '.'),);//total comprometido |
---|
425 | $row[] = array('data' => number_format($AcumuladoTotalCausado, 0, ',', '.'),);//total causado |
---|
426 | $row[] = array('data' => number_format($AcumuladoTotalPagado, 0, ',', '.'),);//total pagado |
---|
427 | $row[] = array('data' => '', 'colspan' => 4); |
---|
428 | } |
---|
429 | $rows[] = $row; |
---|
430 | $tablas[]= theme('table', $header, $rows); |
---|
431 | |
---|
432 | if (count($tablas)) { |
---|
433 | $output .= '<fieldset><legend>' . t('Indicadores Financieros de la Acción EspecÃfica') . '</legend>' . implode('', $tablas); |
---|
434 | $output .= '</fieldset>'; |
---|
435 | } |
---|
436 | |
---|
437 | return $output; |
---|
438 | } |
---|