Selaa lähdekoodia

ajuste columnas email 07/03/22. Parametrizar log con ultima fecha log para vista y consultas excel

Nermosis 3 vuotta sitten
vanhempi
commit
a7af0aa58f

+ 69 - 72
application/controllers/ExportXls.php Näytä tiedosto

@@ -1,4 +1,5 @@
1 1
 <?php
2
+ini_set('max_execution_time', '300');
2 3
 defined('BASEPATH') or exit('No direct script access allowed');
3 4
 
4 5
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
@@ -30,6 +31,7 @@ class ExportXls extends CI_Controller
30 31
     public function exportDatosCompletos()
31 32
     {
32 33
         $licitacionesResult = $this->Xlsexport_model->getFullDatosUltimasInsertadas();
34
+
33 35
         $result = array();
34 36
 
35 37
         //$start = $this->starttime();
@@ -72,8 +74,8 @@ class ExportXls extends CI_Controller
72 74
         $spreadsheet = $this->datosCompletosHojaBitacora($spreadsheet, $result);
73 75
         $spreadsheet = $this->datosCompletosMediosPublicacion($spreadsheet, $result['validNoticeInfo']);
74 76
         $spreadsheet = $this->datosMedioPublicacion($spreadsheet, $result['validNoticeInfoDocumentos']);
75
-        $spreadsheet = $this->datosCriterioAdjudicacion($spreadsheet, $result['tenderFinancial']);
76
-        $spreadsheet = $this->datosCriterioEvaluacionFinanciera($spreadsheet, $result['tenderAwarding']);
77
+        $spreadsheet = $this->datosCriterioAdjudicacion($spreadsheet, $result['tenderAwarding']);
78
+        $spreadsheet = $this->datosCriterioEvaluacionFinanciera($spreadsheet, $result['tenderFinancial']);
77 79
         $spreadsheet = $this->datosCriterioEvaluacionTecnica($spreadsheet, $result['tenderTecnicos']);
78 80
         $spreadsheet = $this->datosRequisitosParticipacion($spreadsheet, $result['tenderQualification']);
79 81
 
@@ -122,6 +124,7 @@ class ExportXls extends CI_Controller
122 124
     public function mapearDatos($licitacionesResult): array
123 125
     {
124 126
         $result = array();
127
+
125 128
         guardar_log("Excel", "Montando array datos licitacion");
126 129
         foreach ($licitacionesResult['datos'] as $licitacion) {
127 130
 
@@ -180,46 +183,46 @@ class ExportXls extends CI_Controller
180 183
         }
181 184
 
182 185
         guardar_log("Excel", "Consulta Valid notice info");
183
-        $result['validNoticeInfo'] = $this->Xlsexport_model->getTablaByFechaLog("in_valid_notice_info");
186
+        $result['validNoticeInfo'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_valid_notice_info", "codice_valid_notice_info", "code", "noticeTypeCode");
184 187
 
185 188
         guardar_log("Excel", "Consulta Valid notice info documentos");
186
-        $result['validNoticeInfoDocumentos'] = $this->Xlsexport_model->getTablaByFechaLog("in_valid_notice_info_documento");
189
+        $result['validNoticeInfoDocumentos'] = $this->Xlsexport_model->getTablaByFechaLog("global_valid_notice_info_documento");
187 190
 
188 191
         guardar_log("Excel", "Consulta projectLot");
189 192
         $result['projectLot'] = $this->Xlsexport_model->getProjectLotItem();
190 193
 
191 194
         guardar_log("Excel", "Consulta documentos tecnicos");
192
-        $result['techDocs'] = $this->Xlsexport_model->getTablaByFechaLog("in_technical_documents");
195
+        $result['techDocs'] = $this->Xlsexport_model->getTablaByFechaLog("global_technical_documents");
193 196
 
194 197
         guardar_log("Excel", "Consulta documentos legales");
195
-        $result['legalDocs'] = $this->Xlsexport_model->getTablaByFechaLog("in_legal_documents");
198
+        $result['legalDocs'] = $this->Xlsexport_model->getTablaByFechaLog("global_legal_documents");
196 199
 
197 200
         guardar_log("Excel", "Consulta documentos adicionales");
198
-        $result['additDocs'] = $this->Xlsexport_model->getTablaByFechaLog("in_additional_documents");
201
+        $result['additDocs'] = $this->Xlsexport_model->getTablaByFechaLog("global_additional_documents");
199 202
 
200 203
         guardar_log("Excel", "Consulta documentos generales");
201
-        $result['generalDocs'] = $this->Xlsexport_model->getTablaByFechaLog("in_general_documents");
204
+        $result['generalDocs'] = $this->Xlsexport_model->getTablaByFechaLog("global_general_documents");
202 205
 
203 206
         guardar_log("Excel", "Consulta tender process");
204 207
         $result['tenderProcess'] = $this->Xlsexport_model->getTenderingTermsCodes();
205 208
 
206 209
         guardar_log("Excel", "Consulta tender terms");
207
-        $result['tenderingTerms'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("in_tendering_terms", "codice_codigo_tipo_garantia", "code", "guaranteeTypeCode");
210
+        $result['tenderingTerms'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_tendering_terms", "codice_codigo_tipo_garantia", "code", "guaranteeTypeCode");
208 211
 
209 212
         guardar_log("Excel", "Consulta tender result");
210
-        $result['tenderResult'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("in_tender_result", "codice_tender_result", "code", "resultCode");
213
+        $result['tenderResult'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_tender_result", "codice_tender_result", "code", "resultCode");
211 214
 
212 215
         guardar_log("Excel", "Consulta tender criterio financieros");
213
-        $result['tenderFinancial'] = $this->Xlsexport_model->getTablaByFechaLog("in_tendering_terms_financial_evaluation");
216
+        $result['tenderFinancial'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_tendering_terms_financial_evaluation", "codice_tendering_terms_financial", "code", "evaluationCriteriaTypeCode");
214 217
 
215 218
         guardar_log("Excel", "Consulta tender criterio adjudicacion");
216
-        $result['tenderAwarding'] = $this->Xlsexport_model->getTablaByFechaLog("in_tendering_terms_awarding_terms");
219
+        $result['tenderAwarding'] = $this->Xlsexport_model->getTablaByFechaLog("global_tendering_terms_awarding_terms");
217 220
 
218 221
         guardar_log("Excel", "Consulta tender criterios tecnicos");
219
-        $result['tenderTecnicos'] = $this->Xlsexport_model->getTablaByFechaLog("in_tendering_terms_qualification_request");
222
+        $result['tenderTecnicos'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_tendering_terms_qualification_request", "codice_tendering_terms_qualification_request", "code", "evaluationCriteriaTypeCode");
220 223
 
221 224
         guardar_log("Excel", "Consulta tender requisitos participacion");
222
-        $result['tenderQualification'] = $this->Xlsexport_model->getTablaByFechaLog("in_tendering_terms_qualification_request");
225
+        $result['tenderQualification'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("global_tendering_terms_specific_terms", "codice_tendering_terms_specific_terms", "code", "evaluationCriteriaTypeCode");
223 226
 
224 227
         return $result;
225 228
     }
@@ -271,36 +274,34 @@ class ExportXls extends CI_Controller
271 274
 
272 275
             $sheet->setCellValue('K' . $this->filaDatoLicitacion, $row['locatedParty']['itemClassification_attr']);
273 276
             $sheet->setCellValue('L' . $this->filaDatoLicitacion, $row['project']['tipo_contrato']);
274
-            $sheet->setCellValue('M' . $this->filaDatoLicitacion, $row['project']['countrySubentityCode'] . " - " . $row['project']['countrySubentity']);
277
+            $sheet->setCellValue('M' . $this->filaDatoLicitacion, $row['project']['countrySubentity']);
275 278
             $sheet->setCellValue('N' . $this->filaDatoLicitacion, $row['party']['partyName']);
276
-            $sheet->setCellValue('O' . $this->filaDatoLicitacion, ($row['party']['tipoIdParty'] == "ID_PLATAFORMA") ? $row['party']['partyItem'] : "");
277
-            $sheet->setCellValue('P' . $this->filaDatoLicitacion, ($row['party']['tipoIdParty'] == "NIF") ? $row['party']['partyItem'] : "");
278
-            $sheet->setCellValue('Q' . $this->filaDatoLicitacion, ($row['party']['tipoIdParty'] == "DIR3") ? $row['party']['partyItem'] : "");
279
-            $sheet->setCellValue('R' . $this->filaDatoLicitacion, $row['locatedParty']['buyerProfileURIID']);
280
-            $sheet->setCellValue('S' . $this->filaDatoLicitacion, $row['locatedParty']['tipo_administracion']);
281
-            $sheet->setCellValue('T' . $this->filaDatoLicitacion, $row['party']['codpostal']);
282
-            $sheet->setCellValue('U' . $this->filaDatoLicitacion, $row['tenderProcess']['tipoTender']);
283
-            $sheet->setCellValue('V' . $this->filaDatoLicitacion, $row['tenderProcess']['contrato_sistema']);
284
-            $sheet->setCellValue('W' . $this->filaDatoLicitacion, $row['tenderProcess']['urgency']);
285
-            $sheet->setCellValue('X' . $this->filaDatoLicitacion, $row['tenderProcess']['submision']);
286
-            $sheet->setCellValue('ZY' . $this->filaDatoLicitacion, $row['tenderTerms']['procurementLegislationDocumentReference']);
287
-            $sheet->setCellValue('Z' . $this->filaDatoLicitacion, $row['tenderTerms']['allowedSubcontractTerms']);
288
-            $sheet->setCellValue('AA' . $this->filaDatoLicitacion, $row['project']['durationMesure']);
289
-            $sheet->setCellValue('AB' . $this->filaDatoLicitacion, $row['project']['medida']);
290
-            $sheet->setCellValue('AC' . $this->filaDatoLicitacion, $this->formatFechas($row['project']['duracion_inicio']));
279
+            $sheet->setCellValue('O' . $this->filaDatoLicitacion, ($row['party']['tipoIdParty'] == "DIR3") ? $row['party']['partyItem'] : "");
280
+            $sheet->setCellValue('P' . $this->filaDatoLicitacion, $row['locatedParty']['buyerProfileURIID']);
281
+            $sheet->setCellValue('Q' . $this->filaDatoLicitacion, $row['locatedParty']['tipo_administracion']);
282
+            $sheet->setCellValue('R' . $this->filaDatoLicitacion, $row['party']['codpostal']);
283
+            $sheet->setCellValue('S' . $this->filaDatoLicitacion, $row['tenderProcess']['tipoTender']);
284
+            $sheet->setCellValue('T' . $this->filaDatoLicitacion, $row['tenderProcess']['contrato_sistema']);
285
+            $sheet->setCellValue('U' . $this->filaDatoLicitacion, $row['tenderProcess']['urgency']);
286
+            $sheet->setCellValue('V' . $this->filaDatoLicitacion, $row['tenderProcess']['submision']);
287
+            $sheet->setCellValue('W' . $this->filaDatoLicitacion, $row['tenderTerms']['procurementLegislationDocumentReference']);
288
+            $sheet->setCellValue('X' . $this->filaDatoLicitacion, $row['tenderTerms']['allowedSubcontractTerms']);
289
+            $sheet->setCellValue('Y' . $this->filaDatoLicitacion, $row['project']['durationMesure']);
290
+            $sheet->setCellValue('Z' . $this->filaDatoLicitacion, $row['project']['medida']);
291
+            $sheet->setCellValue('AA' . $this->filaDatoLicitacion, $this->formatFechas($row['project']['duracion_inicio']));
291 292
             $sheet->getStyle('AC' . $this->filaDatoLicitacion)
292 293
                 ->getNumberFormat()
293 294
                 ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
294
-            $sheet->setCellValue('AD' . $this->filaDatoLicitacion, $this->formatFechas($row['project']['duracion_fin']));
295
+            $sheet->setCellValue('AB' . $this->filaDatoLicitacion, $this->formatFechas($row['project']['duracion_fin']));
295 296
             $sheet->getStyle('AD' . $this->filaDatoLicitacion)
296 297
                 ->getNumberFormat()
297 298
                 ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
298
-            $sheet->setCellValue('AE' . $this->filaDatoLicitacion, $row['project']['contractExtension']);
299
-            $sheet->setCellValue('AF' . $this->filaDatoLicitacion, $row['party']['websiteURI']);
300
-            $sheet->setCellValue('AG' . $this->filaDatoLicitacion, $row['party']['city']);
301
-            $sheet->setCellValue('AH' . $this->filaDatoLicitacion, $row['party']['direccion']);
302
-            $sheet->setCellValue('AI' . $this->filaDatoLicitacion, $row['party']['contact_name']);
303
-            $sheet->setCellValue('AJ' . $this->filaDatoLicitacion, $row['party']['contact_email']);
299
+            $sheet->setCellValue('AC' . $this->filaDatoLicitacion, $row['project']['contractExtension']);
300
+            $sheet->setCellValue('AD' . $this->filaDatoLicitacion, $row['party']['websiteURI']);
301
+            $sheet->setCellValue('AE' . $this->filaDatoLicitacion, $row['party']['city']);
302
+            $sheet->setCellValue('AF' . $this->filaDatoLicitacion, $row['party']['direccion']);
303
+            $sheet->setCellValue('AG' . $this->filaDatoLicitacion, $row['party']['contact_name']);
304
+            $sheet->setCellValue('AH' . $this->filaDatoLicitacion, $row['party']['contact_email']);
304 305
             $this->filaDatoLicitacion++;
305 306
         }
306 307
 
@@ -378,7 +379,7 @@ class ExportXls extends CI_Controller
378 379
                 guardar_log("Excel", "Escribir datos medio publicacion--" . $contador);
379 380
                 $contador++;
380 381
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
381
-                $sheet->SetCellValue('B' . $aux, $datos['noticeTypeCode']);
382
+                $sheet->SetCellValue('B' . $aux, $datos['code_desc']);
382 383
                 $sheet->SetCellValue('C' . $aux, $datos['publicationMediaName']);
383 384
                 $aux++;
384 385
             }
@@ -449,6 +450,7 @@ class ExportXls extends CI_Controller
449 450
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
450 451
                 $sheet->SetCellValue('M' . $aux, $datos['partyIdentification']);
451 452
                 $sheet->SetCellValue('N' . $aux, $datos['partyName']);
453
+                $sheet->SetCellValue('O' . $aux, $datos['TaxExclusiveAmount']);
452 454
 
453 455
                 $aux++;
454 456
             }
@@ -481,10 +483,7 @@ class ExportXls extends CI_Controller
481 483
                 $sheet->getStyle('J' . $aux)
482 484
                     ->getNumberFormat()
483 485
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
484
-                $sheet->SetCellValue('K' . $aux, $this->formatFechas($datos['deadLineEndTime']));
485
-                $sheet->getStyle('K' . $aux)
486
-                    ->getNumberFormat()
487
-                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
486
+                $sheet->SetCellValue('K' . $aux, $datos['deadLineEndTime']);
488 487
                 $sheet->SetCellValue('L' . $aux, $datos['deadLineDescription']);
489 488
                 $sheet->SetCellValue('M' . $aux, $datos['auctionTerms']);
490 489
                 $sheet->SetCellValue('N' . $aux, $this->formatFechas($datos['documentAvailablePeriod_EndDate']));
@@ -541,8 +540,8 @@ class ExportXls extends CI_Controller
541 540
                 guardar_log("Excel", "Escribir criterio adjucicacion--" . $contador);
542 541
                 $contador++;
543 542
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
544
-                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
545 543
                 $sheet->SetCellValue('B' . $aux, $datos['description']);
544
+                $sheet->SetCellValue('C' . $aux, $datos['evaluationCriteriaTypeCode']);
546 545
                 $aux++;
547 546
             }
548 547
         }
@@ -562,7 +561,7 @@ class ExportXls extends CI_Controller
562 561
                 guardar_log("Excel", "Escribir criterios evaluacion financiera--" . $contador);
563 562
                 $contador++;
564 563
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
565
-                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
564
+                $sheet->SetCellValue('B' . $aux, $datos['code_desc']);
566 565
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
567 566
                 $aux++;
568 567
             }
@@ -582,7 +581,7 @@ class ExportXls extends CI_Controller
582 581
                 guardar_log("Excel", "Escribir criterio evaluacion tecnica--" . $contador);
583 582
                 $contador++;
584 583
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
585
-                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
584
+                $sheet->SetCellValue('B' . $aux, $datos['code_desc']);
586 585
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
587 586
                 $aux++;
588 587
             }
@@ -603,7 +602,7 @@ class ExportXls extends CI_Controller
603 602
                 guardar_log("Excel", "Escribir requisitos participacion--" . $contador);
604 603
                 $contador++;
605 604
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
606
-                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
605
+                $sheet->SetCellValue('B' . $aux, $datos['code_desc']);
607 606
                 $aux++;
608 607
             }
609 608
 
@@ -697,28 +696,26 @@ class ExportXls extends CI_Controller
697 696
         $spreadsheet->getActiveSheet()->SetCellValue('L1', "Tipo de contrato");
698 697
         $spreadsheet->getActiveSheet()->SetCellValue('M1', "Lugar de ejecución");
699 698
         $spreadsheet->getActiveSheet()->SetCellValue('N1', "Órgano de Contratación");
700
-        $spreadsheet->getActiveSheet()->SetCellValue('O1', "ID OC en PLACSP");
701
-        $spreadsheet->getActiveSheet()->SetCellValue('P1', "NIF OC");
702
-        $spreadsheet->getActiveSheet()->SetCellValue('Q1', "DIR3");
703
-        $spreadsheet->getActiveSheet()->SetCellValue('R1', "Enlace al Perfil de Contratante del OC");
704
-        $spreadsheet->getActiveSheet()->SetCellValue('S1', "Tipo de Administración");
705
-        $spreadsheet->getActiveSheet()->SetCellValue('T1', "Código Postal");
706
-        $spreadsheet->getActiveSheet()->SetCellValue('U1', "Tipo de procedimiento");
707
-        $spreadsheet->getActiveSheet()->SetCellValue('V1', "Sistema de contratación");
708
-        $spreadsheet->getActiveSheet()->SetCellValue('W1', "Tramitación");
709
-        $spreadsheet->getActiveSheet()->SetCellValue('X1', "Forma de presentación de la oferta");
710
-        $spreadsheet->getActiveSheet()->SetCellValue('Y1', "Directiva de aplicación");
711
-        $spreadsheet->getActiveSheet()->SetCellValue('Z1', "Subcontratación permitida");
712
-        $spreadsheet->getActiveSheet()->SetCellValue('AA1', "Duración Contrato");
713
-        $spreadsheet->getActiveSheet()->SetCellValue('AB1', "Tipo de duración");
714
-        $spreadsheet->getActiveSheet()->SetCellValue('AC1', "Inicio contrato");
715
-        $spreadsheet->getActiveSheet()->SetCellValue('AD1', "Fin contrato");
716
-        $spreadsheet->getActiveSheet()->SetCellValue('AE1', "Extension Contrato");
717
-        $spreadsheet->getActiveSheet()->SetCellValue('AF1', "URL Organo Contratación");
718
-        $spreadsheet->getActiveSheet()->SetCellValue('AG1', "Ciudad Organo Contratación");
719
-        $spreadsheet->getActiveSheet()->SetCellValue('AH1', "Dirección Organo Contratación");
720
-        $spreadsheet->getActiveSheet()->SetCellValue('AI1', "Nombre Contacto Organo Contratación");
721
-        $spreadsheet->getActiveSheet()->SetCellValue('AJ1', "Email contacto Organo Contratación");
699
+        $spreadsheet->getActiveSheet()->SetCellValue('O1', "DIR3");
700
+        $spreadsheet->getActiveSheet()->SetCellValue('P1', "Enlace al Perfil de Contratante del OC");
701
+        $spreadsheet->getActiveSheet()->SetCellValue('Q1', "Tipo de Administración");
702
+        $spreadsheet->getActiveSheet()->SetCellValue('R1', "Código Postal");
703
+        $spreadsheet->getActiveSheet()->SetCellValue('S1', "Tipo de procedimiento");
704
+        $spreadsheet->getActiveSheet()->SetCellValue('T1', "Sistema de contratación");
705
+        $spreadsheet->getActiveSheet()->SetCellValue('U1', "Tramitación");
706
+        $spreadsheet->getActiveSheet()->SetCellValue('V1', "Forma de presentación de la oferta");
707
+        $spreadsheet->getActiveSheet()->SetCellValue('W1', "Directiva de aplicación");
708
+        $spreadsheet->getActiveSheet()->SetCellValue('X1', "Subcontratación permitida");
709
+        $spreadsheet->getActiveSheet()->SetCellValue('Y1', "Duración Contrato");
710
+        $spreadsheet->getActiveSheet()->SetCellValue('Z1', "Tipo de duración");
711
+        $spreadsheet->getActiveSheet()->SetCellValue('AA1', "Inicio contrato");
712
+        $spreadsheet->getActiveSheet()->SetCellValue('AB1', "Fin contrato");
713
+        $spreadsheet->getActiveSheet()->SetCellValue('AC1', "Extension Contrato");
714
+        $spreadsheet->getActiveSheet()->SetCellValue('AD1', "URL Organo Contratación");
715
+        $spreadsheet->getActiveSheet()->SetCellValue('AE1', "Ciudad Organo Contratación");
716
+        $spreadsheet->getActiveSheet()->SetCellValue('AF1', "Dirección Organo Contratación");
717
+        $spreadsheet->getActiveSheet()->SetCellValue('AG1', "Nombre Contacto Organo Contratación");
718
+        $spreadsheet->getActiveSheet()->SetCellValue('AH1', "Email contacto Organo Contratación");
722 719
         return $spreadsheet;
723 720
     }
