浏览代码

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

Nermosis 3 年前
父节点
当前提交
a7af0aa58f

+ 69 - 72
application/controllers/ExportXls.php 查看文件

1
 <?php
1
 <?php
2
+ini_set('max_execution_time', '300');
2
 defined('BASEPATH') or exit('No direct script access allowed');
3
 defined('BASEPATH') or exit('No direct script access allowed');
3
 
4
 
4
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
5
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
30
     public function exportDatosCompletos()
31
     public function exportDatosCompletos()
31
     {
32
     {
32
         $licitacionesResult = $this->Xlsexport_model->getFullDatosUltimasInsertadas();
33
         $licitacionesResult = $this->Xlsexport_model->getFullDatosUltimasInsertadas();
34
+
33
         $result = array();
35
         $result = array();
34
 
36
 
35
         //$start = $this->starttime();
37
         //$start = $this->starttime();
72
         $spreadsheet = $this->datosCompletosHojaBitacora($spreadsheet, $result);
74
         $spreadsheet = $this->datosCompletosHojaBitacora($spreadsheet, $result);
73
         $spreadsheet = $this->datosCompletosMediosPublicacion($spreadsheet, $result['validNoticeInfo']);
75
         $spreadsheet = $this->datosCompletosMediosPublicacion($spreadsheet, $result['validNoticeInfo']);
74
         $spreadsheet = $this->datosMedioPublicacion($spreadsheet, $result['validNoticeInfoDocumentos']);
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
         $spreadsheet = $this->datosCriterioEvaluacionTecnica($spreadsheet, $result['tenderTecnicos']);
79
         $spreadsheet = $this->datosCriterioEvaluacionTecnica($spreadsheet, $result['tenderTecnicos']);
78
         $spreadsheet = $this->datosRequisitosParticipacion($spreadsheet, $result['tenderQualification']);
80
         $spreadsheet = $this->datosRequisitosParticipacion($spreadsheet, $result['tenderQualification']);
79
 
81
 
122
     public function mapearDatos($licitacionesResult): array
124
     public function mapearDatos($licitacionesResult): array
123
     {
125
     {
124
         $result = array();
126
         $result = array();
127
+
125
         guardar_log("Excel", "Montando array datos licitacion");
128
         guardar_log("Excel", "Montando array datos licitacion");
126
         foreach ($licitacionesResult['datos'] as $licitacion) {
129
         foreach ($licitacionesResult['datos'] as $licitacion) {
127
 
130
 
180
         }
183
         }
181
 
184
 
182
         guardar_log("Excel", "Consulta Valid notice info");
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
         guardar_log("Excel", "Consulta Valid notice info documentos");
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
         guardar_log("Excel", "Consulta projectLot");
191
         guardar_log("Excel", "Consulta projectLot");
189
         $result['projectLot'] = $this->Xlsexport_model->getProjectLotItem();
192
         $result['projectLot'] = $this->Xlsexport_model->getProjectLotItem();
190
 
193
 
191
         guardar_log("Excel", "Consulta documentos tecnicos");
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
         guardar_log("Excel", "Consulta documentos legales");
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
         guardar_log("Excel", "Consulta documentos adicionales");
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
         guardar_log("Excel", "Consulta documentos generales");
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
         guardar_log("Excel", "Consulta tender process");
206
         guardar_log("Excel", "Consulta tender process");
204
         $result['tenderProcess'] = $this->Xlsexport_model->getTenderingTermsCodes();
207
         $result['tenderProcess'] = $this->Xlsexport_model->getTenderingTermsCodes();
205
 
208
 
206
         guardar_log("Excel", "Consulta tender terms");
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
         guardar_log("Excel", "Consulta tender result");
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
         guardar_log("Excel", "Consulta tender criterio financieros");
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
         guardar_log("Excel", "Consulta tender criterio adjudicacion");
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
         guardar_log("Excel", "Consulta tender criterios tecnicos");
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
         guardar_log("Excel", "Consulta tender requisitos participacion");
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
         return $result;
227
         return $result;
225
     }
228
     }
271
 
274
 
272
             $sheet->setCellValue('K' . $this->filaDatoLicitacion, $row['locatedParty']['itemClassification_attr']);
275
             $sheet->setCellValue('K' . $this->filaDatoLicitacion, $row['locatedParty']['itemClassification_attr']);
273
             $sheet->setCellValue('L' . $this->filaDatoLicitacion, $row['project']['tipo_contrato']);
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
             $sheet->setCellValue('N' . $this->filaDatoLicitacion, $row['party']['partyName']);
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
             $sheet->getStyle('AC' . $this->filaDatoLicitacion)
292
             $sheet->getStyle('AC' . $this->filaDatoLicitacion)
292
                 ->getNumberFormat()
293
                 ->getNumberFormat()
293
                 ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
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
             $sheet->getStyle('AD' . $this->filaDatoLicitacion)
296
             $sheet->getStyle('AD' . $this->filaDatoLicitacion)
296
                 ->getNumberFormat()
297
                 ->getNumberFormat()
297
                 ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
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
             $this->filaDatoLicitacion++;
305
             $this->filaDatoLicitacion++;
305
         }
306
         }
