src/Entity/ValoracionesRelojesSinStock.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JMS\Serializer\Annotation as JMS;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @ORM\Entity(repositoryClass="App\Repository\ValoracionesRelojesSinStockRepository")
  12.  * @ORM\Table(name="valoraciones_relojes_sin_stock")
  13.  * @Vich\Uploadable
  14.  */
  15. class ValoracionesRelojesSinStock extends ValoracionesRelojes
  16. {
  17.     /**
  18.      * @ORM\Column(type="string", nullable=true, name="reloj_idperseo")
  19.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  20.      */
  21.     protected $relojIDPerseo;
  22.     /**
  23.      * @ORM\Column(type="string", nullable=true, name="reloj_foto")
  24.      * @JMS\Groups({
  25.      *     "api_v1_valoracion_serialize",
  26.      *     "api_v1_valoracionrelojcompra_deserialize"
  27.      * })
  28.      */
  29.     protected $relojFoto;
  30.     /**
  31.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="relojFoto")
  32.      * @var File
  33.      */
  34.     protected $relojFotoFile;
  35.     /**
  36.      * @ORM\Column(type="string", nullable=true, name="reloj_modelo1")
  37.      * @JMS\Groups({
  38.      *      "api_v1_valoracion_serialize",
  39.      *      "api_v1_valoracionrelojcompra_deserialize"
  40.      *  })
  41.      */
  42.     protected $relojModelo1;
  43.     /**
  44.      * @ORM\Column(type="string", nullable=true, name="reloj_ref1")
  45.      * @JMS\Groups({
  46.      *      "api_v1_valoracion_serialize",
  47.      *      "api_v1_valoracionrelojcompra_deserialize"
  48.      *  })
  49.      */
  50.     protected $relojRef1;
  51.     /**
  52.      * @ORM\Column(
  53.      *     type="integer",
  54.      *     length=4,
  55.      *     nullable=true,
  56.      *     name="reloj_fecha",
  57.      *     options={"comment":"Fecha comprado por primera vez, solo el año"}
  58.      * )
  59.      * @JMS\Groups({
  60.      *      "api_v1_valoracion_serialize",
  61.      *      "api_v1_valoracionrelojcompra_deserialize"
  62.      *  })
  63.      */
  64.     protected $relojFecha;
  65.     /**
  66.      * @ORM\Column(type="boolean", nullable=false, name="reloj_caja", options={"default":0})
  67.      * @JMS\Groups({
  68.      *      "api_v1_valoracion_serialize",
  69.      *      "api_v1_valoracionrelojcompra_deserialize"
  70.      *  })
  71.      */
  72.     protected $relojCaja;
  73.     /**
  74.      * @ORM\Column(type="boolean", nullable=false, name="reloj_papeles", options={"default":0})
  75.      * @JMS\Groups({
  76.      *      "api_v1_valoracion_serialize",
  77.      *      "api_v1_valoracionrelojcompra_deserialize"
  78.      *  })
  79.      */
  80.     protected $relojPapeles;
  81.     /**
  82.      * @ORM\Column(type="float", nullable=true, name="itp", precision=2)
  83.      * @JMS\Groups({
  84.      *      "api_v1_valoracion_serialize",
  85.      *      "api_v1_valoracionrelojcompra_deserialize"
  86.      *  })
  87.      */
  88.     protected $ITP;
  89.     /**
  90.      * @ORM\Column(
  91.      *     type="float",
  92.      *     nullable=true,
  93.      *     options={
  94.      *         "default":"0.0",
  95.      *         "comment":"Comsión CRONO esta en gastos , pero se duplica fuera para tener mejor acceso a ella"
  96.      *     }
  97.      * )
  98.      * @JMS\Groups({
  99.      *      "api_v1_valoracion_serialize",
  100.      *      "api_v1_valoracionrelojcompra_deserialize"
  101.      *  })
  102.      */
  103.     protected $comision;
  104.     /**
  105.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_coste")
  106.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  107.      */
  108.     protected $precioCoste;
  109.     /**
  110.      * @ORM\Column(
  111.      *     type="float",
  112.      *     nullable=true,
  113.      *     name="precio_coste_total",
  114.      *     precision=2,
  115.      *     options={"comment":"Autocalculado, cada vez que se añade/modifique un coste ó cambie su coste"}
  116.      * )
  117.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  118.      */
  119.     protected $precioCosteTotal;
  120.     /**
  121.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_min_venta")
  122.      * @JMS\Groups({
  123.      *      "api_v1_valoracion_serialize",
  124.      *      "api_v1_valoracionrelojcompra_deserialize"
  125.      *  })
  126.      */
  127.     protected $precioMinVenta;
  128.     /**
  129.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_promocion")
  130.      * @JMS\Groups({
  131.      *      "api_v1_valoracion_serialize",
  132.      *      "api_v1_valoracionrelojcompra_deserialize"
  133.      *  })
  134.      */
  135.     protected $precioPromocion;
  136.     /**
  137.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_oferta")
  138.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  139.      */
  140.     protected $precioOferta;
  141.     /**
  142.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_referencia")
  143.      * @JMS\Groups({
  144.      *      "api_v1_valoracion_serialize",
  145.      *      "api_v1_valoracionrelojcompra_deserialize"
  146.      *  })
  147.      */
  148.     protected $precioReferencia;
  149.     /**
  150.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_pagar")
  151.      * @JMS\Groups({
  152.      *      "api_v1_valoracion_serialize",
  153.      *      "api_v1_valoracionrelojcompra_deserialize"
  154.      *  })
  155.      */
  156.     protected $precioPagar;
  157.     /**
  158.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_minimo")
  159.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  160.      */
  161.     protected $margenMinimo;
  162.     /**
  163.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_deseado")
  164.      * @JMS\Groups({
  165.      *      "api_v1_valoracion_serialize",
  166.      *      "api_v1_valoracionrelojcompra_deserialize"
  167.      *  })
  168.      */
  169.     protected $margenDeseado;
  170.     /**
  171.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_promocion")
  172.      * @JMS\Groups({"api_v1_valoracion_serialize"})
  173.      */
  174.     protected $margenPromocion;
  175.     /**
  176.      * @ORM\Column(type="float", nullable=true, precision=0, name="costes_total")
  177.      * @JMS\Groups({
  178.      *      "api_v1_valoracion_serialize",
  179.      *      "api_v1_valoracionrelojcompra_deserialize"
  180.      *  })
  181.      */
  182.     protected $costesTotal;
  183.     /**
  184.      * @ORM\OneToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="valoracionReloj")
  185.      * @ORM\JoinColumn(name="reloj_inventario_id", referencedColumnName="id", unique=true)
  186.      */
  187.     private $relojInventario;
  188.     /**
  189.      * @ORM\OneToOne(targetEntity=\App\Entity\DetalleCompra::class, mappedBy="valoracionReloj")
  190.      */
  191.     private $detalleCompra;
  192.     /**
  193.      * @ORM\OneToMany(targetEntity="App\Entity\Referencia", mappedBy="valoracionReloj", cascade={"persist"})
  194.      */
  195.     protected $referencias;
  196.     /**
  197.      * @ORM\OneToMany(targetEntity="App\Entity\Coste", mappedBy="valoracionesRelojes", cascade={"persist"})
  198.      */
  199.     protected $costes;
  200.     /**
  201.      * @ORM\ManyToOne(targetEntity="App\Entity\Marca", inversedBy="valoracionesRelojes")
  202.      * @ORM\JoinColumn(name="reloj_marca_id", referencedColumnName="id")
  203.      * @Assert\Valid()
  204.      * @JMS\Type(Marca::class)
  205.      * @JMS\Groups({
  206.      *      "api_v1_valoracion_serialize",
  207.      *      "api_v1_valoracionrelojcompra_deserialize"
  208.      *  })
  209.      */
  210.     protected $relojMarca;
  211.     /**
  212.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoAspecto", inversedBy="valoracionesRelojes")
  213.      * @ORM\JoinColumn(name="reloj_aspecto_id", referencedColumnName="id")
  214.      * @JMS\Type(EstadoAspecto::class)
  215.      * @JMS\Groups({
  216.      *      "api_v1_valoracion_serialize",
  217.      *      "api_v1_valoracionrelojcompra_deserialize"
  218.      *  })
  219.      */
  220.     protected $relojAspecto;
  221.     /**
  222.      * @ORM\ManyToOne(targetEntity="App\Entity\Valoracion", inversedBy="valoracionesRelojesSinStocks")
  223.      * @ORM\JoinColumn(name="valoracion_id", referencedColumnName="id")
  224.      * @JMS\Groups({
  225.      *      "api_v1_valoracionrelojcompra_deserialize"
  226.      *  })
  227.      */
  228.     protected $valoracion;
  229.     /**
  230.      * @ORM\ManyToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="relojesDerivadosValoracion")
  231.      * @ORM\JoinColumn(name="reloj_base_id", referencedColumnName="id")
  232.      * @JMS\Groups({
  233.      *      "api_v1_valoracion_serialize",
  234.      *      "api_v1_valoracionrelojcompra_deserialize"
  235.      *  })
  236.      */
  237.     private $relojBase;
  238.     public function __construct()
  239.     {
  240.         $this->relojCaja false;
  241.         $this->relojPapeles false;
  242.         $this->costes = new ArrayCollection();
  243.         $this->referencias = new ArrayCollection();
  244.     }
  245.     public function getRelojFotoFile(): ?File
  246.     {
  247.         return $this->relojFotoFile;
  248.     }
  249.     public function setRelojFotoFile(?File $relojFotoFile): self
  250.     {
  251.         $this->relojFotoFile $relojFotoFile;
  252.         if ($relojFotoFile) {
  253.             // if 'updatedAt' is not defined in your entity, use another property
  254.             $this->setUpdatedAt(new \DateTime('now'));
  255.         }
  256.         return $this;
  257.     }
  258.     public function getITP(): ?float
  259.     {
  260.         return $this->ITP;
  261.     }
  262.     public function setITP(?float $ITP): self
  263.     {
  264.         $this->ITP $ITP;
  265.         return $this;
  266.     }
  267.     public function getComision(): ?float
  268.     {
  269.         return $this->comision;
  270.     }
  271.     public function setComision(?float $comision): self
  272.     {
  273.         $this->comision $comision;
  274.         return $this;
  275.     }
  276.     public function getPrecioCoste(): ?float
  277.     {
  278.         return $this->precioCoste;
  279.     }
  280.     public function setPrecioCoste(?float $precioCoste): self
  281.     {
  282.         $this->precioCoste $precioCoste;
  283.         return $this;
  284.     }
  285.     public function getPrecioCosteTotal(): ?float
  286.     {
  287.         return $this->precioCosteTotal;
  288.     }
  289.     public function setPrecioCosteTotal(?float $precioCosteTotal): self
  290.     {
  291.         $this->precioCosteTotal $precioCosteTotal;
  292.         return $this;
  293.     }
  294.     public function getPrecioMinVenta(): ?float
  295.     {
  296.         return $this->precioMinVenta;
  297.     }
  298.     public function setPrecioMinVenta(?float $precioMinVenta): self
  299.     {
  300.         $this->precioMinVenta $precioMinVenta;
  301.         return $this;
  302.     }
  303.     public function getPrecioPromocion(): ?float
  304.     {
  305.         return $this->precioPromocion;
  306.     }
  307.     public function setPrecioPromocion(?float $precioPromocion): self
  308.     {
  309.         $this->precioPromocion $precioPromocion;
  310.         return $this;
  311.     }
  312.     public function getPrecioOferta(): ?float
  313.     {
  314.         return $this->precioOferta;
  315.     }
  316.     public function setPrecioOferta(?float $precioOferta): self
  317.     {
  318.         $this->precioOferta $precioOferta;
  319.         return $this;
  320.     }
  321.     public function getPrecioReferencia(): ?float
  322.     {
  323.         return $this->precioReferencia;
  324.     }
  325.     public function setPrecioReferencia(?float $precioReferencia): self
  326.     {
  327.         $this->precioReferencia $precioReferencia;
  328.         return $this;
  329.     }
  330.     public function getPrecioPagar(): ?float
  331.     {
  332.         return $this->precioPagar;
  333.     }
  334.     public function setPrecioPagar(?float $precioPagar): self
  335.     {
  336.         $this->precioPagar $precioPagar;
  337.         return $this;
  338.     }
  339.     public function getMargenMinimo(): ?float
  340.     {
  341.         return $this->margenMinimo;
  342.     }
  343.     public function setMargenMinimo(?float $margenMinimo): self
  344.     {
  345.         $this->margenMinimo $margenMinimo;
  346.         return $this;
  347.     }
  348.     public function getMargenDeseado(): ?float
  349.     {
  350.         return $this->margenDeseado;
  351.     }
  352.     public function setMargenDeseado(?float $margenDeseado): self
  353.     {
  354.         $this->margenDeseado $margenDeseado;
  355.         return $this;
  356.     }
  357.     public function getMargenPromocion(): ?float
  358.     {
  359.         return $this->margenPromocion;
  360.     }
  361.     public function setMargenPromocion(?float $margenPromocion): self
  362.     {
  363.         $this->margenPromocion $margenPromocion;
  364.         return $this;
  365.     }
  366.     public function getIsPrecioChrono24(): ?bool
  367.     {
  368.         return $this->isPrecioChrono24;
  369.     }
  370.     public function setIsPrecioChrono24(?bool $isPrecioChrono24): self
  371.     {
  372.         $this->isPrecioChrono24 $isPrecioChrono24;
  373.         return $this;
  374.     }
  375.     public function getRelojIDPerseo(): ?string
  376.     {
  377.         return $this->relojIDPerseo;
  378.     }
  379.     public function setRelojIDPerseo(?string $relojIDPerseo): self
  380.     {
  381.         $this->relojIDPerseo $relojIDPerseo;
  382.         return $this;
  383.     }
  384.     public function getRelojFoto(): ?string
  385.     {
  386.         return $this->relojFoto;
  387.     }
  388.     public function setRelojFoto(?string $relojFoto): self
  389.     {
  390.         $this->relojFoto $relojFoto;
  391.         return $this;
  392.     }
  393.     public function getRelojModelo1(): ?string
  394.     {
  395.         return $this->relojModelo1;
  396.     }
  397.     public function setRelojModelo1(?string $relojModelo): self
  398.     {
  399.         $this->relojModelo1 $relojModelo;
  400.         return $this;
  401.     }
  402.     public function getRelojRef1(): ?string
  403.     {
  404.         return $this->relojRef1;
  405.     }
  406.     public function setRelojRef1(?string $relojRef): self
  407.     {
  408.         $this->relojRef1 $relojRef;
  409.         return $this;
  410.     }
  411.     public function getRelojFecha(): ?int
  412.     {
  413.         return $this->relojFecha;
  414.     }
  415.     public function setRelojFecha(?int $relojFecha): self
  416.     {
  417.         $this->relojFecha $relojFecha;
  418.         return $this;
  419.     }
  420.     public function getRelojCaja(): ?bool
  421.     {
  422.         return $this->relojCaja;
  423.     }
  424.     public function setRelojCaja(bool $relojCaja): self
  425.     {
  426.         $this->relojCaja $relojCaja;
  427.         return $this;
  428.     }
  429.     public function getRelojPapeles(): ?bool
  430.     {
  431.         return $this->relojPapeles;
  432.     }
  433.     public function setRelojPapeles(bool $relojPapeles): self
  434.     {
  435.         $this->relojPapeles $relojPapeles;
  436.         return $this;
  437.     }
  438.     public function getRelojMarca(): ?Marca
  439.     {
  440.         return $this->relojMarca;
  441.     }
  442.     public function setRelojMarca(?Marca $relojMarca): self
  443.     {
  444.         $this->relojMarca $relojMarca;
  445.         return $this;
  446.     }
  447.     public function getRelojAspecto(): ?EstadoAspecto
  448.     {
  449.         return $this->relojAspecto;
  450.     }
  451.     public function setRelojAspecto(?EstadoAspecto $relojAspecto): self
  452.     {
  453.         $this->relojAspecto $relojAspecto;
  454.         return $this;
  455.     }
  456.     public function getValoracion(): ?Valoracion
  457.     {
  458.         return $this->valoracion;
  459.     }
  460.     public function setValoracion(?Valoracion $valoracion): self
  461.     {
  462.         $this->valoracion $valoracion;
  463.         return $this;
  464.     }
  465.     /**
  466.      * @return Collection|Coste[]
  467.      */
  468.     public function getCostes(): Collection
  469.     {
  470.         return $this->costes;
  471.     }
  472.     public function addCoste(Coste $coste): self
  473.     {
  474.         if (!$this->costes->contains($coste)) {
  475.             $this->costes[] = $coste;
  476.             $coste->setValoracionesRelojes($this);
  477.         }
  478.         return $this;
  479.     }
  480.     public function removeCoste(Coste $coste): self
  481.     {
  482.         if ($this->costes->removeElement($coste)) {
  483.             // set the owning side to null (unless already changed)
  484.             if ($coste->getValoracionesRelojes() === $this) {
  485.                 //$coste->setValoracionesRelojes(null);
  486.                 $coste->setDeletedAt(new DateTime('now'));
  487.             }
  488.         }
  489.         return $this;
  490.     }
  491.     public function getCostesTotal(): ?float
  492.     {
  493.         return $this->costesTotal;
  494.     }
  495.     public function setCostesTotal(?float $costesTotal): self
  496.     {
  497.         $this->costesTotal $costesTotal;
  498.         return $this;
  499.     }
  500.     /**
  501.      * @return Collection|Referencia[]
  502.      */
  503.     public function getReferencias(): Collection
  504.     {
  505.         return $this->referencias;
  506.     }
  507.     public function addReferencia(Referencia $referencia): self
  508.     {
  509.         if (!$this->referencias->contains($referencia)) {
  510.             $this->referencias[] = $referencia;
  511.             $referencia->setValoracionReloj($this);
  512.         }
  513.         return $this;
  514.     }
  515.     public function removeReferencia(Referencia $referencia): self
  516.     {
  517.         if ($this->referencias->removeElement($referencia)) {
  518.             // set the owning side to null (unless already changed)
  519.             if ($referencia->getValoracionReloj() === $this) {
  520.                 //$referencia->setValoracionReloj(null);
  521.                 $referencia->setDeletedAt(new DateTime('now'));
  522.             }
  523.         }
  524.         return $this;
  525.     }
  526.     public function isRelojCaja(): ?bool
  527.     {
  528.         return $this->relojCaja;
  529.     }
  530.     public function isRelojPapeles(): ?bool
  531.     {
  532.         return $this->relojPapeles;
  533.     }
  534.     public function getRelojInventario(): ?Reloj
  535.     {
  536.         return $this->relojInventario;
  537.     }
  538.     public function setRelojInventario(?Reloj $relojInventario): static
  539.     {
  540.         $this->relojInventario $relojInventario;
  541.         return $this;
  542.     }
  543.     public function getDetalleCompra(): ?DetalleCompra
  544.     {
  545.         return $this->detalleCompra;
  546.     }
  547.     public function setDetalleCompra(?DetalleCompra $detalleCompra): static
  548.     {
  549.         // unset the owning side of the relation if necessary
  550.         if ($detalleCompra === null && $this->detalleCompra !== null) {
  551.             $this->detalleCompra->setValoracionReloj(null);
  552.         }
  553.         // set the owning side of the relation if necessary
  554.         if ($detalleCompra !== null && $detalleCompra->getValoracionReloj() !== $this) {
  555.             $detalleCompra->setValoracionReloj($this);
  556.         }
  557.         $this->detalleCompra $detalleCompra;
  558.         return $this;
  559.     }
  560.     public function getRelojBase(): ?Reloj
  561.     {
  562.         return $this->relojBase;
  563.     }
  564.     public function setRelojBase(?Reloj $relojBase): static
  565.     {
  566.         $this->relojBase $relojBase;
  567.         return $this;
  568.     }
  569. }