724 721
 
@@ -759,7 +756,7 @@ class ExportXls extends CI_Controller
759 756
         $spreadsheet->getActiveSheet()->SetCellValue('C1', "Número de lote");
760 757
         $spreadsheet->getActiveSheet()->SetCellValue('D1', "Importe sin Impuestos");
761 758
         $spreadsheet->getActiveSheet()->SetCellValue('E1', "Lugar de ejecución del lote");
762
-        $spreadsheet->getActiveSheet()->SetCellValue('E1', "CPV");
759
+        $spreadsheet->getActiveSheet()->SetCellValue('F1', "CPV");
763 760
 
764 761
         return $spreadsheet;
765 762
     }
@@ -826,7 +823,7 @@ class ExportXls extends CI_Controller
826 823
         $spreadsheet->getActiveSheet()->SetCellValue('L1', 'Fecha de formalización');
827 824
         $spreadsheet->getActiveSheet()->SetCellValue('M1', 'Adjudicatario CIF');
828 825
         $spreadsheet->getActiveSheet()->SetCellValue('N1', 'Nombre Adjudicatario');
829
-
826
+        $spreadsheet->getActiveSheet()->SetCellValue('O1', 'Importe de adjudicación sin impuestos');
830 827
         return $spreadsheet;
831 828
     }
