src/Entity/Movimientos/PrestamoHerramienta.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Movimientos;
  3. use App\Repository\Movimientos\PrestamoHerramientaRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\RRHH\Empleado;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=PrestamoHerramientaRepository::class)
  10.  */
  11. class PrestamoHerramienta extends MovimientoStock
  12. {
  13.     /**
  14.      * @ORM\Column(type="date", name="fecha_devolucion", nullable=true)
  15.      */
  16.     private $fechaDevolucion;
  17.     /**
  18.      * @ORM\Column(name="devolucion_procesada", type="boolean", nullable=true)
  19.      */
  20.     private $devolucionProcesada false;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Empleado::class)
  23.      * @ORM\JoinColumn(name="id_empleado", referencedColumnName="id", nullable=true)
  24.      * @Assert\NotNull(message="El campo es requerido")
  25.      */
  26.     private $responsable;
  27.     public function getDescripcion()
  28.     {
  29.         return "Prestamo Herramientas";
  30.     }
  31.     public function setIsDevuelta($flag$fecha)
  32.     {
  33.         $this->devolucionProcesada = (bool)$flag;
  34.         $this->fechaDevolucion $fecha;
  35.         return $this;
  36.     }
  37.     public function getIsDevuelta()
  38.     {
  39.         return $this->devolucionProcesada;
  40.     }
  41.     public function getFinalizable()
  42.     {
  43.         return true;
  44.     }
  45.     public function getDetalle()
  46.     {
  47.         $detalle = array(
  48.                             "Prestamo Herramientas",
  49.                             "NÂș: " str_pad($this->getNumero(), 6'0'STR_PAD_LEFT),
  50.                             "Fecha " $this->getFecha()->format('d/m/Y'),                            
  51.                             "Responsable: " $this->responsable,
  52.                             "Deposito: " $this->getDeposito()
  53.                         );
  54.         return $detalle;
  55.     }
  56.     public static function isToolArticle()
  57.     {
  58.         return [true];
  59.     }
  60.     public function getInstance()
  61.     {
  62.         return "ph";
  63.     }
  64.     public function getResponsable(): ?Empleado
  65.     {
  66.         return $this->responsable;
  67.     }
  68.     public function setResponsable(?Empleado $responsable): self
  69.     {
  70.         $this->responsable $responsable;
  71.         return $this;
  72.     }
  73.     public function getFechaDevolucion(): ?\DateTimeInterface
  74.     {
  75.         return $this->fechaDevolucion;
  76.     }
  77.     public function setFechaDevolucion(?\DateTimeInterface $fechaDevolucion): self
  78.     {
  79.         $this->fechaDevolucion $fechaDevolucion;
  80.         return $this;
  81.     }
  82.     public function isDevolucionProcesada(): ?bool
  83.     {
  84.         return $this->devolucionProcesada;
  85.     }
  86.     public function setDevolucionProcesada(?bool $devolucionProcesada): self
  87.     {
  88.         $this->devolucionProcesada $devolucionProcesada;
  89.         return $this;
  90.     }
  91. }