Parcourir la source

traducir codigos a strings. Formatos de fechas y monedas

Nermosis il y a 3 ans
Parent
révision
e8662746b6
2 fichiers modifiés avec 137 ajouts et 259 suppressions
  1. 115 106
      application/controllers/ExportXls.php
  2. 22 153
      application/models/Xlsexport_model.php

+ 115 - 106
application/controllers/ExportXls.php Voir le fichier

@@ -201,13 +201,13 @@ class ExportXls extends CI_Controller
201 201
         $result['generalDocs'] = $this->Xlsexport_model->getTablaByFechaLog("maestro_general_documents");
202 202
 
203 203
         guardar_log("Excel", "Consulta tender process");
204
-        $result['tenderProcess'] = $this->Xlsexport_model->getTablaByFechaLog("maestro_tendering_process");
204
+        $result['tenderProcess'] = $this->Xlsexport_model->getTenderingTermsCodes();
205 205
 
206 206
         guardar_log("Excel", "Consulta tender terms");
207
-        $result['tenderingTerms'] = $this->Xlsexport_model->getTablaByFechaLog("maestro_tendering_terms");
207
+        $result['tenderingTerms'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("maestro_tendering_terms", "relacionada_codigo_tipo_garantia", "code", "guaranteeTypeCode");
208 208
 
209 209
         guardar_log("Excel", "Consulta tender result");
210
-        $result['tenderResult'] = $this->Xlsexport_model->getTablaByFechaLog("maestro_tender_result");
210
+        $result['tenderResult'] = $this->Xlsexport_model->getDatosRelacionadasTablaWithoutLicitacion("maestro_tender_result", "relacionada_tender_result", "code", "resultCode");
211 211
 
212 212
         guardar_log("Excel", "Consulta tender criterio financieros");
213 213
         $result['tenderFinancial'] = $this->Xlsexport_model->getTablaByFechaLog("maestro_tendering_terms_financial_evaluation");
@@ -312,9 +312,11 @@ class ExportXls extends CI_Controller
312 312
     {
313 313
         $fechaFinal = "";
314 314
 
315
-        if ($fecha != "0000-00-00") {
315
+        if ($fecha != "0000-00-00" && $fecha != "0000-00-00 00:00:00") {
316 316
             $fechaFormat = new DateTime($fecha);
317 317
             $fechaFinal = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($fechaFormat);
318
+        } else {
319
+            $fechaFinal = "00/00/0000";
318 320
         }
319 321
 
320 322
         return $fechaFinal;
@@ -362,8 +364,8 @@ class ExportXls extends CI_Controller
362 364
 
363 365
     private function datosCompletosMediosPublicacion($spreadsheet, $datos)
364 366
     {
365
-        $spreadsheet->setActiveSheetIndex(2);
366
-        $spreadsheet->getActiveSheet()->setTitle("Medios de publicación");
367
+        $sheet = $spreadsheet->getSheet(2);
368
+        $sheet->setTitle("Medios de publicación");
367 369
 
368 370
         if ($datos['num_rows'] > 0) {
369 371
             $contador = 0;
@@ -371,9 +373,9 @@ class ExportXls extends CI_Controller
371 373
             foreach ($datos['datos'] as $datos) {
372 374
                 guardar_log("Excel", "Escribir datos medio publicacion--" . $contador);
373 375
                 $contador++;
374
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
375
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['noticeTypeCode']);
376
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['publicationMediaName']);
376
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
377
+                $sheet->SetCellValue('B' . $aux, $datos['noticeTypeCode']);
378
+                $sheet->SetCellValue('C' . $aux, $datos['publicationMediaName']);
377 379
                 $aux++;
378 380
             }
379 381
         }
@@ -383,8 +385,8 @@ class ExportXls extends CI_Controller
383 385
 
384 386
     private function datosMedioPublicacion($spreadsheet, $datos)
385 387
     {
386
-        $spreadsheet->setActiveSheetIndex(3);
387
-        $spreadsheet->getActiveSheet()->setTitle("Documentos Medios Comm");
388
+        $sheet = $spreadsheet->getSheet(3);
389
+        $sheet->setTitle("Documentos Medios Comm");
388 390
 
389 391
         if ($datos['num_rows'] > 0) {
390 392
             $aux = 2;
@@ -392,9 +394,9 @@ class ExportXls extends CI_Controller
392 394
             foreach ($datos['datos'] as $row) {
393 395
                 guardar_log("Excel", "Escribir documentios medios comunicacion--" . $contador);
394 396
                 $contador++;
395
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $row['id_ajena_licitacion']);
396
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $row['documento']);
397
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $row['filename']);
397
+                $sheet->SetCellValue('A' . $aux, $row['id_ajena_licitacion']);
398
+                $sheet->SetCellValue('B' . $aux, $row['documento']);
399
+                $sheet->SetCellValue('C' . $aux, $row['filename']);
398 400
 
399 401
                 $aux++;
400 402
             }
@@ -404,8 +406,8 @@ class ExportXls extends CI_Controller
404 406
 
405 407
     private function datosCompletosResultadoDelProcedimiento($spreadsheet, $datos)
406 408
     {
407
-        $spreadsheet->setActiveSheetIndex(4);
408
-        $spreadsheet->getActiveSheet()->setTitle("Resultado del Procedimiento");
409
+        $sheet = $spreadsheet->getSheet(4);
410
+        $sheet->setTitle("Resultado del Procedimiento");
409 411
 
410 412
         if ($datos['num_rows'] > 0) {
411 413
             $aux = 2;
@@ -413,30 +415,38 @@ class ExportXls extends CI_Controller
413 415
             foreach ($datos['datos'] as $datos) {
414 416
                 guardar_log("Excel", "Escribir tender result--" . $contador);
415 417
                 $contador++;
416
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
417
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['resultCode']);
418
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['description']);
419
-                $spreadsheet->getActiveSheet()->SetCellValue('D' . $aux, $this->formatFechas($datos['awardDate']));
420
-                $spreadsheet->getStyle('D' . $aux)
418
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
419
+                $sheet->SetCellValue('B' . $aux, $datos['code_desc']);
420
+                $sheet->SetCellValue('C' . $aux, $datos['description']);
421
+                $sheet->SetCellValue('D' . $aux, $this->formatFechas($datos['awardDate']));
422
+                $sheet->getStyle('D' . $aux)
421 423
                     ->getNumberFormat()
422 424
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
423
-                $spreadsheet->getActiveSheet()->SetCellValue('E' . $aux, $datos['receivedTenderQuantity']);
424
-                $spreadsheet->getActiveSheet()->SetCellValue('F' . $aux, $datos['lowerTenderAmount']);
425
-                $spreadsheet->getActiveSheet()->SetCellValue('G' . $aux, $datos['higherTenderAmount']);
426
-                $spreadsheet->getActiveSheet()->SetCellValue('H' . $aux, $datos['abnormallyLowTendersIndicator']);
427
-                $spreadsheet->getActiveSheet()->SetCellValue('I' . $aux, $this->formatFechas($datos['startDate']));
428
-                $spreadsheet->getStyle('I' . $aux)
425
+                $sheet->SetCellValue('E' . $aux, $datos['receivedTenderQuantity']);
426
+                $sheet->SetCellValue('F' . $aux, $datos['lowerTenderAmount']);
427
+                $sheet->getStyle('F' . $aux)
429 428
                     ->getNumberFormat()
430
-                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
431
-                $spreadsheet->getActiveSheet()->SetCellValue('J' . $aux, $datos['smeawardedIndicator']);
432
-                $spreadsheet->getActiveSheet()->SetCellValue('K' . $aux, $datos['contract_id']);
433
-                $spreadsheet->getActiveSheet()->SetCellValue('L' . $aux, $this->formatFechas($datos['contract_issueDate']));
434
-                $spreadsheet->getStyle('L' . $aux)
429
+                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_ACCOUNTING_EUR);
430
+                $sheet->SetCellValue('G' . $aux, $datos['higherTenderAmount']);
431
+                $sheet->getStyle('G' . $aux)
435 432
                     ->getNumberFormat()
436
-                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
437
-                $spreadsheet->getActiveSheet()->SetCellValue('M' . $aux, $datos['partyIdentification']);
438
-                $spreadsheet->getActiveSheet()->SetCellValue('N' . $aux, $datos['partyName']);
439
-                $spreadsheet->getActiveSheet()->SetCellValue('O' . $aux, $datos['TaxExclusiveAmount']);
433
+                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_ACCOUNTING_EUR);
434
+                $sheet->SetCellValue('H' . $aux, $datos['abnormallyLowTendersIndicator']);
435
+                //$sheet->SetCellValue('I' . $aux, $datos['startDate']);
436
+                $sheet->SetCellValue('I' . $aux, $this->formatFechas($datos['startDate']));
437
+                $sheet->getStyle('I' . $aux)
438
+                    ->getNumberFormat()
439
+                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
440
+                $sheet->SetCellValue('J' . $aux, $datos['smeawardedIndicator']);
441
+                $sheet->SetCellValue('K' . $aux, $datos['contract_id']);
442
+                $sheet->SetCellValue('L' . $aux, $datos['contract_issueDate']);
443
+                $sheet->SetCellValue('L' . $aux, $this->formatFechas($datos['contract_issueDate']));
444
+                $sheet->getStyle('L' . $aux)
445
+                    ->getNumberFormat()
446
+                    ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
447
+                $sheet->SetCellValue('M' . $aux, $datos['partyIdentification']);
448
+                $sheet->SetCellValue('N' . $aux, $datos['partyName']);
449
+                $sheet->SetCellValue('O' . $aux, $datos['TaxExclusiveAmount']);
440 450
 
