src/Entity/Movimientos/AjusteStock.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Movimientos;
  3. use App\Repository\Movimientos\AjusteStockRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=AjusteStockRepository::class)
  7.  */
  8. class AjusteStock extends MovimientoStock
  9. {
  10.     /**
  11.      * @ORM\Column(type="string", length=256)
  12.      */
  13.     private $tipo;
  14.     /**
  15.      * @ORM\Column(type="string", length=256, nullable=true)
  16.      */
  17.     private $concepto;
  18.     public function getDescripcion()
  19.     {
  20.         return "Ajuste Stock (" . ($this->tipo == 'IN' ? 'INGRESO' : 'EGRESO') . ")";
  21.     }
  22.     public function getFinalizable()
  23.     {
  24.         return true;
  25.     }
  26.     public function getDetalle()
  27.     {
  28.         $detalle = array(
  29.                             "Ajuste Stock",
  30.                             "NÂș: " . str_pad($this->getNumero(), 6, '0', STR_PAD_LEFT),
  31.                             "Fecha: " . $this->getFecha()->format('d/m/Y'),                            
  32.                             "Tipo Ajuste: " .($this->tipo == 'IN' ? 'INGRESO' : 'EGRESO'),
  33.                             'Concepto: ' . $this->getConcepto(),
  34.                             "Deposito: " . $this->getDeposito()
  35.                         );
  36.         return $detalle;
  37.     }
  38.     public static function isToolArticle()
  39.     {
  40.         return [true, false];
  41.     }
  42.     public function getInstance()
  43.     {
  44.         return "as";
  45.     }
  46.     public function getTipo(): ?string
  47.     {
  48.         return $this->tipo;
  49.     }
  50.     public function setTipo(string $tipo): self
  51.     {
  52.         $this->tipo = $tipo;
  53.         return $this;
  54.     }
  55.     public function getConcepto(): ?string
  56.     {
  57.         return $this->concepto;
  58.     }
  59.     public function setConcepto(?string $concepto): self
  60.     {
  61.         $this->concepto = $concepto;
  62.         return $this;
  63.     }
  64. }