832 829
 
@@ -895,8 +892,8 @@ class ExportXls extends CI_Controller
895 892
         );
896 893
         $sheet->getStyle("A1:C1")->applyFromArray($styleArr);
897 894
         $spreadsheet->getActiveSheet()->SetCellValue('A1', 'Identificador');
898
-        $spreadsheet->getActiveSheet()->SetCellValue('B1', 'Tipo criterio de adjudicación');
899
-        $spreadsheet->getActiveSheet()->SetCellValue('C1', 'Descripción textual del criterio de adjudicación');
895
+        $spreadsheet->getActiveSheet()->SetCellValue('B1', 'Descripción textual del criterio de adjudicación');
896
+        $spreadsheet->getActiveSheet()->SetCellValue('C1', 'Ponderación');
900 897
 
901 898
         return $spreadsheet;
902 899
     }

+ 11 - 48
application/controllers/Parser.php Näytä tiedosto

@@ -45,8 +45,6 @@ class Parser extends CI_Controller
45 45
 
46 46
                     if ($this->newFolder($rutaPerfil . "/" . $fechaCarpeta)) {
47 47
                         $this->rutaDiariaFecha = $rutaPerfil . "/" . $fechaCarpeta . "/";
48
-
49
-                        //$this->downloadProcess($row->url_descarga);
50 48
                         $this->downloadZip($row->url_descarga);
51 49
                     }