441 451
                 $aux++;
442 452
             }
@@ -446,8 +456,8 @@ class ExportXls extends CI_Controller
446 456
 
447 457
     private function datosCompletosTipoProcedimiento($spreadsheet, $datos)
448 458
     {
449
-        $spreadsheet->setActiveSheetIndex(5);
450
-        $spreadsheet->getActiveSheet()->setTitle("Tipo Procedimiento");
459
+        $sheet = $spreadsheet->getSheet(5);
460
+        $sheet->setTitle("Tipo Procedimiento");
451 461
 
452 462
         //$datos = $this->Xlsexport_model->getTenderProcessRelacion();
453 463
         if ($datos['num_rows'] > 0) {
@@ -456,30 +466,30 @@ class ExportXls extends CI_Controller
456 466
             foreach ($datos['datos'] as $datos) {
457 467
                 guardar_log("Excel", "Escribir tender process--" . $contador);
458 468
                 $contador++;
459
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
460
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['procedureCode']);
461
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['urgencyCode']);
462
-                $spreadsheet->getActiveSheet()->SetCellValue('D' . $aux, $datos['contractingSystemCode']);
463
-                $spreadsheet->getActiveSheet()->SetCellValue('E' . $aux, $datos['partPresentationCode']);
464
-                $spreadsheet->getActiveSheet()->SetCellValue('F' . $aux, $datos['submissionMethodCode']);
465
-                $spreadsheet->getActiveSheet()->SetCellValue('G' . $aux, $datos['maximumLotPresentationQuantity']);
466
-                $spreadsheet->getActiveSheet()->SetCellValue('H' . $aux, $datos['maximumTendererAwardedLotsQuantity']);
467
-                $spreadsheet->getActiveSheet()->SetCellValue('I' . $aux, $datos['lotsCombinationContractingAuthorityRights']);
468
-                $spreadsheet->getActiveSheet()->SetCellValue('J' . $aux, $this->formatFechas($datos['deadLineEndDate']));
469
-                $spreadsheet->getStyle('J' . $aux)
469
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
470
+                $sheet->SetCellValue('B' . $aux, $datos['tipoTender']);
471
+                $sheet->SetCellValue('C' . $aux, $datos['urgency']);
472
+                $sheet->SetCellValue('D' . $aux, $datos['contrato_sistema']);
473
+                $sheet->SetCellValue('E' . $aux, $datos['partPresentationCode']);
474
+                $sheet->SetCellValue('F' . $aux, $datos['submision']);
475
+                $sheet->SetCellValue('G' . $aux, $datos['maximumLotPresentationQuantity']);
476
+                $sheet->SetCellValue('H' . $aux, $datos['maximumTendererAwardedLotsQuantity']);
477
+                $sheet->SetCellValue('I' . $aux, $datos['lotsCombinationContractingAuthorityRights']);
478
+                $sheet->SetCellValue('J' . $aux, $this->formatFechas($datos['deadLineEndDate']));
479
+                $sheet->getStyle('J' . $aux)
470 480
                     ->getNumberFormat()
471 481
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
472
-                $spreadsheet->getActiveSheet()->SetCellValue('K' . $aux, $this->formatFechas($datos['deadLineEndTime']));
473
-                $spreadsheet->getStyle('K' . $aux)
482
+                $sheet->SetCellValue('K' . $aux, $this->formatFechas($datos['deadLineEndTime']));
483
+                $sheet->getStyle('K' . $aux)
474 484
                     ->getNumberFormat()
475 485
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
476
-                $spreadsheet->getActiveSheet()->SetCellValue('L' . $aux, $datos['deadLineDescription']);
477
-                $spreadsheet->getActiveSheet()->SetCellValue('M' . $aux, $datos['auctionTerms']);
478
-                $spreadsheet->getActiveSheet()->SetCellValue('N' . $aux, $this->formatFechas($datos['documentAvailablePeriod_EndDate']));
479
-                $spreadsheet->getStyle('N' . $aux)
486
+                $sheet->SetCellValue('L' . $aux, $datos['deadLineDescription']);
487
+                $sheet->SetCellValue('M' . $aux, $datos['auctionTerms']);
488
+                $sheet->SetCellValue('N' . $aux, $this->formatFechas($datos['documentAvailablePeriod_EndDate']));
489
+                $sheet->getStyle('N' . $aux)
480 490
                     ->getNumberFormat()
481 491
                     ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY);