306
 
307
 
378
                 guardar_log("Excel", "Escribir datos medio publicacion--" . $contador);
379
                 guardar_log("Excel", "Escribir datos medio publicacion--" . $contador);
379
                 $contador++;
380
                 $contador++;
380
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
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
                 $sheet->SetCellValue('C' . $aux, $datos['publicationMediaName']);
383
                 $sheet->SetCellValue('C' . $aux, $datos['publicationMediaName']);
383
                 $aux++;
384
                 $aux++;
384
             }
385
             }
449
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
450
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
450
                 $sheet->SetCellValue('M' . $aux, $datos['partyIdentification']);
451
                 $sheet->SetCellValue('M' . $aux, $datos['partyIdentification']);
451
                 $sheet->SetCellValue('N' . $aux, $datos['partyName']);
452
                 $sheet->SetCellValue('N' . $aux, $datos['partyName']);
453
+                $sheet->SetCellValue('O' . $aux, $datos['TaxExclusiveAmount']);
452
 
454
 
453
                 $aux++;
455
                 $aux++;
454
             }
456
             }
481
                 $sheet->getStyle('J' . $aux)
483
                 $sheet->getStyle('J' . $aux)
482
                     ->getNumberFormat()
484
                     ->getNumberFormat()
483
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
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
                 $sheet->SetCellValue('L' . $aux, $datos['deadLineDescription']);
487
                 $sheet->SetCellValue('L' . $aux, $datos['deadLineDescription']);
489
                 $sheet->SetCellValue('M' . $aux, $datos['auctionTerms']);
488
                 $sheet->SetCellValue('M' . $aux, $datos['auctionTerms']);
490
                 $sheet->SetCellValue('N' . $aux, $this->formatFechas($datos['documentAvailablePeriod_EndDate']));
489
                 $sheet->SetCellValue('N' . $aux, $this->formatFechas($datos['documentAvailablePeriod_EndDate']));
541
                 guardar_log("Excel", "Escribir criterio adjucicacion--" . $contador);
540
                 guardar_log("Excel", "Escribir criterio adjucicacion--" . $contador);
542
                 $contador++;
541
                 $contador++;
543
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
542
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
544
-                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
545
                 $sheet->SetCellValue('B' . $aux, $datos['description']);
543
                 $sheet->SetCellValue('B' . $aux, $datos['description']);
544
+                $sheet->SetCellValue('C' . $aux, $datos['evaluationCriteriaTypeCode']);
546
                 $aux++;
545
                 $aux++;
547
             }
546
             }
548
         }
547
         }
562
                 guardar_log("Excel", "Escribir criterios evaluacion financiera--" . $contador);
561
                 guardar_log("Excel", "Escribir criterios evaluacion financiera--" . $contador);
563
                 $contador++;
562
                 $contador++;
564
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
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
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
565
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
567
                 $aux++;
566
                 $aux++;
568
             }
567
             }
582
                 guardar_log("Excel", "Escribir criterio evaluacion tecnica--" . $contador);
581
                 guardar_log("Excel", "Escribir criterio evaluacion tecnica--" . $contador);
583
                 $contador++;
582
                 $contador++;
584
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
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
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
585
                 $sheet->SetCellValue('C' . $aux, $datos['description']);
587
                 $aux++;
586
                 $aux++;
588
             }
587
             }
603
                 guardar_log("Excel", "Escribir requisitos participacion--" . $contador);
602
                 guardar_log("Excel", "Escribir requisitos participacion--" . $contador);
604
                 $contador++;
603
                 $contador++;
605
                 $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
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
                 $aux++;
606
                 $aux++;
608
             }
607
             }
609
 
608
 
697
         $spreadsheet->getActiveSheet()->SetCellValue('L1', "Tipo de contrato");
696
         $spreadsheet->getActiveSheet()->SetCellValue('L1', "Tipo de contrato");
698
         $spreadsheet->getActiveSheet()->SetCellValue('M1', "Lugar de ejecución");
697
         $spreadsheet->getActiveSheet()->SetCellValue('M1', "Lugar de ejecución");