52 50
 
@@ -75,48 +73,6 @@ class Parser extends CI_Controller
75 73
     } */
76 74
     }
77 75
 
78
-    //TODO ELIMINAR PARA PROCESAR ZIPS, NO EL DIARIO
79
-    private function downloadProcess($urlXML)
80
-    {
81
-
82
-        $fileName = basename($urlXML);
83
-        $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
84
-        $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
85
-        $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
86
-
87
-        while ($nuevoAtomAttrNext !== "") {
88
-            //$aux = 0;
89
-            //while ($aux <= 3) {
90
-
91
-            $fileName = basename($nuevoAtomAttrNext);
92
-            $this->downloadFile($fileName, $nuevoAtomAttrNext, $this->rutaDiariaFecha);
93
-            $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
94
-
95
-            $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
96
-            //$aux++;
97
-        }
98
-    }
99
-
100
-    private function readNextAttribute($archivo)
101
-    {
102
-        $enlace = "";
103
-        foreach ($archivo['link'] as $row) {
104
-            $attrNext = $row['@attributes']['rel'];
105
-            $attrHref = $row['@attributes']['href'];
106
-
107
-            if ($attrNext === "next") {
108
-                if (!strpos($attrHref, "licitacionesPerfilesContratanteCompleto3_2021")) { //"20220127_")) {
109
-                    $enlace = $attrHref;
110
-                } else {
111
-                    $enlace = "";
112
-                }
113
-                //$enlace = $attrHref;
114
-            }
115
-        }
116
-
117
-        return $enlace;
118
-    }
119
-
120 76
     private function downloadZip($urlXML)