482
-                $spreadsheet->getActiveSheet()->SetCellValue('O' . $aux, $datos['documentAvailablePeriod_EndTime']);
492
+                $sheet->SetCellValue('O' . $aux, $datos['documentAvailablePeriod_EndTime']);
483 493
 
484 494
                 $aux++;
485 495
             }
@@ -490,8 +500,8 @@ class ExportXls extends CI_Controller
490 500
 
491 501
     private function datosCompletosOfertas($spreadsheet, $datos)
492 502
     {
493
-        $spreadsheet->setActiveSheetIndex(6);
494
-        $spreadsheet->getActiveSheet()->setTitle("Ofertas");
503
+        $sheet = $spreadsheet->getSheet(6);
504
+        $sheet->setTitle("Ofertas");
495 505
 
496 506
         if ($datos['num_rows'] > 0) {
497 507
             $aux = 2;
@@ -499,14 +509,14 @@ class ExportXls extends CI_Controller
499 509
             foreach ($datos['datos'] as $datos) {
500 510
                 guardar_log("Excel", "Escribir tender process--" . $contador);
501 511
                 $contador++;
502
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
503
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['variantConstraintIndicator']);
504
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['guaranteeTypeCode']);
505
-                $spreadsheet->getActiveSheet()->SetCellValue('D' . $aux, $datos['requiredFinancialGuarantee_Amount']);
506
-                $spreadsheet->getActiveSheet()->SetCellValue('E' . $aux, $datos['allowedSubcontractTerms']);
507
-                $spreadsheet->getActiveSheet()->SetCellValue('F' . $aux, $datos['description']);
508
-                $spreadsheet->getActiveSheet()->SetCellValue('G' . $aux, $datos['personalSituation']);
509
-                $spreadsheet->getActiveSheet()->SetCellValue('H' . $aux, $datos['procurementLegislationDocumentReference']);
512
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
513
+                $sheet->SetCellValue('B' . $aux, $datos['variantConstraintIndicator']);
514
+                $sheet->SetCellValue('C' . $aux, $datos['code_desc']);
515
+                $sheet->SetCellValue('D' . $aux, $datos['requiredFinancialGuarantee_Amount']);
516
+                $sheet->SetCellValue('E' . $aux, $datos['allowedSubcontractTerms']);
517
+                $sheet->SetCellValue('F' . $aux, $datos['description']);
518
+                $sheet->SetCellValue('G' . $aux, $datos['personalSituation']);
519
+                $sheet->SetCellValue('H' . $aux, $datos['procurementLegislationDocumentReference']);
510 520
                 $aux++;
511 521
             }