699
         $spreadsheet->getActiveSheet()->SetCellValue('N1', "Órgano de Contratación");
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
         return $spreadsheet;
719
         return $spreadsheet;
723
     }
720
     }
724
 
721
 
759
         $spreadsheet->getActiveSheet()->SetCellValue('C1', "Número de lote");
756
         $spreadsheet->getActiveSheet()->SetCellValue('C1', "Número de lote");
760
         $spreadsheet->getActiveSheet()->SetCellValue('D1', "Importe sin Impuestos");
757
         $spreadsheet->getActiveSheet()->SetCellValue('D1', "Importe sin Impuestos");
761
         $spreadsheet->getActiveSheet()->SetCellValue('E1', "Lugar de ejecución del lote");
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
         return $spreadsheet;
761
         return $spreadsheet;
765
     }
762
     }
826
         $spreadsheet->getActiveSheet()->SetCellValue('L1', 'Fecha de formalización');
823
         $spreadsheet->getActiveSheet()->SetCellValue('L1', 'Fecha de formalización');
827
         $spreadsheet->getActiveSheet()->SetCellValue('M1', 'Adjudicatario CIF');
824
         $spreadsheet->getActiveSheet()->SetCellValue('M1', 'Adjudicatario CIF');
828
         $spreadsheet->getActiveSheet()->SetCellValue('N1', 'Nombre Adjudicatario');
825
         $spreadsheet->getActiveSheet()->SetCellValue('N1', 'Nombre Adjudicatario');
829
-
826
+        $spreadsheet->getActiveSheet()->SetCellValue('O1', 'Importe de adjudicación sin impuestos');
830
         return $spreadsheet;
827
         return $spreadsheet;
831
     }
828
     }
832
 
829
 
895
         );
892
         );
896
         $sheet->getStyle("A1:C1")->applyFromArray($styleArr);
893
         $sheet->getStyle("A1:C1")->applyFromArray($styleArr);
897
         $spreadsheet->getActiveSheet()->SetCellValue('A1', 'Identificador');
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
         return $spreadsheet;
898
         return $spreadsheet;
902
     }
899
     }

+ 11 - 48
application/controllers/Parser.php 查看文件

45
 
45
 
46
                     if ($this->newFolder($rutaPerfil . "/" . $fechaCarpeta)) {
46
                     if ($this->newFolder($rutaPerfil . "/" . $fechaCarpeta)) {
47
                         $this->rutaDiariaFecha = $rutaPerfil . "/" . $fechaCarpeta . "/";
47
                         $this->rutaDiariaFecha = $rutaPerfil . "/" . $fechaCarpeta . "/";
48
-
49
-                        //$this->downloadProcess($row->url_descarga);
50
                         $this->downloadZip($row->url_descarga);
48
                         $this->downloadZip($row->url_descarga);
51
                     }
49
                     }
52
 
50
 
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
     private function downloadZip($urlXML)
76
     private function downloadZip($urlXML)