121 77
     {
122 78
         $fechaDescarga = $this->getFechaForDownloadZip();
@@ -142,14 +98,21 @@ class Parser extends CI_Controller
142 98
     {
143 99
         $result = "_";
144 100
         $anyo = date("Y");
145
-        $mes = date("m", strtotime("-1 months"));
101
+        $mes = date("m");
102
+        $mesPrevious = date("m", strtotime("-1 months"));
103
+        $yearPrevious = date("Y", strtotime("-1 year"));
146 104
         $dia = date("d");
147 105
 
148
-        if ($dia == "01") {
149
-            $result .= $anyo . $mes . ".zip";
106
+        if (date("m") == "01") {
107
+            $result .= $yearPrevious . $mesPrevious . ".zip";
150 108
         } else {
151
-            $result .= $anyo . $mes . ".zip";
109
+            if ($dia == "01") {
110
+                $result .= $anyo . $mesPrevious . ".zip";
111
+            } else {
112
+                $result .= $anyo . $mes . ".zip";
113
+            }
152 114
         }
115
+
153 116
         return $result;
154 117
     }
155 118
 

+ 1 - 1
application/helpers/email_templates_helper.php Näytä tiedosto

@@ -26,7 +26,7 @@ if (!function_exists("emailInicioProcesoDescarga")) {
26 26
 		</html>";
27 27
 
28 28
         $email = "chcalvoleon@mindden.com";
29
-        enviarEmail($asunto, $cuerpo, $email, false);
29
+        enviarEmail($asunto, $cuerpo, $email, true);
30 30
     }
31 31
 }
32 32
 

+ 4 - 8
application/helpers/funciones_helper.php Näytä tiedosto

@@ -167,12 +167,12 @@ if (!function_exists("enviarEmail")) {
167 167
 
168 168
         $CI->load->library('email');
169 169
 
170
-        $config['protocol'] = 'smtp';
170
+        $config['protocol'] = 'mail';
171 171
         $config['smtp_host'] = 'smtp.gmail.com';
172 172
         $config['smtp_user'] = 'chcalvoleon@mindden.com';
173 173
         $config['smtp_pass'] = '4lb1R2014';
174 174
         $config['smtp_crypto'] = 'ssl';
175
-        $config['smtp_port'] = 465;
175
+        $config['smtp_port'] = 25;
176 176
         $config['mailtype'] = 'html';
177 177
         $config['wordwrap'] = 'TRUE';
178 178
         $config['newline'] = "\r\n";
@@ -188,15 +188,11 @@ if (!function_exists("enviarEmail")) {
188 188
         $CI->email->subject($asunto);
189 189
         $CI->email->message($body);
190 190
 
191
-        foreach ($adjuntos as $row) {
192
-            $CI->email->attach($row);
193
-        }
194
-
195 191
         if ($print_result) {
196
-            $CI->email->send(false);
192
+            $CI->email->send(true);
197 193
             $CI->email->print_debugger();
198 194
         } else {
199
-            $CI->email->send(false);
195
+            $CI->email->send(true);
200 196
         }
201 197
     }
202 198
 }

+ 26 - 11
application/libraries/ParserFile.php Näytä tiedosto

@@ -430,8 +430,8 @@ class ParserFile
430 430
                 if (array_key_exists("AwardedTenderedProject", $tenderResult[$i])) {
431 431
                     $awardedTenderedProject = $tenderResult[$i]['AwardedTenderedProject'];
432 432
                     $resultEntries[$i]['procurementProjectLotID'] = $this->existNodo($awardedTenderedProject, 'ProcurementProjectLotID', 'string');
433
-                    $resultEntries[$i]['TaxExclusiveAmount'] = $this->existNodo($awardedTenderedProject->LegalMonetaryTotal, 'TaxExclusiveAmount', 'string');
434
-                    $resultEntries[$i]['PayableAmount'] = $this->existNodo($awardedTenderedProject->LegalMonetaryTotal, 'PayableAmount', 'string');
433
+                    $resultEntries[$i]['TaxExclusiveAmount'] = $this->existNodo($awardedTenderedProject['LegalMonetaryTotal'], 'TaxExclusiveAmount', 'string');
434
+                    $resultEntries[$i]['PayableAmount'] = $this->existNodo($awardedTenderedProject['LegalMonetaryTotal'], 'PayableAmount', 'string');
435 435
                 }
436 436
             }