512 522
         }
@@ -516,8 +526,8 @@ class ExportXls extends CI_Controller
516 526
 
517 527
     private function datosCriterioAdjudicacion($spreadsheet, $datos)
518 528
     {
519
-        $spreadsheet->setActiveSheetIndex(7);
520
-        $spreadsheet->getActiveSheet()->setTitle("Criterio Adjudicación");
529
+        $sheet = $spreadsheet->getSheet(7);
530
+        $sheet->setTitle("Criterio Adjudicación");
521 531
 
522 532
         if ($datos['num_rows'] > 0) {
523 533
             $aux = 2;
@@ -525,9 +535,9 @@ class ExportXls extends CI_Controller
525 535
             foreach ($datos['datos'] as $datos) {
526 536
                 guardar_log("Excel", "Escribir criterio adjucicacion--" . $contador);
527 537
                 $contador++;
528
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
529
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
530
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['description']);
538
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
539
+                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
540
+                $sheet->SetCellValue('B' . $aux, $datos['description']);
531 541
                 $aux++;
532 542
             }
533 543
         }
@@ -537,8 +547,8 @@ class ExportXls extends CI_Controller
537 547
 
538 548
     private function datosCriterioEvaluacionFinanciera($spreadsheet, $datos)
539 549
     {
540
-        $spreadsheet->setActiveSheetIndex(8);
541
-        $spreadsheet->getActiveSheet()->setTitle("CriteriosEvaluacionFinanciera");
550
+        $sheet = $spreadsheet->getSheet(8);
551
+        $sheet->setTitle("CriteriosEvaluacionFinanciera");
542 552
 
543 553
         if ($datos['num_rows'] > 0) {
544 554
             $aux = 2;
@@ -546,9 +556,9 @@ class ExportXls extends CI_Controller
546 556
             foreach ($datos['datos'] as $datos) {
547 557
                 guardar_log("Excel", "Escribir criterios evaluacion financiera--" . $contador);
548 558
                 $contador++;
549
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
550
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
551
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['description']);
559
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
560
+                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
561
+                $sheet->SetCellValue('C' . $aux, $datos['description']);
552 562
                 $aux++;
553 563
             }
554 564
         }
@@ -557,8 +567,8 @@ class ExportXls extends CI_Controller
557 567
 
558 568
     private function datosCriterioEvaluacionTecnica($spreadsheet, $datos)
