Commit 0f9c579895727646c29322c68c85d1a308c4ceab

Authored by Wilmer
1 parent 23e6829c78
Exists in master

validado el año en el reconicmiento de escala para que empiece a partir del año …

…del ultimo ascenso obtenido
src/AppBundle/Controller/AscensoController.php
... ... @@ -546,24 +546,26 @@ class AscensoController extends Controller
546 546  
547 547 $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array(
548 548 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
549   - 'idEstatus' => 1
  549 + 'idEstatus' => 1
550 550 ));
551 551  
552 552 $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
553   -
  553 + $ano = 2003;
554 554 if($ascenso == NULL){
555 555 $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findAll();
556 556 }else{
557 557 $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($ascenso->getIdEscalafones()->getId());
  558 + $ano = end($escala)->getFechaEscala()->format('Y');;
558 559 }
559 560  
560 561  
  562 +
561 563 $form = $this->createFormBuilder()
562 564  
563 565 ->add('fechaAscenso', BirthdayType::class, array(
564 566 'widget' => 'choice',
565 567 'label' => 'Fecha de Ascenso',
566   - 'years' => range(2003, date("Y")),
  568 + 'years' => range($ano, date("Y")),
567 569 'placeholder' => array(
568 570 'year' => 'Año', 'month' => 'Mes', 'day' => 'Día',
569 571 ),
... ...