121
     {
77
     {
122
         $fechaDescarga = $this->getFechaForDownloadZip();
78
         $fechaDescarga = $this->getFechaForDownloadZip();
142
     {
98
     {
143
         $result = "_";
99
         $result = "_";
144
         $anyo = date("Y");
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
         $dia = date("d");
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
         } else {
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
         return $result;
116
         return $result;
154
     }
117
     }
155
 
118
 

+ 1 - 1
application/helpers/email_templates_helper.php 查看文件

26
 		</html>";
26
 		</html>";
27
 
27
 
28
         $email = "chcalvoleon@mindden.com";
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 查看文件

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

+ 26 - 11
application/libraries/ParserFile.php 查看文件

430
                 if (array_key_exists("AwardedTenderedProject", $tenderResult[$i])) {
430
                 if (array_key_exists("AwardedTenderedProject", $tenderResult[$i])) {
431
                     $awardedTenderedProject = $tenderResult[$i]['AwardedTenderedProject'];
431
                     $awardedTenderedProject = $tenderResult[$i]['AwardedTenderedProject'];
432
                     $resultEntries[$i]['procurementProjectLotID'] = $this->existNodo($awardedTenderedProject, 'ProcurementProjectLotID', 'string');
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
             $resultEntries['tenderingTerm']['procurementLegislationDocumentReference'] = $this->existNodo($TenderingTerms['ProcurementLegislationDocumentReference'], 'ID', 'string');
463
             $resultEntries['tenderingTerm']['procurementLegislationDocumentReference'] = $this->existNodo($TenderingTerms['ProcurementLegislationDocumentReference'], 'ID', 'string');
464
             $resultEntries['tenderingTerm']['allowedSubcontractTerms'] = $this->existNodo($TenderingTerms['AllowedSubcontractTerms'], 'Description', 'string');
464
             $resultEntries['tenderingTerm']['allowedSubcontractTerms'] = $this->existNodo($TenderingTerms['AllowedSubcontractTerms'], 'Description', 'string');
465
 
465
 
466
+            //Criterio de adjudicación
466
             if (array_key_exists("AwardingTerms", $TenderingTerms)) {
467
             if (array_key_exists("AwardingTerms", $TenderingTerms)) {
467
                 $tendererAwardingTerms = $TenderingTerms['AwardingTerms']['AwardingCriteria'];
468
                 $tendererAwardingTerms = $TenderingTerms['AwardingTerms']['AwardingCriteria'];
469
+                if (array_key_first($tendererAwardingTerms) !== 0) {
470
+                    $tendererAwardingTerms = array(0 => $tendererAwardingTerms);
471
+                }
468
                 for ($i = 0; $i < count($tendererAwardingTerms); $i++) {
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
                     $resultEntries["awardingCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
475
                     $resultEntries["awardingCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
472
                     $resultEntries["awardingCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
476
                     $resultEntries["awardingCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
473
                     $resultEntries["awardingCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
477
                     $resultEntries["awardingCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
475
                 }
479
                 }
476
             }
480
             }
477
 
481
 
482
+            //Criterio de evluación tecnica
478
             if (array_key_exists("TendererQualificationRequest", $TenderingTerms)) {
483
             if (array_key_exists("TendererQualificationRequest", $TenderingTerms)) {
479
                 $tendererQualificationRequest = $TenderingTerms['TendererQualificationRequest'];
484
                 $tendererQualificationRequest = $TenderingTerms['TendererQualificationRequest'];
480
                 $resultEntries['tenderingTerm']['description'] = $this->existNodo($tendererQualificationRequest, 'Description', 'string');
485
                 $resultEntries['tenderingTerm']['description'] = $this->existNodo($tendererQualificationRequest, 'Description', 'string');
481
                 $resultEntries['tenderingTerm']['personalSituation'] = $this->existNodo($tendererQualificationRequest, 'PersonalSituation', 'string');
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
                         $resultEntries["TendererQualificationRequest"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
497
                         $resultEntries["TendererQualificationRequest"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
488
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
498
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
489
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
499
                         $resultEntries["TendererQualificationRequest"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
492
 
502
 
493
                 }
503
                 }
494
 
504
 
505
+                //Criterios de evaluacion financiera
495
                 if (array_key_exists("FinancialEvaluationCriteria", $TenderingTerms['TendererQualificationRequest'])) {
506
                 if (array_key_exists("FinancialEvaluationCriteria", $TenderingTerms['TendererQualificationRequest'])) {
496
                     $financialEvaluationCriteria = $TenderingTerms['TendererQualificationRequest']['FinancialEvaluationCriteria'];
507
                     $financialEvaluationCriteria = $TenderingTerms['TendererQualificationRequest']['FinancialEvaluationCriteria'];
497
                     for ($i = 0; $i < count($financialEvaluationCriteria); $i++) {
508
                     for ($i = 0; $i < count($financialEvaluationCriteria); $i++) {
505
                     }
516
                     }
506
                 }
517
                 }
507
 
518
 
519
+                //Requisitos de participación
508
                 if (array_key_exists("SpecificTendererRequirement", $TenderingTerms['TendererQualificationRequest'])) {
520
                 if (array_key_exists("SpecificTendererRequirement", $TenderingTerms['TendererQualificationRequest'])) {
509
                     $specificTendererRequirement = $TenderingTerms['TendererQualificationRequest']['SpecificTendererRequirement'];
521
                     $specificTendererRequirement = $TenderingTerms['TendererQualificationRequest']['SpecificTendererRequirement'];
522
+                    if (array_key_first($specificTendererRequirement) !== 0) {
523
+                        $specificTendererRequirement = array(0 => $specificTendererRequirement);
524
+                    }
510
                     for ($i = 0; $i < count($specificTendererRequirement); $i++) {
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
                         $resultEntries["SpecificTendererRequirement"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
529
                         $resultEntries["SpecificTendererRequirement"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
515
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
530
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
516
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
531
                         $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";

+ 10 - 1
application/models/Xlsexport_model.php 查看文件

19
 class Xlsexport_model extends CI_Model
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
     public function __construct()
24
     public function __construct()
25
     {
25
     {
26
         parent::__construct();
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
     // ------------------------------------------------------------------------