src/Entity/Movimientos/Transferencia.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Movimientos;
  3. use App\Repository\Movimientos\TransferenciaRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Almacen\Deposito;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TransferenciaRepository::class)
  9.  */
  10. class Transferencia extends MovimientoStock
  11. {
  12.     /**
  13.      * @Assert\IsFalse(message="No puede realizar una transferencia entre depositos iguales.")
  14.      */
  15.     public function isSameDeposito()
  16.     {
  17.         return $this->getDestino() === $this->getDeposito();
  18.     }
  19.     public function getDescripcion()
  20.     {
  21.         return "Transferencia";
  22.     }
  23.     public function getFinalizable()
  24.     {
  25.         return true;
  26.     }
  27.     public static function isToolArticle()
  28.     {
  29.         return [false];
  30.     }
  31.     public function getInstance()
  32.     {
  33.         return "tr";
  34.     }
  35.     public function getDetalle()
  36.     {
  37.         $detalle = array(
  38.                             "Transferencia Stock",
  39.                             "NÂș: " str_pad($this->getNumero(), 6'0'STR_PAD_LEFT),
  40.                             "Fecha " $this->getFecha()->format('d/m/Y'),                            
  41.                             "Origen: " $this->getDeposito(),
  42.                             "Destino: " $this->getDestino()
  43.                         );
  44.         return $detalle;
  45.     }
  46. }