559 569
     {
560
-        $spreadsheet->setActiveSheetIndex(9);
561
-        $spreadsheet->getActiveSheet()->setTitle("Criterios Evaluación Técnica");
570
+        $sheet = $spreadsheet->getSheet(9);
571
+        $sheet->setTitle("Criterios Evaluación Técnica");
562 572
 
563 573
         if ($datos['num_rows'] > 0) {
564 574
             $aux = 2;
@@ -566,9 +576,9 @@ class ExportXls extends CI_Controller
566 576
             foreach ($datos['datos'] as $datos) {
567 577
                 guardar_log("Excel", "Escribir criterio evaluacion tecnica--" . $contador);
568 578
                 $contador++;
569
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
570
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
571
-                $spreadsheet->getActiveSheet()->SetCellValue('C' . $aux, $datos['description']);
579
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
580
+                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
581
+                $sheet->SetCellValue('C' . $aux, $datos['description']);
572 582
                 $aux++;
573 583
             }
574 584
         }
@@ -578,8 +588,8 @@ class ExportXls extends CI_Controller
578 588
 
579 589
     private function datosRequisitosParticipacion($spreadsheet, $datos)
580 590
     {
581
-        $spreadsheet->setActiveSheetIndex(10);
582
-        $spreadsheet->getActiveSheet()->setTitle("Requisitos Participación");
591
+        $sheet = $spreadsheet->getSheet(10);
592
+        $sheet->setTitle("Requisitos Participación");
583 593
 
584 594
         if ($datos['num_rows'] > 0) {
585 595
             $aux = 2;
@@ -587,8 +597,8 @@ class ExportXls extends CI_Controller
587 597
             foreach ($datos['datos'] as $datos) {
588 598
                 guardar_log("Excel", "Escribir requisitos participacion--" . $contador);
589 599
                 $contador++;
590
-                $spreadsheet->getActiveSheet()->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
591
-                $spreadsheet->getActiveSheet()->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
600
+                $sheet->SetCellValue('A' . $aux, $datos['id_ajena_licitacion']);
601
+                $sheet->SetCellValue('B' . $aux, $datos['evaluationCriteriaTypeCode']);
592 602
                 $aux++;
593 603
             }
594 604
 
@@ -598,16 +608,15 @@ class ExportXls extends CI_Controller
598 608
 
599 609
     private function datosCompletosDocumentosGenerales($spreadsheet, $datosLicitacion)
600 610
     {
601
-
602
-        $spreadsheet->setActiveSheetIndex(11);
603
-        $spreadsheet->getActiveSheet()->setTitle("Documentos Generales");
611
+        $sheet = $spreadsheet->getSheet(11);
612
+        $sheet->setTitle("Documentos Generales");
604 613
         $contador = 0;
605 614
         foreach ($datosLicitacion['datos'] as $doc) {
606 615
             guardar_log("Excel", "Escribir documentos generales--" . $contador);
607 616
             $contador++;
608
-            $spreadsheet->getActiveSheet()->SetCellValue('A' . $this->filaDocumentoGeneral, $doc['id_ajena_licitacion']);
609
-            $spreadsheet->getActiveSheet()->SetCellValue('B' . $this->filaDocumentoGeneral, $doc['attachment']);
610
-            $spreadsheet->getActiveSheet()->SetCellValue('C' . $this->filaDocumentoGeneral, $doc['fileName']);
617
+            $sheet->SetCellValue('A' . $this->filaDocumentoGeneral, $doc['id_ajena_licitacion']);
618
+            $sheet->SetCellValue('B' . $this->filaDocumentoGeneral, $doc['attachment']);
619
+            $sheet->SetCellValue('C' . $this->filaDocumentoGeneral, $doc['fileName']);
611 620
 
612 621
             $this->filaDocumentoGeneral++;
613 622
         }
@@ -617,15 +626,15 @@ class ExportXls extends CI_Controller
617 626
 
618 627
     private function datosCompletosDocumentosAdicionales($spreadsheet, $datosLicitacion)
619 628
     {
620
-        $spreadsheet->setActiveSheetIndex(12);
621
-        $spreadsheet->getActiveSheet()->setTitle("Documentos Adicionales");
629
+        $sheet = $spreadsheet->getSheet(12);
630
+        $sheet->setTitle("Documentos Adicionales");
622 631
         $contador = 0;
623 632
         foreach ($datosLicitacion['datos'] as $doc) {
624 633
             guardar_log("Excel", "Escribir documentos adicionales--" . $contador);
625 634
             $contador++;
626
-            $spreadsheet->getActiveSheet()->SetCellValue('A' . $this->filaDocumentoAdd, $doc['id_ajena_licitacion']);
627
-            $spreadsheet->getActiveSheet()->SetCellValue('B' . $this->filaDocumentoAdd, $doc['attachment']);
628
-            $spreadsheet->getActiveSheet()->SetCellValue('C' . $this->filaDocumentoAdd, $doc['idDoc']);
635
+            $sheet->SetCellValue('A' . $this->filaDocumentoAdd, $doc['id_ajena_licitacion']);
636
+            $sheet->SetCellValue('B' . $this->filaDocumentoAdd, $doc['attachment']);
637
+            $sheet->SetCellValue('C' . $this->filaDocumentoAdd, $doc['idDoc']);
629 638
 
630 639
             $this->filaDocumentoAdd++;
631 640
         }
@@ -634,15 +643,15 @@ class ExportXls extends CI_Controller
634 643
 
635 644
     private function datosCompletosDocumentosTecnicos($spreadsheet, $datosLicitacion)
636 645
     {
637
-        $spreadsheet->setActiveSheetIndex(13);
638
-        $spreadsheet->getActiveSheet()->setTitle("Documentos Técnicos");
646
+        $sheet = $spreadsheet->getSheet(13);
647
+        $sheet->setTitle("Documentos Técnicos");
639 648
         $contador = 0;
640 649
         foreach ($datosLicitacion['datos'] as $doc) {
641 650
             guardar_log("Excel", "Escribir documentos tecnicos--" . $contador);
642 651
             $contador++;
643
-            $spreadsheet->getActiveSheet()->SetCellValue('A' . $this->filaDocumentoTech, $doc['id_ajena_licitacion']);
644
-            $spreadsheet->getActiveSheet()->SetCellValue('B' . $this->filaDocumentoTech, $doc['attachment']);
645
-            $spreadsheet->getActiveSheet()->SetCellValue('C' . $this->filaDocumentoTech, $doc['idDoc']);
652
+            $sheet->SetCellValue('A' . $this->filaDocumentoTech, $doc['id_ajena_licitacion']);
653
+            $sheet->SetCellValue('B' . $this->filaDocumentoTech, $doc['attachment']);
654
+            $sheet->SetCellValue('C' . $this->filaDocumentoTech, $doc['idDoc']);
646 655
 
647 656
             $this->filaDocumentoTech++;
648 657
         }
@@ -651,15 +660,15 @@ class ExportXls extends CI_Controller
651 660
 
652 661
     private function datosCompletosDocumentosLegales($spreadsheet, $datosLicitacion)
653 662
     {
654
-        $spreadsheet->setActiveSheetIndex(14);
655
-        $spreadsheet->getActiveSheet()->setTitle("Documentos Legales");
663
+        $sheet = $spreadsheet->getSheet(14);
664
+        $sheet->setTitle("Documentos Legales");
656 665
         $contador = 0;
657 666
         foreach ($datosLicitacion['datos'] as $doc) {
658 667
             guardar_log("Excel", "Escribir documentos legales--" . $contador);
659 668
             $contador++;
660
-            $spreadsheet->getActiveSheet()->SetCellValue('A' . $this->filaDocumentoLegal, $doc['id_ajena_licitacion']);
661
-            $spreadsheet->getActiveSheet()->SetCellValue('B' . $this->filaDocumentoLegal, $doc['attachment']);
662
-            $spreadsheet->getActiveSheet()->SetCellValue('C' . $this->filaDocumentoLegal, $doc['idDoc']);
669
+            $sheet->SetCellValue('A' . $this->filaDocumentoLegal, $doc['id_ajena_licitacion']);
670
+            $sheet->SetCellValue('B' . $this->filaDocumentoLegal, $doc['attachment']);
671
+            $sheet->SetCellValue('C' . $this->filaDocumentoLegal, $doc['idDoc']);
663 672
 
664 673
             $this->filaDocumentoLegal++;
665 674
         }

+ 22 - 153
application/models/Xlsexport_model.php Voir le fichier

@@ -19,7 +19,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
19 19
 class Xlsexport_model extends CI_Model
20 20
 {
21 21
 
22
-    // ------------------------------------------------------------------------
22
+    protected $fechaLog = "2022-02-25 08:08:51";
23 23
 
24 24
     public function __construct()
25 25
     {
@@ -115,7 +115,7 @@ class Xlsexport_model extends CI_Model
115 115
     public function getTablaByFechaLog($tabla)
116 116
     {
117 117
         $sql = "SELECT * FROM $tabla
118
-                WHERE fecha_creacion_log = '2022-02-24 14:38:36'";
118
+                WHERE fecha_creacion_log = '$this->fechaLog'";
119 119
         $result = $this->db->query($sql);
120 120
         $datos['datos'] = $result->result_array();
121 121
         $datos['num_rows'] = $result->num_rows();
@@ -138,7 +138,7 @@ class Xlsexport_model extends CI_Model
138 138
                     maestro_procurement_project_lot MP
139 139
                     JOIN maestro_procurement_project_lot_item MPI ON MP.id_compuesta = MPI.id_compuesta_padre
140 140
                 WHERE
141
-                    MPI.fecha_creacion_log = '2022-02-24 14:38:36'
141
+                    MPI.fecha_creacion_log = '$this->fechaLog'
142 142
                     GROUP BY
143 143
                     MP.id_compuesta";
144 144
         $result = $this->db->query($sql);
@@ -158,170 +158,39 @@ class Xlsexport_model extends CI_Model
158 158
         return $datos;
159 159
     }
160 160
 
161
-    public function getDatosByTablaAndLicitacion($tabla, $licitacionID)
162
-    {
163
-        $sql = "SELECT *
164
-                FROM
165
-                    $tabla
166
-                WHERE id_ajena_licitacion = $licitacionID";
167
-        $result = $this->db->query($sql);
168
-        $datos['datos'] = $result->result_array();
169
-        $datos['num_rows'] = $result->num_rows();
170
-        return $datos['datos'];
171
-    }
172
-    public function getTablaWithoutLicitacion($tabla)
161
+    public function getTenderingTermsCodes()
173 162
     {
174 163
         $sql = "SELECT
175
-                    *
164
+                    TP.*,
165
+                    RTP.nombre AS tipoTender, /*procedureCode*/
166
+                    RTPC.nombre AS contrato_sistema, /*urgencyCode*/
167
+                    RTPS.nombre AS submision, /*contractingSistemCode*/
168
+                    RTPU.nombre AS urgency /*urgencyCode*/
176 169
                 FROM
177
-                    $tabla t1";
178
-        $result = $this->db->query($sql);
179
-        $datos['datos'] = $result->result_array();
180
-        $datos['num_rows'] = $result->num_rows();
181
-        return $datos;
182
-    }
170
+                maestro_tendering_process TP
171
+                JOIN relacionada_tender_process RTP ON RTP.CODE = TP.procedureCode
172
+                JOIN relacionada_tender_process_contracting_code RTPC ON RTPC.CODE = TP.contractingSystemCode
173
+                JOIN relacionada_tender_process_submission RTPS ON RTPS.CODE = TP.submissionMethodCode
174
+                JOIN relacionada_tender_process_urgency_code RTPU ON RTPU.CODE = TP.urgencyCode
183 175
 
184
-    public function getDatosRelacionadosByTablaAndLicitacion($tabla, $tablaAjena, $idRelacionada, $idAjenaLicitacion)
185
-    {
186
-        $sql = "SELECT
187
-                    *
188
-                FROM
189
-                    $tabla
190
-                JOIN $tablaAjena TBAJ ON TBAJ.code = " . $tabla . "." . $idRelacionada . "
191
-                WHERE id_ajena_licitacion = $idAjenaLicitacion";
176
+                WHERE
177
+                    TP.fecha_creacion_log = '$this->fechaLog'";
192 178
         $result = $this->db->query($sql);
193 179
         $datos['datos'] = $result->result_array();
194 180
         $datos['num_rows'] = $result->num_rows();
195
-        return $datos['datos'];
181
+        return $datos;
196 182
     }
197 183
 
198
-    public function getDatosRelacionadasTablaWithoutLicitacion($tablaRelacion, $tabla, $txtIdAjena, $id = "t1.id")
184
+    public function getDatosRelacionadasTablaWithoutLicitacion($tabla, $tablaRelacion, $txtIdAjena, $id = "t1.id")
199 185
     {
200 186
         $sql = "SELECT
201
-                    *
187
+                    *,
188
+                    t2.nombre as code_desc
202 189
                 FROM
203 190
                     $tabla t1
204 191
                 JOIN
205
-                    $tablaRelacion t2 ON t2." . $txtIdAjena . " = t1.id";
206
-        $result = $this->db->query($sql);
207
-        $datos['datos'] = $result->result_array();
208
-        $datos['num_rows'] = $result->num_rows();
209
-        return $datos;
210
-    }
211
-
212
-    public function getTenderProcessRelacion()
213
-    {
214
-        $sql = "SELECT
215
-                    t2.nombre as procedureCode, t3.nombre as contractingSystemCode, t4.nombre as submissionMethodCode, t5.nombre as urgencyCode,
216
-                    t1.id_ajena_licitacion, t1.partPresentationCode, t1.maximumLotPresentationQuantity, t1.maximumTendererAwardedLotsQuantity, t1.lotsCombinationContractingAuthorityRights,
217
-                    t1.deadLineEndDate, t1.deadLineEndTime, t1.deadLineDescription, t1.auctionTerms, t1.documentAvailablePeriod_EndDate, t1.documentAvailablePeriod_EndTime
218
-                FROM
219
-                maestro_tendering_process t1
220
-                JOIN relacionada_tender_process t2 ON t2.code = t1.procedureCode
221
-                JOIN relacionada_tender_process_contracting_code t3 ON t3.code = t1.contractingSystemCode
222
-                JOIN relacionada_tender_process_submission t4 ON t4.code = t1.submissionMethodCode
223
-                JOIN relacionada_tender_process_urgency_code t5 ON t5.code = t1.urgencyCode";
224
-        $result = $this->db->query($sql);
225
-        $datos['datos'] = $result->result_array();
226
-        $datos['num_rows'] = $result->num_rows();
227
-        return $datos;
228
-    }
229
-
230
-    public function getValidNoticeInfoRelacion()
231
-    {
232
-        $sql = "SELECT
233
-                    t2.nombre as noticeTypeCode, t1.id_ajena_licitacion, t1.publicationMediaName
234
-                FROM
235
-                maestro_valid_notice_info t1
236
-                JOIN relacionada_valid_notice_info t2 ON t2.code = t1.noticeTypeCode";
237
-        $result = $this->db->query($sql);
238
-        $datos['datos'] = $result->result_array();
239
-        $datos['num_rows'] = $result->num_rows();
240
-        return $datos;
241
-    }
242
-
243
-    public function getTenderResult()
244
-    {
245
-        $sql = "SELECT
246
-                    t2.nombre as resultCode, t1.id_ajena_licitacion, t1.description, t1.awardDate, t1.receivedTenderQuantity, t1.lowerTenderAmount , t1.higherTenderAmount, t1.startDate,
247
-                    t1.smeawardedIndicator, t1.contract_id, t1.contract_issueDate, t1.partyIdentification, t1.partyName, t1.TaxExclusiveAmount, t1.PayableAmount
248
-                FROM
249
-                maestro_tender_result t1
250
-                JOIN relacionada_tender_result t2 ON t2.code = t1.resultCode";
251
-        $result = $this->db->query($sql);
252
-        $datos['datos'] = $result->result_array();
253
-        $datos['num_rows'] = $result->num_rows();
254
-        return $datos;
255
-    }
256
-
257
-    public function getTenderingTermsGarantia()
258
-    {
259
-        $sql = "SELECT
260
-                    t1.id_ajena_licitacion, t2.nombre as guaranteeTypeCode, t1.requiredCurriculaIndicator, t1.variantConstraintIndicator, t1.fundingProgramCode, t1.requiredFinancialGuarantee_Amount,
261
-                    t1.language, t1.allowedSubcontractTerms, t1.description, t1.personalSituation, t1.procurementLegislationDocumentReference
262
-                FROM
263
-                maestro_tendering_terms t1
264
-                JOIN relacionada_codigo_tipo_garantia t2 ON t2.code = t1.guaranteeTypeCode";
265
-        $result = $this->db->query($sql);
266
-        $datos['datos'] = $result->result_array();
267
-        $datos['num_rows'] = $result->num_rows();
268
-        return $datos;
269
-    }
270
-
271
-    public function getTenderingTermsCriteriosFinanciacion()
272
-    {
273
-        $sql = "SELECT
274
-        t2.id_ajena_licitacion,
275
-        t3.nombre AS evaluationCriteriaTypeCode,
276
-        t1.description
277
-    FROM
278
-        maestro_tendering_terms_financial_evaluation t1
279
-        JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
280
-        JOIN relacionada_tendering_terms_financial t3 ON t3.CODE = t1.evaluationCriteriaTypeCode";
281
-
282
-        $result = $this->db->query($sql);
283
-        $datos['datos'] = $result->result_array();
284
-        $datos['num_rows'] = $result->num_rows();
285
-        return $datos;
286
-    }
287
-
288
-    public function getTenderingTermsCriteriosTecnicos()
289
-    {
290
-        $sql = "SELECT
291
-                    t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
292
-                FROM
293
-                maestro_tendering_terms_qualification_request t1
294
-                JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
295
-                JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
296
-
297
-        $result = $this->db->query($sql);
298
-        $datos['datos'] = $result->result_array();
299
-        $datos['num_rows'] = $result->num_rows();
300
-        return $datos;
301
-    }
302
-
303
-    public function getTenderingTermsRequisitos()
304
-    {
305
-        $sql = "SELECT
306
-                    t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
307
-                FROM
308
-                maestro_tendering_terms_qualification_request t1
309
-                JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
310
-                JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
311
-
312
-        $result = $this->db->query($sql);
313
-        $datos['datos'] = $result->result_array();
314
-        $datos['num_rows'] = $result->num_rows();
315
-        return $datos;
316
-    }
317
-
318
-    public function getProjectLotActivityByProjectLot($projectLotId)
319
-    {
320
-        $sql = "SELECT
321
-                    *
322
-                FROM
323
-                    maestro_procurement_project_lot_item
324
-                WHERE id_compuesta_padre = '$projectLotId'";
192
+                    $tablaRelacion t2 ON t2." . $txtIdAjena . " = t1." . $id . "
193
+                WHERE t1.fecha_creacion_log = '$this->fechaLog'";
325 194
         $result = $this->db->query($sql);
326 195
         $datos['datos'] = $result->result_array();
327 196
         $datos['num_rows'] = $result->num_rows();