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({
  139.      *     "api_v1_valoracion_serialize",
  140.      *     "api_v1_valoracionrelojcompra_deserialize"
  141.      * })
  142.      */
  143.     protected $precioOferta;
  144.     /**
  145.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_referencia")
  146.      * @JMS\Groups({
  147.      *      "api_v1_valoracion_serialize",
  148.      *      "api_v1_valoracionrelojcompra_deserialize"
  149.      *  })
  150.      */
  151.     protected $precioReferencia;
  152.     /**
  153.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_pagar")
  154.      * @JMS\Groups({
  155.      *      "api_v1_valoracion_serialize",
  156.      *      "api_v1_valoracionrelojcompra_deserialize"
  157.      *  })
  158.      */
  159.     protected $precioPagar;
  160.     /**
  161.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_minimo")
  162.      * @JMS\Groups({
  163.      *     "api_v1_valoracion_serialize",
  164.      *     "api_v1_valoracionrelojcompra_deserialize"
  165.      * })
  166.      */
  167.     protected $margenMinimo;
  168.     /**
  169.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_deseado")
  170.      * @JMS\Groups({
  171.      *      "api_v1_valoracion_serialize",
  172.      *      "api_v1_valoracionrelojcompra_deserialize"
  173.      *  })
  174.      */
  175.     protected $margenDeseado;
  176.     /**
  177.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_promocion")
  178.      * @JMS\Groups({
  179.      *     "api_v1_valoracion_serialize",
  180.      *     "api_v1_valoracionrelojcompra_deserialize"
  181.      * })
  182.      */
  183.     protected $margenPromocion;
  184.     /**
  185.      * @ORM\Column(type="float", nullable=true, precision=0, name="costes_total")
  186.      * @JMS\Groups({
  187.      *      "api_v1_valoracion_serialize",
  188.      *      "api_v1_valoracionrelojcompra_deserialize"
  189.      *  })
  190.      */
  191.     protected $costesTotal;
  192.     /**
  193.      * @ORM\OneToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="valoracionReloj")
  194.      * @ORM\JoinColumn(name="reloj_inventario_id", referencedColumnName="id", unique=true)
  195.      */
  196.     private $relojInventario;
  197.     /**
  198.      * @ORM\OneToOne(targetEntity=\App\Entity\DetalleCompra::class, mappedBy="valoracionReloj")
  199.      */
  200.     private $detalleCompra;
  201.     /**
  202.      * @ORM\OneToMany(targetEntity="App\Entity\Referencia", mappedBy="valoracionReloj", cascade={"persist"})
  203.      */
  204.     protected $referencias;
  205.     /**
  206.      * @ORM\OneToMany(targetEntity="App\Entity\Coste", mappedBy="valoracionesRelojes", cascade={"persist"})
  207.      */
  208.     protected $costes;
  209.     /**
  210.      * @ORM\ManyToOne(targetEntity="App\Entity\Marca", inversedBy="valoracionesRelojes")
  211.      * @ORM\JoinColumn(name="reloj_marca_id", referencedColumnName="id")
  212.      * @Assert\Valid()
  213.      * @JMS\Type(Marca::class)
  214.      * @JMS\Groups({
  215.      *      "api_v1_valoracion_serialize",
  216.      *      "api_v1_valoracionrelojcompra_deserialize"
  217.      *  })
  218.      */
  219.     protected $relojMarca;
  220.     /**
  221.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoAspecto", inversedBy="valoracionesRelojes")
  222.      * @ORM\JoinColumn(name="reloj_aspecto_id", referencedColumnName="id")
  223.      * @JMS\Type(EstadoAspecto::class)
  224.      * @JMS\Groups({
  225.      *      "api_v1_valoracion_serialize",
  226.      *      "api_v1_valoracionrelojcompra_deserialize"
  227.      *  })
  228.      */
  229.     protected $relojAspecto;
  230.     /**
  231.      * @ORM\ManyToOne(targetEntity="App\Entity\Valoracion", inversedBy="valoracionesRelojesSinStocks")
  232.      * @ORM\JoinColumn(name="valoracion_id", referencedColumnName="id")
  233.      * @JMS\Groups({
  234.      *      "api_v1_valoracionrelojcompra_deserialize"
  235.      *  })
  236.      */
  237.     protected $valoracion;
  238.     /**
  239.      * @ORM\ManyToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="relojesDerivadosValoracion")
  240.      * @ORM\JoinColumn(name="reloj_base_id", referencedColumnName="id")
  241.      * @JMS\Groups({
  242.      *      "api_v1_valoracion_serialize",
  243.      *      "api_v1_valoracionrelojcompra_deserialize"
  244.      *  })
  245.      */
  246.     private $relojBase;
  247.     public function __construct()
  248.     {
  249.         $this->relojCaja false;
  250.         $this->relojPapeles false;
  251.         $this->costes = new ArrayCollection();
  252.         $this->referencias = new ArrayCollection();
  253.     }
  254.     public function getRelojFotoFile(): ?File
  255.     {
  256.         return $this->relojFotoFile;
  257.     }
  258.     public function setRelojFotoFile(?File $relojFotoFile): self
  259.     {
  260.         $this->relojFotoFile $relojFotoFile;
  261.         if ($relojFotoFile) {
  262.             // if 'updatedAt' is not defined in your entity, use another property
  263.             $this->setUpdatedAt(new \DateTime('now'));
  264.         }
  265.         return $this;
  266.     }
  267.     public function getITP(): ?float
  268.     {
  269.         return $this->ITP;
  270.     }
  271.     public function setITP(?float $ITP): self
  272.     {
  273.         $this->ITP $ITP;
  274.         return $this;
  275.     }
  276.     public function getComision(): ?float
  277.     {
  278.         return $this->comision;
  279.     }
  280.     public function setComision(?float $comision): self
  281.     {
  282.         $this->comision $comision;
  283.         return $this;
  284.     }
  285.     public function getPrecioCoste(): ?float
  286.     {
  287.         return $this->precioCoste;
  288.     }
  289.     public function setPrecioCoste(?float $precioCoste): self
  290.     {
  291.         $this->precioCoste $precioCoste;
  292.         return $this;
  293.     }
  294.     public function getPrecioCosteTotal(): ?float
  295.     {
  296.         return $this->precioCosteTotal;
  297.     }
  298.     public function setPrecioCosteTotal(?float $precioCosteTotal): self
  299.     {
  300.         $this->precioCosteTotal $precioCosteTotal;
  301.         return $this;
  302.     }
  303.     public function getPrecioMinVenta(): ?float
  304.     {
  305.         return $this->precioMinVenta;
  306.     }
  307.     public function setPrecioMinVenta(?float $precioMinVenta): self
  308.     {
  309.         $this->precioMinVenta $precioMinVenta;
  310.         return $this;
  311.     }
  312.     public function getPrecioPromocion(): ?float
  313.     {
  314.         return $this->precioPromocion;
  315.     }
  316.     public function setPrecioPromocion(?float $precioPromocion): self
  317.     {
  318.         $this->precioPromocion $precioPromocion;
  319.         return $this;
  320.     }
  321.     public function getPrecioOferta(): ?float
  322.     {
  323.         return $this->precioOferta;
  324.     }
  325.     public function setPrecioOferta(?float $precioOferta): self
  326.     {
  327.         $this->precioOferta $precioOferta;
  328.         return $this;
  329.     }
  330.     public function getPrecioReferencia(): ?float
  331.     {
  332.         return $this->precioReferencia;
  333.     }
  334.     public function setPrecioReferencia(?float $precioReferencia): self
  335.     {
  336.         $this->precioReferencia $precioReferencia;
  337.         return $this;
  338.     }
  339.     public function getPrecioPagar(): ?float
  340.     {
  341.         return $this->precioPagar;
  342.     }
  343.     public function setPrecioPagar(?float $precioPagar): self
  344.     {
  345.         $this->precioPagar $precioPagar;
  346.         return $this;
  347.     }
  348.     public function getMargenMinimo(): ?float
  349.     {
  350.         return $this->margenMinimo;
  351.     }
  352.     public function setMargenMinimo(?float $margenMinimo): self
  353.     {
  354.         $this->margenMinimo $margenMinimo;
  355.         return $this;
  356.     }
  357.     public function getMargenDeseado(): ?float
  358.     {
  359.         return $this->margenDeseado;
  360.     }
  361.     public function setMargenDeseado(?float $margenDeseado): self
  362.     {
  363.         $this->margenDeseado $margenDeseado;
  364.         return $this;
  365.     }
  366.     public function getMargenPromocion(): ?float
  367.     {
  368.         return $this->margenPromocion;
  369.     }
  370.     public function setMargenPromocion(?float $margenPromocion): self
  371.     {
  372.         $this->margenPromocion $margenPromocion;
  373.         return $this;
  374.     }
  375.     public function getIsPrecioChrono24(): ?bool
  376.     {
  377.         return $this->isPrecioChrono24;
  378.     }
  379.     public function setIsPrecioChrono24(?bool $isPrecioChrono24): self
  380.     {
  381.         $this->isPrecioChrono24 $isPrecioChrono24;
  382.         return $this;
  383.     }
  384.     public function getRelojIDPerseo(): ?string
  385.     {
  386.         return $this->relojIDPerseo;
  387.     }
  388.     public function setRelojIDPerseo(?string $relojIDPerseo): self
  389.     {
  390.         $this->relojIDPerseo $relojIDPerseo;
  391.         return $this;
  392.     }
  393.     public function getRelojFoto(): ?string
  394.     {
  395.         return $this->relojFoto;
  396.     }
  397.     public function setRelojFoto(?string $relojFoto): self
  398.     {
  399.         $this->relojFoto $relojFoto;
  400.         return $this;
  401.     }
  402.     public function getRelojModelo1(): ?string
  403.     {
  404.         return $this->relojModelo1;
  405.     }
  406.     public function setRelojModelo1(?string $relojModelo): self
  407.     {
  408.         $this->relojModelo1 $relojModelo;
  409.         return $this;
  410.     }
  411.     public function getRelojRef1(): ?string
  412.     {
  413.         return $this->relojRef1;
  414.     }
  415.     public function setRelojRef1(?string $relojRef): self
  416.     {
  417.         $this->relojRef1 $relojRef;
  418.         return $this;
  419.     }
  420.     public function getRelojFecha(): ?int
  421.     {
  422.         return $this->relojFecha;
  423.     }
  424.     public function setRelojFecha(?int $relojFecha): self
  425.     {
  426.         $this->relojFecha $relojFecha;
  427.         return $this;
  428.     }
  429.     public function getRelojCaja(): ?bool
  430.     {
  431.         return $this->relojCaja;
  432.     }
  433.     public function setRelojCaja(bool $relojCaja): self
  434.     {
  435.         $this->relojCaja $relojCaja;
  436.         return $this;
  437.     }
  438.     public function getRelojPapeles(): ?bool
  439.     {
  440.         return $this->relojPapeles;
  441.     }
  442.     public function setRelojPapeles(bool $relojPapeles): self
  443.     {
  444.         $this->relojPapeles $relojPapeles;
  445.         return $this;
  446.     }
  447.     public function getRelojMarca(): ?Marca
  448.     {
  449.         return $this->relojMarca;
  450.     }
  451.     public function setRelojMarca(?Marca $relojMarca): self
  452.     {
  453.         $this->relojMarca $relojMarca;
  454.         return $this;
  455.     }
  456.     public function getRelojAspecto(): ?EstadoAspecto
  457.     {
  458.         return $this->relojAspecto;
  459.     }
  460.     public function setRelojAspecto(?EstadoAspecto $relojAspecto): self
  461.     {
  462.         $this->relojAspecto $relojAspecto;
  463.         return $this;
  464.     }
  465.     public function getValoracion(): ?Valoracion
  466.     {
  467.         return $this->valoracion;
  468.     }
  469.     public function setValoracion(?Valoracion $valoracion): self
  470.     {
  471.         $this->valoracion $valoracion;
  472.         return $this;
  473.     }
  474.     /**
  475.      * @return Collection|Coste[]
  476.      */
  477.     public function getCostes(): Collection
  478.     {
  479.         return $this->costes;
  480.     }
  481.     public function addCoste(Coste $coste): self
  482.     {
  483.         if (!$this->costes->contains($coste)) {
  484.             $this->costes[] = $coste;
  485.             $coste->setValoracionesRelojes($this);
  486.         }
  487.         return $this;
  488.     }
  489.     public function removeCoste(Coste $coste): self
  490.     {
  491.         if ($this->costes->removeElement($coste)) {
  492.             // set the owning side to null (unless already changed)
  493.             if ($coste->getValoracionesRelojes() === $this) {
  494.                 //$coste->setValoracionesRelojes(null);
  495.                 $coste->setDeletedAt(new DateTime('now'));
  496.             }
  497.         }
  498.         return $this;
  499.     }
  500.     public function getCostesTotal(): ?float
  501.     {
  502.         return $this->costesTotal;
  503.     }
  504.     public function setCostesTotal(?float $costesTotal): self
  505.     {
  506.         $this->costesTotal $costesTotal;
  507.         return $this;
  508.     }
  509.     /**
  510.      * @return Collection|Referencia[]
  511.      */
  512.     public function getReferencias(): Collection
  513.     {
  514.         return $this->referencias;
  515.     }
  516.     public function addReferencia(Referencia $referencia): self
  517.     {
  518.         if (!$this->referencias->contains($referencia)) {
  519.             $this->referencias[] = $referencia;
  520.             $referencia->setValoracionReloj($this);
  521.         }
  522.         return $this;
  523.     }
  524.     public function removeReferencia(Referencia $referencia): self
  525.     {
  526.         if ($this->referencias->removeElement($referencia)) {
  527.             // set the owning side to null (unless already changed)
  528.             if ($referencia->getValoracionReloj() === $this) {
  529.                 //$referencia->setValoracionReloj(null);
  530.                 $referencia->setDeletedAt(new DateTime('now'));
  531.             }
  532.         }
  533.         return $this;
  534.     }
  535.     public function isRelojCaja(): ?bool
  536.     {
  537.         return $this->relojCaja;
  538.     }
  539.     public function isRelojPapeles(): ?bool
  540.     {
  541.         return $this->relojPapeles;
  542.     }
  543.     public function getRelojInventario(): ?Reloj
  544.     {
  545.         return $this->relojInventario;
  546.     }
  547.     public function setRelojInventario(?Reloj $relojInventario): static
  548.     {
  549.         $this->relojInventario $relojInventario;
  550.         return $this;
  551.     }
  552.     public function getDetalleCompra(): ?DetalleCompra
  553.     {
  554.         return $this->detalleCompra;
  555.     }
  556.     public function setDetalleCompra(?DetalleCompra $detalleCompra): static
  557.     {
  558.         // unset the owning side of the relation if necessary
  559.         if ($detalleCompra === null && $this->detalleCompra !== null) {
  560.             $this->detalleCompra->setValoracionReloj(null);
  561.         }
  562.         // set the owning side of the relation if necessary
  563.         if ($detalleCompra !== null && $detalleCompra->getValoracionReloj() !== $this) {
  564.             $detalleCompra->setValoracionReloj($this);
  565.         }
  566.         $this->detalleCompra $detalleCompra;
  567.         return $this;
  568.     }
  569.     public function getRelojBase(): ?Reloj
  570.     {
  571.         return $this->relojBase;
  572.     }
  573.     public function setRelojBase(?Reloj $relojBase): static
  574.     {
  575.         $this->relojBase $relojBase;
  576.         return $this;
  577.     }
  578. }