437 437
         }
@@ -463,11 +463,15 @@ class ParserFile
463 463
             $resultEntries['tenderingTerm']['procurementLegislationDocumentReference'] = $this->existNodo($TenderingTerms['ProcurementLegislationDocumentReference'], 'ID', 'string');
464 464
             $resultEntries['tenderingTerm']['allowedSubcontractTerms'] = $this->existNodo($TenderingTerms['AllowedSubcontractTerms'], 'Description', 'string');
465 465
 
466
+            //Criterio de adjudicación
466 467
             if (array_key_exists("AwardingTerms", $TenderingTerms)) {
467 468
                 $tendererAwardingTerms = $TenderingTerms['AwardingTerms']['AwardingCriteria'];
469
+                if (array_key_first($tendererAwardingTerms) !== 0) {
470
+                    $tendererAwardingTerms = array(0 => $tendererAwardingTerms);
471
+                }
468 472
                 for ($i = 0; $i < count($tendererAwardingTerms); $i++) {
469
-                    $resultEntries["awardingCriteria"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererAwardingTerms[$i], 'Description', 'string');
470
-                    $resultEntries["awardingCriteria"][$i]['description'] = $this->existNodo($tendererAwardingTerms[$i], 'WeightNumeric', 'string');
473
+                    $resultEntries["awardingCriteria"][$i]['description'] = $this->existNodo($tendererAwardingTerms[$i], 'Description', 'string');
474
+                    $resultEntries["awardingCriteria"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererAwardingTerms[$i], 'WeightNumeric', 'string');
471 475
                     $resultEntries["awardingCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
472 476
                     $resultEntries["awardingCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
473 477
                     $resultEntries["awardingCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
@@ -475,15 +479,21 @@ class ParserFile
475 479
                 }
476 480
             }
477 481
 
482
+            //Criterio de evluación tecnica
478 483
             if (array_key_exists("TendererQualificationRequest", $TenderingTerms)) {
479 484
                 $tendererQualificationRequest = $TenderingTerms['TendererQualificationRequest'];
480 485
                 $resultEntries['tenderingTerm']['description'] = $this->existNodo($tendererQualificationRequest, 'Description', 'string');
481 486
                 $resultEntries['tenderingTerm']['personalSituation'] = $this->existNodo($tendererQualificationRequest, 'PersonalSituation', 'string');
482
-                for ($i = 0; $i < count($tendererQualificationRequest); $i++) {
483
-                    if (isset($tendererQualificationRequest[$i]['EvaluationCriteriaTypeCode'])) {
484
-                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererQualificationRequest[$i]['TechnicalEvaluationCriteria'], 'EvaluationCriteriaTypeCode', 'string');
485
-                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($tendererQualificationRequest[$i]['TechnicalEvaluationCriteria'], "EvaluationCriteriaTypeCode", "sting", 'listURI');
486
-                        $resultEntries["TendererQualificationRequest"][$i]['description'] = $this->existNodo($tendererQualificationRequest[$i]['TechnicalEvaluationCriteria'], 'Description', 'string');
487
+                if (isset($tendererQualificationRequest['TechnicalEvaluationCriteria'])) {
488
+                    $techicnalQualifitacion = $tendererQualificationRequest['TechnicalEvaluationCriteria'];
489
+                    if (array_key_first($techicnalQualifitacion) !== 0) {
490
+                        $techicnalQualifitacion = array(0 => $techicnalQualifitacion);
491
+                    }
492
+                    for ($i = 0; $i < count($techicnalQualifitacion); $i++) {
493
+
494
+                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], 'EvaluationCriteriaTypeCode', 'string');
495
+                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], "EvaluationCriteriaTypeCode", "sting", 'listURI');
496
+                        $resultEntries["TendererQualificationRequest"][$i]['description'] = $this->existNodo($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], 'Description', 'string');
487 497
                         $resultEntries["TendererQualificationRequest"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
488 498
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
489 499
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
@@ -492,6 +502,7 @@ class ParserFile
492 502
 
493 503
                 }
494 504
 
505
+                //Criterios de evaluacion financiera
495 506
                 if (array_key_exists("FinancialEvaluationCriteria", $TenderingTerms['TendererQualificationRequest'])) {
496 507
                     $financialEvaluationCriteria = $TenderingTerms['TendererQualificationRequest']['FinancialEvaluationCriteria'];
497 508
                     for ($i = 0; $i < count($financialEvaluationCriteria); $i++) {
@@ -505,12 +516,16 @@ class ParserFile
505 516
                     }
506 517
                 }
507 518
 
519
+                //Requisitos de participación
508 520
                 if (array_key_exists("SpecificTendererRequirement", $TenderingTerms['TendererQualificationRequest'])) {
509 521
                     $specificTendererRequirement = $TenderingTerms['TendererQualificationRequest']['SpecificTendererRequirement'];
522
+                    if (array_key_first($specificTendererRequirement) !== 0) {
523
+                        $specificTendererRequirement = array(0 => $specificTendererRequirement);
524
+                    }
510 525
                     for ($i = 0; $i < count($specificTendererRequirement); $i++) {
511 526
 
512
-                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($specificTendererRequirement[$i]['SpecificTendererRequirement'], 'RequirementTypeCode', 'string');
513
-                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($specificTendererRequirement[$i]['SpecificTendererRequirement'], "RequirementTypeCode", "string", 'listURI');
527
+                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($specificTendererRequirement[$i], 'RequirementTypeCode', 'string');
528
+                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($specificTendererRequirement[$i], "RequirementTypeCode", "string", 'listURI');
514 529
                         $resultEntries["SpecificTendererRequirement"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
515 530
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
516 531
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";

+ 10 - 1
application/models/Xlsexport_model.php Näytä tiedosto

@@ -19,11 +19,20 @@ defined('BASEPATH') or exit('No direct script access allowed');
19 19
 class Xlsexport_model extends CI_Model
20 20
 {
21 21
 
22
-    protected $fechaLog = "2022-02-28 12:23:38";
22
+    protected $fechaLog = "";
23 23
 
24 24
     public function __construct()
25 25
     {
26 26
         parent::__construct();
27
+        $this->fechaLog = $this->getLastDateLog()->fecha_maxima;
28
+    }
29
+
30
+    public function getLastDateLog()
31
+    {
32
+        $sql = "SELECT MAX(fecha) as fecha_maxima FROM config_fecha_importaciones LIMIT 1";
33
+        $result = $this->db->query($sql);
34
+        return $result->row();
35
+
27 36
     }
28 37
 
29 38
     // ------------------------------------------------------------------------