src/Entity/Reloj.php line 34

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\CalibreEnum;
  4. use App\Enum\EstadoOperacionEnum;
  5. use App\Enum\EstadoRelojEnum;
  6. use App\Enum\GeneroRelojEnum;
  7. use App\Enum\PiezaRepuestoEnum;
  8. use App\Enum\ServicioMantenimientoEnum;
  9. use App\Enum\TipoCierreEnum;
  10. use App\Enum\TipoCristalEnum;
  11. use App\Enum\TipoEsferaIndiceEnum;
  12. use App\Enum\TipoOperacionEnum;
  13. use DateTime;
  14. use DateTimeInterface;
  15. use Doctrine\Common\Collections\ArrayCollection;
  16. use Doctrine\Common\Collections\Collection;
  17. use Doctrine\Common\Collections\Criteria;
  18. use Doctrine\DBAL\Types\Types;
  19. use Doctrine\ORM\EntityNotFoundException;
  20. use Doctrine\ORM\Mapping as ORM;
  21. use Gedmo\Mapping\Annotation as Gedmo;
  22. use Symfony\Component\HttpFoundation\File\File;
  23. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  24. /**
  25.  * @ORM\Entity(repositoryClass="App\Repository\RelojRepository")
  26.  * @ORM\Table(name="reloj")
  27.  * @ORM\EntityListeners({"App\EntityListener\Reloj\CalcularIDPerseoListener", "App\EntityListener\Reloj\CalcularCodigoListener"})
  28.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  29.  * @Vich\Uploadable
  30.  */
  31. class Reloj
  32. {
  33.     /**
  34.      * @ORM\Id
  35.      * @ORM\Column(type="bigint", options={"unsigned":true})
  36.      * @ORM\GeneratedValue(strategy="AUTO")
  37.      */
  38.     protected $id;
  39.     /**
  40.      * @ORM\Column(type="string", unique=true, nullable=false)
  41.      */
  42.     protected $codigo;
  43.     /**
  44.      * @ORM\Column(
  45.      *     type="string",
  46.      *     unique=true,
  47.      *     nullable=false,
  48.      *     name="id_perseo",
  49.      *     options={"comment":"Identificador de perseo único generado aleatoriamente combinación letras y números"}
  50.      * )
  51.      */
  52.     protected $IDperseo;
  53.     /**
  54.      * @ORM\Column(
  55.      *     type="string",
  56.      *     length=4,
  57.      *     nullable=true,
  58.      *     options={"comment":"Valores a tomar REBU ó IVA, por defecto REBU"}
  59.      * )
  60.      */
  61.     protected $regimen;
  62.     /**
  63.      * @ORM\Column(type="string", nullable=true)
  64.      */
  65.     protected $foto;
  66.     /**
  67.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="foto")
  68.      * @var File
  69.      */
  70.     protected $fotoFile;
  71.     /**
  72.      * @ORM\Column(type="string", nullable=true, name="foto_valoracion")
  73.      */
  74.     private $fotoValoracion;
  75.     /**
  76.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="foto_valoracion")
  77.      * @var File
  78.      */
  79.     protected $fotoValoracionFile;
  80.     /**
  81.      * @ORM\Column(type="string", nullable=true, name="foto_set")
  82.      */
  83.     private $fotoSet;
  84.     /**
  85.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="foto_set")
  86.      * @var File
  87.      */
  88.     protected $fotoSetFile;
  89.     /**
  90.      * @ORM\Column(type="string", nullable=true, name="foto_crono", options={"comment":"foto del cronocomparador"})
  91.      */
  92.     private $fotoCrono;
  93.     /**
  94.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="foto_crono")
  95.      * @var File
  96.      */
  97.     protected $fotoCronoFile;
  98.     /**
  99.      * @ORM\Column(type="string", nullable=true)
  100.      */
  101.     private $video;
  102.     /**
  103.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="video")
  104.      * @var File
  105.      */
  106.     protected $videoFile;
  107.     /**
  108.      * @ORM\Column(type="string", nullable=true)
  109.      */
  110.     protected $modelo1;
  111.     /**
  112.      * @ORM\Column(type="string", nullable=true)
  113.      */
  114.     protected $modelo2;
  115.     /**
  116.      * @ORM\Column(type="string", nullable=true)
  117.      */
  118.     protected $ref1;
  119.     /**
  120.      * @ORM\Column(type="string", nullable=true)
  121.      */
  122.     protected $ref2;
  123.     /**
  124.      * @ORM\Column(type="string", nullable=true)
  125.      */
  126.     protected $serie;
  127.     /**
  128.      * @ORM\Column(type="float", nullable=true, precision=2)
  129.      */
  130.     protected $peso;
  131.     /**
  132.      * @ORM\Column(type="datetime", nullable=true, options={"comment":"Fecha comprado por  primera vez"})
  133.      */
  134.     protected $fecha;
  135.     /**
  136.      * @ORM\Column(type="boolean", nullable=false, options={"default":0})
  137.      */
  138.     protected $caja;
  139.     /**
  140.      * @ORM\Column(type="boolean", nullable=false, options={"default":0})
  141.      */
  142.     protected $papeles;
  143.     /**
  144.      * @ORM\Column(type="text", nullable=true)
  145.      */
  146.     protected $otros;
  147.     /**
  148.      * @ORM\Column(type="float", nullable=true, name="itp", precision=2, options={"default":"0.0","comment":"%"})
  149.      */
  150.     protected $ITP;
  151.     /**
  152.      * @ORM\Column(
  153.      *     type="datetime",
  154.      *     nullable=true,
  155.      *     name="fecha_valoracion",
  156.      *     options={"comment":"Fecha valoracion es la fecha enviada"}
  157.      * )
  158.      */
  159.     private $fechaValoracion;
  160.     /**
  161.      * @ORM\Column(
  162.      *     type="float",
  163.      *     nullable=true,
  164.      *     options={
  165.      *         "default":"0.0",
  166.      *         "comment":"Comsión CRONO esta en gastos , pero se duplica fuera para tener mejor acceso a ella %"
  167.      *     }
  168.      * )
  169.      */
  170.     protected $comision;
  171.     /**
  172.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_coste")
  173.      */
  174.     protected $precioCoste;
  175.     /**
  176.      * @ORM\Column(
  177.      *     type="float",
  178.      *     nullable=true,
  179.      *     name="precio_coste_total",
  180.      *     precision=2,
  181.      *     options={
  182.      *         "default":"0.0",
  183.      *         "comment":"Autocalculado, cada vez que se añade/modifique un coste ó cambie su coste (Coste del Reloj + Costes Asociados)"
  184.      *     }
  185.      * )
  186.      */
  187.     protected $precioCosteTotal;
  188.     /**
  189.      * @ORM\Column(
  190.      *     type="string",
  191.      *     nullable=true,
  192.      *     name="genero",
  193.      *     enumType="App\Enum\GeneroRelojEnum",
  194.      *     options={"comment":"Opciones caballero, mujer, unisex"}
  195.      * )
  196.      */
  197.     private $genero;
  198.     /**
  199.      * @ORM\Column(
  200.      *     type="smallint",
  201.      *     length=1,
  202.      *     nullable=true,
  203.      *     name="estado_caja",
  204.      *     options={"comment":"valores a tomar de 1 a 5"}
  205.      * )
  206.      */
  207.     private $estadoCaja;
  208.     /**
  209.      * @ORM\Column(
  210.      *     type="smallint",
  211.      *     length=1,
  212.      *     nullable=true,
  213.      *     name="estado_cristal",
  214.      *     options={"comment":"valores a tomar de 1 a 5"}
  215.      * )
  216.      */
  217.     private $estadoCristal;
  218.     /**
  219.      * @ORM\Column(
  220.      *     type="smallint",
  221.      *     length=1,
  222.      *     nullable=true,
  223.      *     name="estado_dial",
  224.      *     options={"comment":"valores a tomar de 1 a 5"}
  225.      * )
  226.      */
  227.     private $estadoDial;
  228.     /**
  229.      * @ORM\Column(
  230.      *     type="smallint",
  231.      *     length=1,
  232.      *     nullable=true,
  233.      *     name="estado_agujas",
  234.      *     options={"comment":"valores a tomar de 1 a 5"}
  235.      * )
  236.      */
  237.     private $estadoAgujas;
  238.     /**
  239.      * @ORM\Column(
  240.      *     type="smallint",
  241.      *     length=1,
  242.      *     nullable=true,
  243.      *     name="estado_tapa",
  244.      *     options={"comment":"valores a tomar de 1 a 5"}
  245.      * )
  246.      */
  247.     private $estadoTapa;
  248.     /**
  249.      * @ORM\Column(
  250.      *     type="smallint",
  251.      *     length=1,
  252.      *     nullable=true,
  253.      *     name="estado_correa",
  254.      *     options={"comment":"valores a tomar de 1 a 5"}
  255.      * )
  256.      */
  257.     private $estadoCorrea;
  258.     /**
  259.      * @ORM\Column(
  260.      *     type="string",
  261.      *     nullable=true,
  262.      *     enumType="App\Enum\TipoEsferaIndiceEnum",
  263.      *     name="esfera_indice",
  264.      *     options={"comment":"Opciones Arabes, Romanos, Indices, Sin Indices"}
  265.      * )
  266.      */
  267.     private $esferaIndice;
  268.     /**
  269.      * @ORM\Column(type="string", nullable=true, name="esfera_color")
  270.      */
  271.     private $esferaColor;
  272.     /**
  273.      * @ORM\Column(type="boolean", nullable=true, name="esfera_joyas", options={"default":0})
  274.      */
  275.     private $esferaJoyas;
  276.     /**
  277.      * @ORM\Column(type="integer", nullable=true, name="caja_reloj_diametro", options={"comment":"medidas en mm"})
  278.      */
  279.     private $cajaRelojDiametro;
  280.     /**
  281.      * @ORM\Column(type="integer", nullable=true, name="caja_reloj_grosor", options={"comment":"Medidas en mm"})
  282.      */
  283.     private $cajaRelojGrosor;
  284.     /**
  285.      * @ORM\Column(type="integer", nullable=true, name="caja_reloj_resistencia_agua", options={"comment":"Unidad ATM"})
  286.      */
  287.     private $cajaRelojResistenciaAgua;
  288.     /**
  289.      * @ORM\Column(
  290.      *     type="string",
  291.      *     nullable=true,
  292.      *     enumType="App\Enum\TipoCristalEnum",
  293.      *     name="caja_reloj_cristal",
  294.      *     options={"comment":"Opciones Zafiro, Mineral, Plexiglass"}
  295.      * )
  296.      */
  297.     private $cajaRelojCristal;
  298.     /**
  299.      * @ORM\Column(type="string", nullable=true, name="pulsera_color")
  300.      */
  301.     private $pulseraColor;
  302.     /**
  303.      * @ORM\Column(
  304.      *     type="string",
  305.      *     nullable=true,
  306.      *     name="pulsera_cierre",
  307.      *     enumType="App\Enum\TipoCierreEnum",
  308.      *     options={"comment":"Opciones hebilla, deployante"}
  309.      * )
  310.      */
  311.     private $pulseraCierre;
  312.     /**
  313.      * @ORM\Column(type="integer", nullable=true, name="pulsera_ancho_caja")
  314.      */
  315.     private $pulseraAnchoCaja;
  316.     /**
  317.      * @ORM\Column(type="integer", nullable=true, name="pulsera_ancho_cierre")
  318.      */
  319.     private $pulseraAnchoCierre;
  320.     /**
  321.      * @ORM\Column(type="integer", nullable=true, name="pulsera_medida_munieca")
  322.      */
  323.     private $pulseraMedidaMunieca;
  324.     /**
  325.      * @ORM\Column(
  326.      *     type="string",
  327.      *     nullable=true,
  328.      *     enumType="App\Enum\CalibreEnum",
  329.      *     options={"comment":"Opciones automático, manual, cuarzo, solar"}
  330.      * )
  331.      */
  332.     private $calibre;
  333.     /**
  334.      * @ORM\Column(type="string", nullable=true, name="calibre_avanzado")
  335.      */
  336.     private $calibreAvanzado;
  337.     /**
  338.      * @ORM\Column(type="string", nullable=true, name="calibre_basico")
  339.      */
  340.     private $calibreBasico;
  341.     /**
  342.      * @ORM\Column(type="string", nullable=true, name="calibre_reserva_marcha")
  343.      */
  344.     private $calibreReservaMarcha;
  345.     /**
  346.      * @ORM\Column(type="string", nullable=true, name="calibre_numero_joyas")
  347.      */
  348.     private $calibreNumeroJoyas;
  349.     /**
  350.      * @ORM\Column(type="string", nullable=true, name="calibre_oscilacion")
  351.      */
  352.     private $calibreOscilacion;
  353.     /**
  354.      * @ORM\Column(type="string", nullable=true, name="calibre_amplitud")
  355.      */
  356.     private $calibreAmplitud;
  357.     /**
  358.      * @ORM\Column(type="string", nullable=true, name="calibre_marcha")
  359.      */
  360.     private $calibreMarcha;
  361.     /**
  362.      * @ORM\Column(
  363.      *     type="string",
  364.      *     nullable=true,
  365.      *     enumType="App\Enum\PiezaRepuestoEnum",
  366.      *     name="piezas_repuesto",
  367.      *     options={"comment":"Opciones Si, No, No lo sé"}
  368.      * )
  369.      */
  370.     private $piezasRepuesto;
  371.     /**
  372.      * @ORM\Column(type="text", nullable=true, name="piezas_repuesto_observaciones")
  373.      */
  374.     private $piezasRepuestoObservaciones;
  375.     /**
  376.      * @ORM\Column(
  377.      *     type="string",
  378.      *     nullable=true,
  379.      *     enumType="App\Enum\ServicioMantenimientoEnum",
  380.      *     name="servicio_mantenimiento",
  381.      *     options={"comment":"Opciones Si, oficial; Si, relojero propio; No; No lo se"}
  382.      * )
  383.      */
  384.     private $servicioMantenimiento;
  385.     /**
  386.      * @ORM\Column(
  387.      *     type="json",
  388.      *     nullable=true,
  389.      *     name="calibre_caracteristicas",
  390.      *     options={"comment":"Opciones de caracteristicas (selector multiple)"}
  391.      * )
  392.      */
  393.     private $calibreCaracteristicas;
  394.     /**
  395.      * @ORM\Column(
  396.      *     type="json",
  397.      *     nullable=true,
  398.      *     name="calibre_funciones",
  399.      *     options={"comment":"Opciones de caracteristicas (selector multiple)"}
  400.      * )
  401.      */
  402.     private $calibreFunciones;
  403.     /**
  404.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_min_venta")
  405.      */
  406.     protected $precioMinVenta;
  407.     /**
  408.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_promocion", options={"default":"0.0"})
  409.      */
  410.     protected $precioPromocion;
  411.     /**
  412.      * @ORM\Column(type="datetime", nullable=true, name="fecha_promocion")
  413.      */
  414.     protected $fechaPromocion;
  415.     /**
  416.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_oferta")
  417.      */
  418.     protected $precioOferta;
  419.     /**
  420.      * @deprecated Por cambios de funcionalidad
  421.      * @ORM\Column(type="boolean", nullable=true, precision=2, name="chrono24")
  422.      */
  423.     protected $chrono24;
  424.     /**
  425.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_pagar")
  426.      */
  427.     protected $precioPagar;
  428.     /**
  429.      * @ORM\Column(
  430.      *     type="boolean",
  431.      *     nullable=true,
  432.      *     options={
  433.      *         "default":1,
  434.      *         "comment":"Valor por defecto: **true**.
  435.      *         Cuando la operación se origina dentro de un proceso de **gestión**, el valor se establece en **false**.
  436.      *         Este campo permite identificar si una compra ha sido realizada **fuera del circuito de gestión**, independientemente de que el reloj esté o haya estado previamente vinculado a una operación de gestión."
  437.      *     }
  438.      * )
  439.      */
  440.     private $compraDirecta;
  441.     /**
  442.      * @ORM\Column(type="float", nullable=true, precision=2, name="precio_compra")
  443.      */
  444.     protected $precioCompra;
  445.     /**
  446.      * @ORM\Column(type="datetime", nullable=true, name="fecha_compra")
  447.      */
  448.     protected $fechaCompra;
  449.     /**
  450.      * @ORM\Column(type="float", nullable=true, precision=2)
  451.      */
  452.     protected $precioVenta;
  453.     /**
  454.      * @ORM\Column(type="datetime", nullable=true, name="fecha_venta")
  455.      */
  456.     protected $fechaVenta;
  457.     /**
  458.      * @ORM\Column(type="float", nullable=true, precision=2)
  459.      */
  460.     protected $precioVentaTotal;
  461.     /**
  462.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_minimo")
  463.      */
  464.     protected $margenMinimo;
  465.     /**
  466.      * @ORM\Column(type="float", nullable=true, precision=0, name="margen_deseado")
  467.      */
  468.     protected $margenDeseado;
  469.     /**
  470.      * @ORM\Column(type="float", nullable=true, precision=2)
  471.      */
  472.     private $recompra;
  473.     /**
  474.      * @ORM\Column(type="string", nullable=true)
  475.      */
  476.     private $garantia;
  477.     /**
  478.      * @ORM\Column(type="string", nullable=true)
  479.      */
  480.     private $descripcion;
  481.     /**
  482.      * @ORM\Column(type="text", nullable=true, name="descripcion_detallada")
  483.      */
  484.     private $descripcionDetallada;
  485.     /**
  486.      * @ORM\Column(type="text", nullable=true)
  487.      */
  488.     private $condiciones;
  489.     /**
  490.      * @ORM\Column(type="text", nullable=true, name="anuncio_es")
  491.      */
  492.     private $anuncioES;
  493.     /**
  494.      * @ORM\Column(type="text", nullable=true, name="anuncio_en")
  495.      */
  496.     private $anuncioEN;
  497.     /**
  498.      * @ORM\Column(
  499.      *     type="integer",
  500.      *     nullable=true,
  501.      *     name="tiempo_en_venta",
  502.      *     options={"comment":"Diff entre Fecha Venta y 1º Estado de Anuncio"}
  503.      * )
  504.      */
  505.     private $tiempoEnVenta;
  506.     /**
  507.      * @ORM\Column(
  508.      *     type="integer",
  509.      *     nullable=true,
  510.      *     name="tiempo_en_stock",
  511.      *     options={"comment":"Diff entre Fecha Venta y Fecha Compra"}
  512.      * )
  513.      */
  514.     private $tiempoEnStock;
  515.     /**
  516.      * @ORM\Column(type="datetime", nullable=true, name="fecha_recepcion")
  517.      */
  518.     private $fechaRecepcion;
  519.     /**
  520.      * @ORM\Column(
  521.      *     type="float",
  522.      *     nullable=true,
  523.      *     precision=0,
  524.      *     name="margen_promocion",
  525.      *     options={"default":"0.0","comment":"%"}
  526.      * )
  527.      */
  528.     protected $margenPromocion;
  529.     /**
  530.      * @ORM\Column(
  531.      *     type="float",
  532.      *     nullable=true,
  533.      *     precision=0,
  534.      *     name="margen_bruto",
  535.      *     options={"default":"0.0","comment":"%"}
  536.      * )
  537.      */
  538.     protected $margenBruto;
  539.     /**
  540.      * @ORM\Column(type="float", nullable=true, name="margen_neto", precision=2,
  541.      *     options={"default":"0.0","comment":"%"})
  542.      */
  543.     protected $margenNeto;
  544.     /**
  545.      * @ORM\Column(type="boolean", nullable=false, options={"default":0,"comment":"Relojes comprados"})
  546.      */
  547.     protected $stock;
  548.     /**
  549.      * @ORM\Column(type="boolean", nullable=true, options={"default":0,"comment":"Relojes en Gestión de Venta"})
  550.      */
  551.     protected $custodia;
  552.     /**
  553.      * @ORM\Column(type="float", nullable=true, name="tiempo_venta", precision=2,
  554.      *     options={"default":"0.0","comment":"%"})
  555.      */
  556.     protected $tiempoVenta;
  557.     /**
  558.      * @ORM\Column(type="datetime", nullable=true, name="fecha_anuncio", options={"comment":"Fecha primer anuncio"})
  559.      */
  560.     private $fechaAnuncio;
  561.     /**
  562.      * @ORM\Column(type="text", nullable=true)
  563.      */
  564.     protected $comentario;
  565.     /**
  566.      * @ORM\Column(
  567.      *     type="string",
  568.      *     unique=true,
  569.      *     nullable=true,
  570.      *     name="token_access",
  571.      *     options={"comment":"Token de acceso a la información del reloj"}
  572.      * )
  573.      */
  574.     protected $tokenAccess;
  575.     /**
  576.      * @ORM\Column(
  577.      *     type="boolean",
  578.      *     nullable=true,
  579.      *     name="en_promocion",
  580.      *     options={"default":0,"comment":"Cuando la Estado Operacion es Confirmada"}
  581.      * )
  582.      */
  583.     protected $enPromocion;
  584.     /**
  585.      * @ORM\Column(
  586.      *     type="boolean",
  587.      *     nullable=true,
  588.      *     name="en_servicio",
  589.      *     options={"default":0,"comment":"Relojes Recepcionados y que se encuentren en una Ubicación tipo Proveedor"}
  590.      * )
  591.      */
  592.     protected $enServicio;
  593.     /**
  594.      * @ORM\Column(
  595.      *     type="boolean",
  596.      *     nullable=true,
  597.      *     name="sin_anunciar",
  598.      *     options={"default":0,"comment":"Relojes Estado Listo y no han sido promocionados"}
  599.      * )
  600.      */
  601.     protected $sinAnunciar;
  602.     /**
  603.      * @ORM\Column(type="boolean", nullable=true, options={"default":0})
  604.      */
  605.     protected $enVenta;
  606.     /**
  607.      * @ORM\Column(
  608.      *     type="boolean",
  609.      *     nullable=true,
  610.      *     name="tipo_bloqueo",
  611.      *     options={"comment":"Valores a tomar RM(true) ó RI(false) ó NULL"}
  612.      * )
  613.      */
  614.     protected $tipoBloqueo;
  615.     /**
  616.      * @ORM\Column(type="boolean", nullable=true)
  617.      */
  618.     protected $exportacion;
  619.     /**
  620.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  621.      */
  622.     protected $deletedAt;
  623.     /**
  624.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  625.      * @Gedmo\Timestampable(on="update")
  626.      */
  627.     protected $updatedAt;
  628.     /**
  629.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  630.      * @Gedmo\Timestampable(on="create")
  631.      */
  632.     protected $createdAt;
  633.     /**
  634.      * @ORM\OneToOne(targetEntity=\App\Entity\ValoracionesRelojesSinStock::class, mappedBy="relojInventario")
  635.      */
  636.     private $valoracionReloj;
  637.     /**
  638.      * @ORM\OneToMany(targetEntity=\App\Entity\DetalleCompra::class, mappedBy="reloj")
  639.      */
  640.     protected $detalleCompra;
  641.     /**
  642.      * @ORM\OneToMany(targetEntity=\App\Entity\DetalleCompra::class, mappedBy="relojBase")
  643.      */
  644.     private $relojesDerivadosDetalleCompra;
  645.     /**
  646.      * @ORM\OneToMany(targetEntity=\App\Entity\DetalleVenta::class, mappedBy="reloj")
  647.      */
  648.     protected $detalleVenta;
  649.     /**
  650.      * @ORM\OneToOne(targetEntity=\App\Entity\RegistroPolicial::class, mappedBy="reloj")
  651.      */
  652.     protected $registroPolicial;
  653.     /*
  654.      * @ORM\OneToOne(targetEntity=\App\Entity\ActividadAbstract::class, mappedBy="reloj")
  655.      */
  656.     private $actividad;
  657.     /**
  658.      * @ORM\OneToOne(targetEntity=\App\Entity\Promocion::class, mappedBy="reloj")
  659.      */
  660.     protected $promociones;
  661.     /**
  662.      * @ORM\OneToMany(targetEntity="App\Entity\Gasto", mappedBy="reloj")
  663.      */
  664.     protected $gastos;
  665.     /**
  666.      * @ORM\OneToMany(targetEntity="App\Entity\Trazabilidad", mappedBy="reloj")
  667.      */
  668.     protected $trazas;
  669.     /**
  670.      * @ORM\OneToMany(targetEntity="App\Entity\ValoracionesRelojes", mappedBy="reloj", cascade={"persist"})
  671.      */
  672.     protected $valoracionesRelojes;
  673.     /**
  674.      * @ORM\OneToMany(targetEntity=\App\Entity\ValoracionesRelojesSinStock::class, mappedBy="relojBase")
  675.      */
  676.     private $relojesDerivadosValoracionSinStock;
  677.     /**
  678.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="relojBase")
  679.      */
  680.     private $relojesDerivados;
  681.     /**
  682.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoReloj", inversedBy="relojes")
  683.      * @ORM\JoinColumn(name="estado_reloj_id", referencedColumnName="id", nullable=true)
  684.      */
  685.     protected $estado;
  686.     /**
  687.      * @ORM\ManyToOne(targetEntity="App\Entity\Marca", inversedBy="relojes")
  688.      * @ORM\JoinColumn(name="marca_id", referencedColumnName="id")
  689.      */
  690.     protected $marca;
  691.     /**
  692.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoAspecto", inversedBy="relojes")
  693.      * @ORM\JoinColumn(name="estado_aspecto_id", referencedColumnName="id")
  694.      */
  695.     protected $aspecto;
  696.     /**
  697.      * @ORM\ManyToOne(targetEntity="App\Entity\EstadoCheck", inversedBy="relojes")
  698.      * @ORM\JoinColumn(name="estado_check_id", referencedColumnName="id")
  699.      */
  700.     protected $check;
  701.     /*
  702.      * @ORM\OneToOne(targetEntity=\App\Entity\Operacion::class, inversedBy="relojGestion")
  703.      * @ORM\JoinColumn(name="operacion_gestion_id", referencedColumnName="id", unique=true)
  704.      */
  705.     /**
  706.      * @ORM\JoinColumn(name="operacion_gestion_id", referencedColumnName="id")
  707.      * @ORM\ManyToOne(targetEntity=\App\Entity\Operacion::class, inversedBy="relojesGestion")
  708.      */
  709.     private $operacionGestion;
  710.     /**
  711.      * @ORM\JoinColumn(name="operacion_venta_id", referencedColumnName="id")
  712.      * @ORM\ManyToOne(targetEntity=\App\Entity\Operacion::class, inversedBy="relojesVenta")
  713.      */
  714.     private $operacionVenta;
  715.     /**
  716.      * @ORM\JoinColumn(name="operacion_compra_id", referencedColumnName="id")
  717.      * @ORM\ManyToOne(targetEntity=\App\Entity\Operacion::class, inversedBy="relojesCompra")
  718.      */
  719.     private $operacionCompra;
  720.     /**
  721.      * @ORM\ManyToOne(targetEntity=\App\Entity\Valoracion::class, inversedBy="relojes")
  722.      * @ORM\JoinColumn(name="valoracion_id", referencedColumnName="id")
  723.      */
  724.     private $valoracion;
  725.     /**
  726.      * @ORM\ManyToOne(targetEntity=\App\Entity\Empresa::class, inversedBy="relojes")
  727.      * @ORM\JoinColumn(name="empresa_id", referencedColumnName="id", nullable=false)
  728.      */
  729.     private $empresa;
  730.     /**
  731.      * @ORM\ManyToOne(targetEntity=\App\Entity\Material::class, inversedBy="relojesCajaRelojMaterial")
  732.      * @ORM\JoinColumn(name="caja_reloj_material_id", referencedColumnName="id")
  733.      */
  734.     private $cajaRelojMaterial;
  735.     /**
  736.      * @ORM\ManyToOne(targetEntity=\App\Entity\Material::class, inversedBy="relojesCajaRelojMaterialBisel")
  737.      * @ORM\JoinColumn(name="caja_reloj_bisel_material_id", referencedColumnName="id")
  738.      */
  739.     private $cajaRelojMaterialBisel;
  740.     /**
  741.      * @ORM\ManyToOne(targetEntity=\App\Entity\Material::class, inversedBy="relojesPulseraMaterial")
  742.      * @ORM\JoinColumn(name="pulsera_material_id", referencedColumnName="id")
  743.      */
  744.     private $pulseraMaterial;
  745.     /**
  746.      * @ORM\ManyToOne(targetEntity=\App\Entity\Material::class, inversedBy="relojesPulseraMaterialCierre")
  747.      * @ORM\JoinColumn(name="pulsera_material_cierre_id", referencedColumnName="id")
  748.      */
  749.     private $pulseraMaterialCierre;
  750.     /**
  751.      * @ORM\ManyToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="relojesDerivados")
  752.      * @ORM\JoinColumn(name="reloj_base_id", referencedColumnName="id")
  753.      */
  754.     private $relojBase;
  755.     /**
  756.      * @ORM\OneToOne(targetEntity=\App\Entity\ActividadCompra::class, mappedBy="reloj")
  757.      */
  758.     private $actividadCompra;
  759.     /**
  760.      * @ORM\OneToOne(targetEntity=\App\Entity\ActividadVenta::class, mappedBy="reloj")
  761.      */
  762.     private $actividadVenta;
  763.     private $fechaStr;
  764.     public function __construct()
  765.     {
  766.         $this->reservado false;
  767.         $this->papeles false;
  768.         $this->caja false;
  769.         $this->stock false;
  770.         $this->custodia false;
  771.         $this->gastos = new ArrayCollection();
  772.         $this->trazas = new ArrayCollection();
  773.         $this->valoracionesRelojes = new ArrayCollection();
  774.         $this->detalleVenta = new ArrayCollection();
  775.         $this->detalleCompra = new ArrayCollection();
  776.         $this->relojesDerivadosDetalleCompra = new ArrayCollection();
  777.         $this->relojesDerivadosValoracionSinStock = new ArrayCollection();
  778.         $this->relojesDerivados = new ArrayCollection();
  779.     }
  780.     public function __toString(): string
  781.     {
  782.         return (string)($this->getCodigo() ?? $this->getIDperseo());
  783.     }
  784.     public function getId(): ?string
  785.     {
  786.         return $this->id;
  787.     }
  788.     public function getIDperseo(): ?string
  789.     {
  790.         return $this->IDperseo;
  791.     }
  792.     public function setIDperseo(string $IDperseo): self
  793.     {
  794.         $this->IDperseo $IDperseo;
  795.         return $this;
  796.     }
  797.     public function getRegimen(): ?string
  798.     {
  799.         return $this->regimen;
  800.     }
  801.     public function setRegimen(?string $regimen): self
  802.     {
  803.         $this->regimen $regimen;
  804.         return $this;
  805.     }
  806.     public function getFoto(): ?string
  807.     {
  808.         return $this->foto;
  809.     }
  810.     public function setFoto(?string $foto): self
  811.     {
  812.         $this->foto $foto;
  813.         return $this;
  814.     }
  815.     public function getFotoFile(): ?File
  816.     {
  817.         return $this->fotoFile;
  818.     }
  819.     public function setFotoFile(?File $fotoFile): self
  820.     {
  821.         $this->fotoFile $fotoFile;
  822.         if ($fotoFile) {
  823.             // if 'updatedAt' is not defined in your entity, use another property
  824.             $this->setUpdatedAt(new DateTime('now'));
  825.         }
  826.         return $this;
  827.     }
  828.     public function getModelo1(): ?string
  829.     {
  830.         return $this->modelo1;
  831.     }
  832.     public function setModelo1(?string $modelo1): self
  833.     {
  834.         $this->modelo1 $modelo1;
  835.         return $this;
  836.     }
  837.     public function getModelo2(): ?string
  838.     {
  839.         return $this->modelo2;
  840.     }
  841.     public function setModelo2(?string $modelo2): self
  842.     {
  843.         $this->modelo2 $modelo2;
  844.         return $this;
  845.     }
  846.     public function getRef1(): ?string
  847.     {
  848.         return $this->ref1;
  849.     }
  850.     public function setRef1(?string $ref1): self
  851.     {
  852.         $this->ref1 $ref1;
  853.         return $this;
  854.     }
  855.     public function getRef2(): ?string
  856.     {
  857.         return $this->ref2;
  858.     }
  859.     public function setRef2(?string $ref2): self
  860.     {
  861.         $this->ref2 $ref2;
  862.         return $this;
  863.     }
  864.     public function getSerie(): ?string
  865.     {
  866.         return $this->serie;
  867.     }
  868.     public function setSerie(?string $serie): self
  869.     {
  870.         $this->serie $serie;
  871.         return $this;
  872.     }
  873.     public function getFecha(): ?DateTimeInterface
  874.     {
  875.         return $this->fecha;
  876.     }
  877.     public function setFecha(?DateTimeInterface $fecha): self
  878.     {
  879.         $this->fecha $fecha;
  880.         return $this;
  881.     }
  882.     public function isCaja(): ?bool
  883.     {
  884.         return $this->caja;
  885.     }
  886.     public function getCaja(): ?bool
  887.     {
  888.         return $this->caja;
  889.     }
  890.     public function setCaja(bool $caja): self
  891.     {
  892.         $this->caja $caja;
  893.         return $this;
  894.     }
  895.     public function isPapeles(): ?bool
  896.     {
  897.         return $this->papeles;
  898.     }
  899.     public function getPapeles(): ?bool
  900.     {
  901.         return $this->papeles;
  902.     }
  903.     public function setPapeles(bool $papeles): self
  904.     {
  905.         $this->papeles $papeles;
  906.         return $this;
  907.     }
  908.     public function getOtros(): ?string
  909.     {
  910.         return $this->otros;
  911.     }
  912.     public function setOtros(?string $otros): self
  913.     {
  914.         $this->otros $otros;
  915.         return $this;
  916.     }
  917.     public function getITP(): ?float
  918.     {
  919.         return $this->ITP;
  920.     }
  921.     public function setITP(?float $ITP): self
  922.     {
  923.         $this->ITP $ITP;
  924.         return $this;
  925.     }
  926.     public function getComision(): ?float
  927.     {
  928.         return $this->comision;
  929.     }
  930.     public function setComision(?float $comision): self
  931.     {
  932.         $this->comision $comision;
  933.         return $this;
  934.     }
  935.     public function getPrecioCoste(): ?float
  936.     {
  937.         return $this->precioCoste;
  938.     }
  939.     public function setPrecioCoste(?float $precioCoste): self
  940.     {
  941.         $this->precioCoste $precioCoste;
  942.         return $this;
  943.     }
  944.     public function getPrecioCosteTotal(): ?float
  945.     {
  946.         return $this->precioCosteTotal;
  947.     }
  948.     public function setPrecioCosteTotal(?float $precioCosteTotal): self
  949.     {
  950.         $this->precioCosteTotal $precioCosteTotal;
  951.         return $this;
  952.     }
  953.     public function getPrecioMinVenta(): ?float
  954.     {
  955.         return $this->precioMinVenta;
  956.     }
  957.     public function setPrecioMinVenta(?float $precioMinVenta): self
  958.     {
  959.         $this->precioMinVenta $precioMinVenta;
  960.         return $this;
  961.     }
  962.     public function getPrecioPromocion(): ?float
  963.     {
  964.         return $this->precioPromocion;
  965.     }
  966.     public function setPrecioPromocion(?float $precioPromocion): self
  967.     {
  968.         $this->precioPromocion $precioPromocion;
  969.         return $this;
  970.     }
  971.     public function getPrecioOferta(): ?float
  972.     {
  973.         return $this->precioOferta;
  974.     }
  975.     public function setPrecioOferta(?float $precioOferta): self
  976.     {
  977.         $this->precioOferta $precioOferta;
  978.         return $this;
  979.     }
  980.     public function getPrecioPagar(): ?float
  981.     {
  982.         return $this->precioPagar;
  983.     }
  984.     public function setPrecioPagar(?float $precioPagar): self
  985.     {
  986.         $this->precioPagar $precioPagar;
  987.         return $this;
  988.     }
  989.     public function getPrecioVenta(): ?float
  990.     {
  991.         return $this->precioVenta;
  992.     }
  993.     public function setPrecioVenta(?float $precioVenta): self
  994.     {
  995.         $this->precioVenta $precioVenta;
  996.         return $this;
  997.     }
  998.     public function getPrecioVentaTotal(): ?float
  999.     {
  1000.         return $this->precioVentaTotal;
  1001.     }
  1002.     public function setPrecioVentaTotal(?float $precioVentaTotal): self
  1003.     {
  1004.         $this->precioVentaTotal $precioVentaTotal;
  1005.         return $this;
  1006.     }
  1007.     public function getMargenMinimo(): ?float
  1008.     {
  1009.         return $this->margenMinimo;
  1010.     }
  1011.     public function setMargenMinimo(?float $margenMinimo): self
  1012.     {
  1013.         $this->margenMinimo $margenMinimo;
  1014.         return $this;
  1015.     }
  1016.     public function getMargenDeseado(): ?float
  1017.     {
  1018.         return $this->margenDeseado;
  1019.     }
  1020.     public function setMargenDeseado(?float $margenDeseado): self
  1021.     {
  1022.         $this->margenDeseado $margenDeseado;
  1023.         return $this;
  1024.     }
  1025.     public function getMargenPromocion(): ?float
  1026.     {
  1027.         return $this->margenPromocion;
  1028.     }
  1029.     public function setMargenPromocion(?float $margenPromocion): self
  1030.     {
  1031.         $this->margenPromocion $margenPromocion;
  1032.         return $this;
  1033.     }
  1034.     public function getMargenBruto(): ?float
  1035.     {
  1036.         return $this->margenBruto;
  1037.     }
  1038.     public function setMargenBruto(?float $margenBruto): self
  1039.     {
  1040.         $this->margenBruto $margenBruto;
  1041.         return $this;
  1042.     }
  1043.     public function getStock(): ?bool
  1044.     {
  1045.         return $this->stock;
  1046.     }
  1047.     public function setStock(bool $stock): self
  1048.     {
  1049.         $this->stock $stock;
  1050.         return $this;
  1051.     }
  1052.     public function getComentario(): ?string
  1053.     {
  1054.         return $this->comentario;
  1055.     }
  1056.     public function setComentario(?string $comentario): self
  1057.     {
  1058.         $this->comentario $comentario;
  1059.         return $this;
  1060.     }
  1061.     public function getReservado(): ?bool
  1062.     {
  1063.         return $this->reservado;
  1064.     }
  1065.     public function setReservado(bool $reservado): self
  1066.     {
  1067.         $this->reservado $reservado;
  1068.         return $this;
  1069.     }
  1070.     public function getTokenAccess(): ?string
  1071.     {
  1072.         return $this->tokenAccess;
  1073.     }
  1074.     public function setTokenAccess(?string $tokenAccess): self
  1075.     {
  1076.         $this->tokenAccess $tokenAccess;
  1077.         return $this;
  1078.     }
  1079.     public function getTipoBloqueo(): ?string
  1080.     {
  1081.         return $this->tipoBloqueo;
  1082.     }
  1083.     public function setTipoBloqueo(?string $tipoBloqueo): self
  1084.     {
  1085.         $this->tipoBloqueo $tipoBloqueo;
  1086.         return $this;
  1087.     }
  1088.     public function getExportacionStr():string
  1089.     {
  1090.         return $this->isExportacion() ? 'Exportacion' 'Europa';
  1091.     }
  1092.     public function getExportacion(): ?bool
  1093.     {
  1094.         return $this->exportacion;
  1095.     }
  1096.     public function setExportacion(?bool $exportacion): self
  1097.     {
  1098.         $this->exportacion $exportacion;
  1099.         return $this;
  1100.     }
  1101.     public function getDeletedAt(): ?DateTimeInterface
  1102.     {
  1103.         return $this->deletedAt;
  1104.     }
  1105.     public function setDeletedAt(?DateTimeInterface $deletedAt): self
  1106.     {
  1107.         $this->deletedAt $deletedAt;
  1108.         return $this;
  1109.     }
  1110.     public function getUpdatedAt(): ?DateTimeInterface
  1111.     {
  1112.         return $this->updatedAt;
  1113.     }
  1114.     public function setUpdatedAt(DateTimeInterface $updatedAt): self
  1115.     {
  1116.         $this->updatedAt $updatedAt;
  1117.         return $this;
  1118.     }
  1119.     public function getCreatedAt(): ?DateTimeInterface
  1120.     {
  1121.         return $this->createdAt;
  1122.     }
  1123.     public function setCreatedAt(DateTimeInterface $createdAt): self
  1124.     {
  1125.         $this->createdAt $createdAt;
  1126.         return $this;
  1127.     }
  1128.     public function getRegistroPolicial(): ?RegistroPolicial
  1129.     {
  1130.         return $this->registroPolicial;
  1131.     }
  1132.     public function setRegistroPolicial(?RegistroPolicial $registroPolicial): self
  1133.     {
  1134.         // unset the owning side of the relation if necessary
  1135.         if ($registroPolicial === null && $this->registroPolicial !== null) {
  1136.             $this->registroPolicial->setReloj(null);
  1137.         }
  1138.         // set the owning side of the relation if necessary
  1139.         if ($registroPolicial !== null && $registroPolicial->getReloj() !== $this) {
  1140.             $registroPolicial->setReloj($this);
  1141.         }
  1142.         $this->registroPolicial $registroPolicial;
  1143.         return $this;
  1144.     }
  1145.     /**
  1146.      * @return Collection|Gasto[]
  1147.      */
  1148.     public function getGastos(): Collection
  1149.     {
  1150.         return $this->gastos;
  1151.     }
  1152.     public function addGasto(Gasto $gasto): self
  1153.     {
  1154.         if (!$this->gastos->contains($gasto)) {
  1155.             $this->gastos[] = $gasto;
  1156.             $gasto->setReloj($this);
  1157.         }
  1158.         return $this;
  1159.     }
  1160.     public function removeGasto(Gasto $gasto): self
  1161.     {
  1162.         if ($this->gastos->removeElement($gasto)) {
  1163.             // set the owning side to null (unless already changed)
  1164.             if ($gasto->getReloj() === $this) {
  1165.                 $gasto->setReloj(null);
  1166.             }
  1167.         }
  1168.         return $this;
  1169.     }
  1170.     /**
  1171.      * @return Collection|Trazabilidad[]
  1172.      */
  1173.     public function getTrazas(): Collection
  1174.     {
  1175.         return $this->trazas;
  1176.     }
  1177.     public function addTraza(Trazabilidad $traza): self
  1178.     {
  1179.         if (!$this->trazas->contains($traza)) {
  1180.             $this->trazas[] = $traza;
  1181.             $traza->setReloj($this);
  1182.         }
  1183.         return $this;
  1184.     }
  1185.     public function removeTraza(Trazabilidad $traza): self
  1186.     {
  1187.         if ($this->trazas->removeElement($traza)) {
  1188.             // set the owning side to null (unless already changed)
  1189.             if ($traza->getReloj() === $this) {
  1190.                 $traza->setReloj(null);
  1191.             }
  1192.         }
  1193.         return $this;
  1194.     }
  1195.     public function getEstado(): ?EstadoReloj
  1196.     {
  1197.         return $this->estado;
  1198.     }
  1199.     public function setEstado(?EstadoReloj $estado): self
  1200.     {
  1201.         $this->estado $estado;
  1202.         return $this;
  1203.     }
  1204.     public function getMarca(): ?Marca
  1205.     {
  1206.         return $this->marca;
  1207.     }
  1208.     public function setMarca(?Marca $marca): self
  1209.     {
  1210.         $this->marca $marca;
  1211.         return $this;
  1212.     }
  1213.     /**
  1214.      * @return Collection|ValoracionesRelojes[]
  1215.      */
  1216.     public function getValoracionesRelojes(): Collection
  1217.     {
  1218.         return $this->valoracionesRelojes;
  1219.     }
  1220.     public function addValoracionesReloje(ValoracionesRelojes $valoracionesReloje): self
  1221.     {
  1222.         if (!$this->valoracionesRelojes->contains($valoracionesReloje)) {
  1223.             $this->valoracionesRelojes[] = $valoracionesReloje;
  1224.             $valoracionesReloje->setReloj($this);
  1225.         }
  1226.         return $this;
  1227.     }
  1228.     public function removeValoracionesReloje(ValoracionesRelojes $valoracionesReloje): self
  1229.     {
  1230.         if ($this->valoracionesRelojes->removeElement($valoracionesReloje)) {
  1231.             // set the owning side to null (unless already changed)
  1232.             if ($valoracionesReloje->getReloj() === $this) {
  1233.                 $valoracionesReloje->setReloj(null);
  1234.             }
  1235.         }
  1236.         return $this;
  1237.     }
  1238.     public function isStock(): ?bool
  1239.     {
  1240.         return $this->stock;
  1241.     }
  1242.     public function isReservado(): ?bool
  1243.     {
  1244.         return $this->reservado;
  1245.     }
  1246.     public function isExportacion(): ?bool
  1247.     {
  1248.         return $this->exportacion;
  1249.     }
  1250.     public function getFechaPromocion(): ?DateTimeInterface
  1251.     {
  1252.         return $this->fechaPromocion;
  1253.     }
  1254.     public function setFechaPromocion(?DateTimeInterface $fechaPromocion): self
  1255.     {
  1256.         $this->fechaPromocion $fechaPromocion;
  1257.         return $this;
  1258.     }
  1259.     public function getFechaVenta(): ?DateTimeInterface
  1260.     {
  1261.         return $this->fechaVenta;
  1262.     }
  1263.     public function setFechaVenta(?DateTimeInterface $fechaVenta): self
  1264.     {
  1265.         $this->fechaVenta $fechaVenta;
  1266.         return $this;
  1267.     }
  1268.     public function getMargenNeto(): ?float
  1269.     {
  1270.         return $this->margenNeto;
  1271.     }
  1272.     public function setMargenNeto(?float $margenNeto): self
  1273.     {
  1274.         $this->margenNeto $margenNeto;
  1275.         return $this;
  1276.     }
  1277.     public function isCustodia(): ?bool
  1278.     {
  1279.         return $this->custodia;
  1280.     }
  1281.     public function setCustodia(bool $custodia): self
  1282.     {
  1283.         $this->custodia $custodia;
  1284.         return $this;
  1285.     }
  1286.     public function getTiempoVenta(): ?float
  1287.     {
  1288.         return $this->tiempoVenta;
  1289.     }
  1290.     public function setTiempoVenta(?float $tiempoVenta): self
  1291.     {
  1292.         $this->tiempoVenta $tiempoVenta;
  1293.         return $this;
  1294.     }
  1295.     public function isEnPromocion(): ?bool
  1296.     {
  1297.         return $this->enPromocion;
  1298.     }
  1299.     public function setEnPromocion(?bool $enPromocion): self
  1300.     {
  1301.         $this->enPromocion $enPromocion;
  1302.         return $this;
  1303.     }
  1304.     public function isEnServicio(): ?bool
  1305.     {
  1306.         return $this->enServicio;
  1307.     }
  1308.     public function setEnServicio(?bool $enServicio): self
  1309.     {
  1310.         $this->enServicio $enServicio;
  1311.         return $this;
  1312.     }
  1313.     public function isTipoBloqueo(): ?bool
  1314.     {
  1315.         return $this->tipoBloqueo;
  1316.     }
  1317.     public function getAspecto(): ?EstadoAspecto
  1318.     {
  1319.         return $this->aspecto;
  1320.     }
  1321.     public function setAspecto(?EstadoAspecto $aspecto): self
  1322.     {
  1323.         $this->aspecto $aspecto;
  1324.         return $this;
  1325.     }
  1326.     public function getCheck(): ?EstadoCheck
  1327.     {
  1328.         return $this->check;
  1329.     }
  1330.     public function setCheck(?EstadoCheck $check): self
  1331.     {
  1332.         $this->check $check;
  1333.         return $this;
  1334.     }
  1335.     public function isSinAnunciar(): ?bool
  1336.     {
  1337.         return $this->sinAnunciar;
  1338.     }
  1339.     public function setSinAnunciar(?bool $sinAnunciar): self
  1340.     {
  1341.         $this->sinAnunciar $sinAnunciar;
  1342.         return $this;
  1343.     }
  1344.     public function isEnVenta(): ?bool
  1345.     {
  1346.         return $this->enVenta;
  1347.     }
  1348.     public function setEnVenta(?bool $enVenta): self
  1349.     {
  1350.         $this->enVenta $enVenta;
  1351.         return $this;
  1352.     }
  1353.     public function getUrlImage():string
  1354.     {
  1355.         /* TODO cogerlo de la configuracion vich */
  1356.         return '/uploads/reloj/'.$this->getId().'/'.$this->getFoto();
  1357.     }
  1358.     public function getFechaCompra(): ?DateTimeInterface
  1359.     {
  1360.         return $this->fechaCompra;
  1361.     }
  1362.     public function setFechaCompra(?DateTimeInterface $fechaCompra): static
  1363.     {
  1364.         $this->fechaCompra $fechaCompra;
  1365.         return $this;
  1366.     }
  1367.     public function getPromociones(): ?Promocion
  1368.     {
  1369.         return $this->promociones;
  1370.     }
  1371.     public function setPromociones(?Promocion $promociones): static
  1372.     {
  1373.         // unset the owning side of the relation if necessary
  1374.         if ($promociones === null && $this->promociones !== null) {
  1375.             $this->promociones->setReloj(null);
  1376.         }
  1377.         // set the owning side of the relation if necessary
  1378.         if ($promociones !== null && $promociones->getReloj() !== $this) {
  1379.             $promociones->setReloj($this);
  1380.         }
  1381.         $this->promociones $promociones;
  1382.         return $this;
  1383.     }
  1384.     public function getCodigo(): ?string
  1385.     {
  1386.         return $this->codigo;
  1387.     }
  1388.     public function setCodigo(string $codigo): static
  1389.     {
  1390.         $this->codigo $codigo;
  1391.         return $this;
  1392.     }
  1393.     public function getModelos(): ?string
  1394.     {
  1395.         return implode(' 'array_filter([$this->getModelo1(), $this->getModelo2()]));
  1396.     }
  1397.     /*public function setModelos(?string $modelos): static
  1398.     {
  1399.         $modelosArray = explode(',', $modelos);
  1400.         $this->setModelo1(@$modelosArray[0]);
  1401.         $this->setModelo2(@$modelosArray[1]);
  1402.         return $this;
  1403.     }*/
  1404.     public function getRefs(): ?string
  1405.     {
  1406.         return implode(''array_filter([$this->getRef1(), $this->getRef2()]));
  1407.     }
  1408.     /*public function setRefs(?string $refs): static
  1409.     {
  1410.         $refsArray = explode(',', $refs);
  1411.         $this->setRef1(@$refsArray[0]);
  1412.         $this->setRef2(@$refsArray[1]);
  1413.         return $this;
  1414.     }*/
  1415.     public function getActividad(): ?ActividadAbstract
  1416.     {
  1417.         return $this->actividad;
  1418.     }
  1419.     public function setActividad(?ActividadAbstract $actividad): static
  1420.     {
  1421.         // unset the owning side of the relation if necessary
  1422.         if ($actividad === null && $this->actividad !== null) {
  1423.             $this->actividad->setReloj(null);
  1424.         }
  1425.         // set the owning side of the relation if necessary
  1426.         if ($actividad !== null && $actividad->getReloj() !== $this) {
  1427.             $actividad->setReloj($this);
  1428.         }
  1429.         $this->actividad $actividad;
  1430.         return $this;
  1431.     }
  1432.     public function getFotoValoracion(): ?string
  1433.     {
  1434.         return $this->fotoValoracion;
  1435.     }
  1436.     public function setFotoValoracion(?string $fotoValoracion): static
  1437.     {
  1438.         $this->fotoValoracion $fotoValoracion;
  1439.         return $this;
  1440.     }
  1441.     public function getFotoValoracionFile(): ?File
  1442.     {
  1443.         return $this->fotoValoracionFile;
  1444.     }
  1445.     public function setFotoValoracionFile(?File $fotoValoracionFile): self
  1446.     {
  1447.         $this->fotoValoracionFile $fotoValoracionFile;
  1448.         if ($fotoValoracionFile) {
  1449.             // if 'updatedAt' is not defined in your entity, use another property
  1450.             $this->setUpdatedAt(new DateTime('now'));
  1451.         }
  1452.         return $this;
  1453.     }
  1454.     public function getFotoSet(): ?string
  1455.     {
  1456.         return $this->fotoSet;
  1457.     }
  1458.     public function setFotoSet(?string $fotoSet): static
  1459.     {
  1460.         $this->fotoSet $fotoSet;
  1461.         return $this;
  1462.     }
  1463.     public function getFotoSetFile(): ?File
  1464.     {
  1465.         return $this->fotoSetFile;
  1466.     }
  1467.     public function setFotoSetFile(?File $fotoSetFile): self
  1468.     {
  1469.         $this->fotoSetFile $fotoSetFile;
  1470.         if ($fotoSetFile) {
  1471.             // if 'updatedAt' is not defined in your entity, use another property
  1472.             $this->setUpdatedAt(new DateTime('now'));
  1473.         }
  1474.         return $this;
  1475.     }
  1476.     public function getFotoCrono(): ?string
  1477.     {
  1478.         return $this->fotoCrono;
  1479.     }
  1480.     public function setFotoCrono(?string $fotoCrono): static
  1481.     {
  1482.         $this->fotoCrono $fotoCrono;
  1483.         return $this;
  1484.     }
  1485.     public function getFotoCronoFile(): ?File
  1486.     {
  1487.         return $this->fotoCronoFile;
  1488.     }
  1489.     public function setFotoCronoFile(?File $fotoCronoFile): self
  1490.     {
  1491.         $this->fotoCronoFile $fotoCronoFile;
  1492.         if ($fotoCronoFile) {
  1493.             // if 'updatedAt' is not defined in your entity, use another property
  1494.             $this->setUpdatedAt(new DateTime('now'));
  1495.         }
  1496.         return $this;
  1497.     }
  1498.     public function getVideo(): ?string
  1499.     {
  1500.         return $this->video;
  1501.     }
  1502.     public function setVideo(?string $video): static
  1503.     {
  1504.         $this->video $video;
  1505.         return $this;
  1506.     }
  1507.     public function getVideoFile(): ?File
  1508.     {
  1509.         return $this->videoFile;
  1510.     }
  1511.     public function setVideoFile(?File $videoFile): self
  1512.     {
  1513.         $this->videoFile $videoFile;
  1514.         if ($videoFile) {
  1515.             // if 'updatedAt' is not defined in your entity, use another property
  1516.             $this->setUpdatedAt(new DateTime('now'));
  1517.         }
  1518.         return $this;
  1519.     }
  1520.     /**
  1521.      * @return bool|null
  1522.      * @deprecated Por cambios de funcionalidad
  1523.      */
  1524.     public function isChrono24(): ?bool
  1525.     {
  1526.         return $this->chrono24;
  1527.     }
  1528.     /**
  1529.      * @deprecated Por cambios de funcionalidad
  1530.      * @param bool|null $chrono24
  1531.      * @return $this
  1532.      */
  1533.     public function setChrono24(?bool $chrono24): static
  1534.     {
  1535.         $this->chrono24 $chrono24;
  1536.         return $this;
  1537.     }
  1538.     /**
  1539.      * @return Collection<int, DetalleVenta>
  1540.      */
  1541.     public function getDetalleVenta(): Collection
  1542.     {
  1543.         return $this->detalleVenta;
  1544.     }
  1545.     public function getDetalleVentaAsentada(): ?DetalleVenta
  1546.     {
  1547.         return ($this->getDetalleVenta()->filter(fn($dc) => $dc->getVenta()->getOperacion()->getEstado()->getKey() === EstadoOperacionEnum::ESTADO_ASENTADA))->first();
  1548.     }
  1549.     public function addDetalleVentum(DetalleVenta $detalleVentum): static
  1550.     {
  1551.         if (!$this->detalleVenta->contains($detalleVentum)) {
  1552.             $this->detalleVenta->add($detalleVentum);
  1553.             $detalleVentum->setReloj($this);
  1554.         }
  1555.         return $this;
  1556.     }
  1557.     public function removeDetalleVentum(DetalleVenta $detalleVentum): static
  1558.     {
  1559.         if ($this->detalleVenta->removeElement($detalleVentum)) {
  1560.             // set the owning side to null (unless already changed)
  1561.             if ($detalleVentum->getReloj() === $this) {
  1562.                 $detalleVentum->setReloj(null);
  1563.             }
  1564.         }
  1565.         return $this;
  1566.     }
  1567.     public function getPrecioCompra(): ?float
  1568.     {
  1569.         return $this->precioCompra;
  1570.     }
  1571.     public function setPrecioCompra(?float $precioCompra): static
  1572.     {
  1573.         $this->precioCompra $precioCompra;
  1574.         return $this;
  1575.     }
  1576.     /**
  1577.      * @deprecated A partir del 04/06/2024 cuando se realiza el ciclo completo sustituir por "getOperacionCompra"
  1578.      * @return Operacion|null
  1579.      */
  1580.     public function getOperacion():?Operacion
  1581.     {
  1582.         return $this->getDetalleCompra()?->getCompra()?->getOperacion();
  1583.     }
  1584.     public function getOperacionCompra():?Operacion
  1585.     {
  1586.         //return $this->getDetalleCompra()?->getCompra()?->getOperacion()->filter(fn($operacion) => $operacion->getEstado()?->getKey() === EstadoOperacionEnum::ESTADO_CONFIRMADA || $operacion->getEstado()?->getKey() === EstadoOperacionEnum::ESTADO_ASENTADA);
  1587.         return $this->operacionCompra;
  1588.     }
  1589.     public function getOperacionGestionCompra():?Operacion
  1590.     {
  1591.         return $this->getOperacionCompra()??$this->getOperacionGestion();
  1592.     }
  1593.     public function getOperacionVenta():?Operacion
  1594.     {
  1595.         /*$detalle = $this->getDetalleVenta();
  1596.         if($detalle->count() !== 1 && $detalle->count() !== 0) throw new Exception('ERROR, PENDIENTE de resolver / controlar');
  1597.         return $detalle->count() === 0 ? null : $this->getDetalleVenta()->first()->getVenta()?->getOperacion();*/
  1598.         try {
  1599.             if ($this->operacionVenta?->getDeletedAt() === null) return $this->operacionVenta;
  1600.         }
  1601.         catch(EntityNotFoundException $e)
  1602.         {
  1603.             return null;
  1604.         }
  1605.         return $this->operacionVenta;
  1606.     }
  1607.     public function getRecompra(): ?float
  1608.     {
  1609.         return $this->recompra;
  1610.     }
  1611.     public function setRecompra(?float $recompra): static
  1612.     {
  1613.         $this->recompra $recompra;
  1614.         return $this;
  1615.     }
  1616.     public function getGarantia(): ?string
  1617.     {
  1618.         return $this->garantia;
  1619.     }
  1620.     public function setGarantia(?string $garantia): static
  1621.     {
  1622.         $this->garantia $garantia;
  1623.         return $this;
  1624.     }
  1625.     public function getOperacionGestion(): ?Operacion
  1626.     {
  1627.         return $this->operacionGestion;
  1628.     }
  1629.     public function setOperacionGestion(?Operacion $operacionGestion): static
  1630.     {
  1631.         $this->operacionGestion $operacionGestion;
  1632.         return $this;
  1633.     }
  1634.     public function setOperacionVenta(?Operacion $operacionVenta): static
  1635.     {
  1636.         $this->operacionVenta $operacionVenta;
  1637.         return $this;
  1638.     }
  1639.     public function setOperacionCompra(?Operacion $operacionCompra): static
  1640.     {
  1641.         $this->operacionCompra $operacionCompra;
  1642.         return $this;
  1643.     }
  1644.     public function getActividadCompra(): ?ActividadCompra
  1645.     {
  1646.         return $this->actividadCompra;
  1647.     }
  1648.     public function setActividadCompra(?ActividadCompra $actividadCompra): static
  1649.     {
  1650.         // unset the owning side of the relation if necessary
  1651.         if ($actividadCompra === null && $this->actividadCompra !== null) {
  1652.             $this->actividadCompra->setReloj(null);
  1653.         }
  1654.         // set the owning side of the relation if necessary
  1655.         if ($actividadCompra !== null && $actividadCompra->getReloj() !== $this) {
  1656.             $actividadCompra->setReloj($this);
  1657.         }
  1658.         $this->actividadCompra $actividadCompra;
  1659.         return $this;
  1660.     }
  1661.     public function getActividadVenta(): ?ActividadVenta
  1662.     {
  1663.         return $this->actividadVenta;
  1664.     }
  1665.     public function setActividadVenta(?ActividadVenta $actividadVenta): static
  1666.     {
  1667.         // unset the owning side of the relation if necessary
  1668.         if ($actividadVenta === null && $this->actividadVenta !== null) {
  1669.             $this->actividadVenta->setReloj(null);
  1670.         }
  1671.         // set the owning side of the relation if necessary
  1672.         if ($actividadVenta !== null && $actividadVenta->getReloj() !== $this) {
  1673.             $actividadVenta->setReloj($this);
  1674.         }
  1675.         $this->actividadVenta $actividadVenta;
  1676.         return $this;
  1677.     }
  1678.     public function getPeso(): ?float
  1679.     {
  1680.         return $this->peso;
  1681.     }
  1682.     public function setPeso(?float $peso): static
  1683.     {
  1684.         $this->peso $peso;
  1685.         return $this;
  1686.     }
  1687.     public function getDescripcion(): ?string
  1688.     {
  1689.         return $this->descripcion;
  1690.     }
  1691.     public function setDescripcion(?string $descripcion): static
  1692.     {
  1693.         $this->descripcion $descripcion;
  1694.         return $this;
  1695.     }
  1696.     public function getFechaStr(): ?string
  1697.     {
  1698.         return $this->fecha?->format("d/m/Y");
  1699.     }
  1700.     public function getExportPeso():?string
  1701.     {
  1702.         return number_format($this->peso2',''.') . ' g.';
  1703.     }
  1704.     public function getExportPrecioCompra():?string
  1705.     {
  1706.         return number_format($this->precioCompra2',''.') . ' €';
  1707.     }
  1708.     /**
  1709.      * @return Collection<int, DetalleCompra>
  1710.      */
  1711.     public function getDetalleCompra(): Collection
  1712.     {
  1713.         return $this->detalleCompra;
  1714.     }
  1715.     public function getDetalleCompraAsentada(): ?DetalleCompra
  1716.     {
  1717.         return ($this->getDetalleCompra()->filter(fn($dc) => $dc->getCompra()->getOperacion()->getTipo() === TipoOperacionEnum::OPERACION_COMPRA || $dc->getCompra()->getOperacion()->getTipo() === TipoOperacionEnum::OPERACION_PERMUTA))->first();
  1718.     }
  1719.     public function addDetalleCompra(DetalleCompra $detalleCompra): static
  1720.     {
  1721.         if (!$this->detalleCompra->contains($detalleCompra)) {
  1722.             $this->detalleCompra->add($detalleCompra);
  1723.             $detalleCompra->setReloj($this);
  1724.         }
  1725.         return $this;
  1726.     }
  1727.     public function removeDetalleCompra(DetalleCompra $detalleCompra): static
  1728.     {
  1729.         if ($this->detalleCompra->removeElement($detalleCompra)) {
  1730.             // set the owning side to null (unless already changed)
  1731.             if ($detalleCompra->getReloj() === $this) {
  1732.                 $detalleCompra->setReloj(null);
  1733.             }
  1734.         }
  1735.         return $this;
  1736.     }
  1737.     public function getTiempoEnVenta(): ?int
  1738.     {
  1739.         return $this->tiempoEnVenta;
  1740.     }
  1741.     public function setTiempoEnVenta(?int $tiempoEnVenta): static
  1742.     {
  1743.         $this->tiempoEnVenta $tiempoEnVenta;
  1744.         return $this;
  1745.     }
  1746.     public function getTiempoEnStock(): ?int
  1747.     {
  1748.         return $this->tiempoEnStock;
  1749.     }
  1750.     public function setTiempoEnStock(?int $tiempoEnStock): static
  1751.     {
  1752.         $this->tiempoEnStock $tiempoEnStock;
  1753.         return $this;
  1754.     }
  1755.     public function getFechaRecepcion(): ?DateTimeInterface
  1756.     {
  1757.         return $this->fechaRecepcion;
  1758.     }
  1759.     public function getFechaRecepcionStr(): ?string
  1760.     {
  1761.         return $this->fechaRecepcion?->format("d/m/Y");
  1762.     }
  1763.     public function setFechaRecepcion(?DateTimeInterface $fechaRecepcion): static
  1764.     {
  1765.         $this->fechaRecepcion $fechaRecepcion;
  1766.         return $this;
  1767.     }
  1768.     public function getFechaValoracion(): ?DateTimeInterface
  1769.     {
  1770.         return $this->fechaValoracion;
  1771.     }
  1772.     public function setFechaValoracion(?DateTimeInterface $fechaValoracion): static
  1773.     {
  1774.         $this->fechaValoracion $fechaValoracion;
  1775.         return $this;
  1776.     }
  1777.     public function getFechaAnuncio(): ?DateTimeInterface
  1778.     {
  1779.         return $this->fechaAnuncio;
  1780.     }
  1781.     public function setFechaAnuncio(?DateTimeInterface $fechaAnuncio): static
  1782.     {
  1783.         $this->fechaAnuncio $fechaAnuncio;
  1784.         return $this;
  1785.     }
  1786.     public function getValoracion(): ?Valoracion
  1787.     {
  1788.         return $this->valoracion;
  1789.     }
  1790.     public function setValoracion(?Valoracion $valoracion): static
  1791.     {
  1792.         $this->valoracion $valoracion;
  1793.         return $this;
  1794.     }
  1795.     public function getValoracionReloj(): ?ValoracionesRelojesSinStock
  1796.     {
  1797.         return $this->valoracionReloj;
  1798.     }
  1799.     public function setValoracionReloj(?ValoracionesRelojesSinStock $valoracionReloj): static
  1800.     {
  1801.         // unset the owning side of the relation if necessary
  1802.         if ($valoracionReloj === null && $this->valoracionReloj !== null) {
  1803.             $this->valoracionReloj->setRelojInventario(null);
  1804.         }
  1805.         // set the owning side of the relation if necessary
  1806.         if ($valoracionReloj !== null && $valoracionReloj->getRelojInventario() !== $this) {
  1807.             $valoracionReloj->setRelojInventario($this);
  1808.         }
  1809.         $this->valoracionReloj $valoracionReloj;
  1810.         return $this;
  1811.     }
  1812.     public function hasBeenSold():bool
  1813.     {
  1814.         if($this->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_VENDIDO) return true;
  1815.         if($this->getFechaVenta()) return true;
  1816.         $criteria Criteria::create()
  1817.             ->orderBy(['fecha' => Criteria::DESC])
  1818.             ->setMaxResults(1);
  1819.         $ultimaAccion $this->getPromociones()?->getAcciones()
  1820.             ?->filter(fn($accion) => $accion instanceof AccionEstado)
  1821.             ?->matching($criteria)
  1822.             ?->first();
  1823.         return $ultimaAccion?->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_VENDIDO;
  1824.     }
  1825.     public function hasBeenBought():bool
  1826.     {
  1827.         if($this->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_COMPRA) return true;
  1828.         if($this->getFechaCompra()) return true;
  1829.         $criteria Criteria::create()
  1830.             ->orderBy(['fecha' => Criteria::DESC])
  1831.             ->setMaxResults(1);
  1832.         $ultimaAccion $this->getPromociones()?->getAcciones()
  1833.             ?->filter(fn($accion) => $accion instanceof AccionEstado)
  1834.             ?->matching($criteria)
  1835.             ?->first();
  1836.         return $ultimaAccion?->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_COMPRA;
  1837.     }
  1838.     public function getGenero(): ?GeneroRelojEnum
  1839.     {
  1840.         return $this->genero;
  1841.     }
  1842.     public function setGenero(?GeneroRelojEnum $genero): static
  1843.     {
  1844.         $this->genero $genero;
  1845.         return $this;
  1846.     }
  1847.     public function getEstadoCaja(): ?int
  1848.     {
  1849.         return $this->estadoCaja;
  1850.     }
  1851.     public function setEstadoCaja(?int $estadoCaja): static
  1852.     {
  1853.         $this->estadoCaja $estadoCaja;
  1854.         return $this;
  1855.     }
  1856.     public function getEstadoCristal(): ?int
  1857.     {
  1858.         return $this->estadoCristal;
  1859.     }
  1860.     public function setEstadoCristal(?int $estadoCristal): static
  1861.     {
  1862.         $this->estadoCristal $estadoCristal;
  1863.         return $this;
  1864.     }
  1865.     public function getEstadoDial(): ?int
  1866.     {
  1867.         return $this->estadoDial;
  1868.     }
  1869.     public function setEstadoDial(?int $estadoDial): static
  1870.     {
  1871.         $this->estadoDial $estadoDial;
  1872.         return $this;
  1873.     }
  1874.     public function getEstadoAgujas(): ?int
  1875.     {
  1876.         return $this->estadoAgujas;
  1877.     }
  1878.     public function setEstadoAgujas(?int $estadoAgujas): static
  1879.     {
  1880.         $this->estadoAgujas $estadoAgujas;
  1881.         return $this;
  1882.     }
  1883.     public function getEstadoTapa(): ?int
  1884.     {
  1885.         return $this->estadoTapa;
  1886.     }
  1887.     public function setEstadoTapa(?int $estadoTapa): static
  1888.     {
  1889.         $this->estadoTapa $estadoTapa;
  1890.         return $this;
  1891.     }
  1892.     public function getEstadoCorrea(): ?int
  1893.     {
  1894.         return $this->estadoCorrea;
  1895.     }
  1896.     public function setEstadoCorrea(?int $estadoCorrea): static
  1897.     {
  1898.         $this->estadoCorrea $estadoCorrea;
  1899.         return $this;
  1900.     }
  1901.     public function getEsferaIndice(): ?TipoEsferaIndiceEnum
  1902.     {
  1903.         return $this->esferaIndice;
  1904.     }
  1905.     public function setEsferaIndice(?TipoEsferaIndiceEnum $esferaIndice): static
  1906.     {
  1907.         $this->esferaIndice $esferaIndice;
  1908.         return $this;
  1909.     }
  1910.     public function getEsferaColor(): ?string
  1911.     {
  1912.         return $this->esferaColor;
  1913.     }
  1914.     public function setEsferaColor(?string $esferaColor): static
  1915.     {
  1916.         $this->esferaColor $esferaColor;
  1917.         return $this;
  1918.     }
  1919.     public function isEsferaJoyas(): ?bool
  1920.     {
  1921.         return $this->esferaJoyas;
  1922.     }
  1923.     public function setEsferaJoyas(?bool $esferaJoyas): static
  1924.     {
  1925.         $this->esferaJoyas $esferaJoyas;
  1926.         return $this;
  1927.     }
  1928.     public function getCajaRelojDiametro(): ?int
  1929.     {
  1930.         return $this->cajaRelojDiametro;
  1931.     }
  1932.     public function setCajaRelojDiametro(?int $cajaRelojDiametro): static
  1933.     {
  1934.         $this->cajaRelojDiametro $cajaRelojDiametro;
  1935.         return $this;
  1936.     }
  1937.     public function getCajaRelojGrosor(): ?int
  1938.     {
  1939.         return $this->cajaRelojGrosor;
  1940.     }
  1941.     public function setCajaRelojGrosor(?int $cajaRelojGrosor): static
  1942.     {
  1943.         $this->cajaRelojGrosor $cajaRelojGrosor;
  1944.         return $this;
  1945.     }
  1946.     public function getCajaRelojResistenciaAgua(): ?int
  1947.     {
  1948.         return $this->cajaRelojResistenciaAgua;
  1949.     }
  1950.     public function setCajaRelojResistenciaAgua(?int $cajaRelojResistenciaAgua): static
  1951.     {
  1952.         $this->cajaRelojResistenciaAgua $cajaRelojResistenciaAgua;
  1953.         return $this;
  1954.     }
  1955.     public function getCajaRelojCristal(): ?TipoCristalEnum
  1956.     {
  1957.         return $this->cajaRelojCristal;
  1958.     }
  1959.     public function setCajaRelojCristal(?TipoCristalEnum $cajaRelojCristal): static
  1960.     {
  1961.         $this->cajaRelojCristal $cajaRelojCristal;
  1962.         return $this;
  1963.     }
  1964.     public function getPulseraColor(): ?string
  1965.     {
  1966.         return $this->pulseraColor;
  1967.     }
  1968.     public function setPulseraColor(?string $pulseraColor): static
  1969.     {
  1970.         $this->pulseraColor $pulseraColor;
  1971.         return $this;
  1972.     }
  1973.     public function getPulseraCierre(): ?TipoCierreEnum
  1974.     {
  1975.         return $this->pulseraCierre;
  1976.     }
  1977.     public function setPulseraCierre(?TipoCierreEnum $pulseraCierre): static
  1978.     {
  1979.         $this->pulseraCierre $pulseraCierre;
  1980.         return $this;
  1981.     }
  1982.     public function getPulseraAnchoCaja(): ?int
  1983.     {
  1984.         return $this->pulseraAnchoCaja;
  1985.     }
  1986.     public function setPulseraAnchoCaja(?int $pulseraAnchoCaja): static
  1987.     {
  1988.         $this->pulseraAnchoCaja $pulseraAnchoCaja;
  1989.         return $this;
  1990.     }
  1991.     public function getPulseraAnchoCierre(): ?int
  1992.     {
  1993.         return $this->pulseraAnchoCierre;
  1994.     }
  1995.     public function setPulseraAnchoCierre(?int $pulseraAnchoCierre): static
  1996.     {
  1997.         $this->pulseraAnchoCierre $pulseraAnchoCierre;
  1998.         return $this;
  1999.     }
  2000.     public function getPulseraMedidaMunieca(): ?int
  2001.     {
  2002.         return $this->pulseraMedidaMunieca;
  2003.     }
  2004.     public function setPulseraMedidaMunieca(?int $pulseraMedidaMunieca): static
  2005.     {
  2006.         $this->pulseraMedidaMunieca $pulseraMedidaMunieca;
  2007.         return $this;
  2008.     }
  2009.     public function getCalibre(): ?CalibreEnum
  2010.     {
  2011.         return $this->calibre;
  2012.     }
  2013.     public function setCalibre(?CalibreEnum $calibre): static
  2014.     {
  2015.         $this->calibre $calibre;
  2016.         return $this;
  2017.     }
  2018.     public function getCalibreAvanzado(): ?string
  2019.     {
  2020.         return $this->calibreAvanzado;
  2021.     }
  2022.     public function setCalibreAvanzado(?string $calibreAvanzado): static
  2023.     {
  2024.         $this->calibreAvanzado $calibreAvanzado;
  2025.         return $this;
  2026.     }
  2027.     public function getCalibreBasico(): ?string
  2028.     {
  2029.         return $this->calibreBasico;
  2030.     }
  2031.     public function setCalibreBasico(?string $calibreBasico): static
  2032.     {
  2033.         $this->calibreBasico $calibreBasico;
  2034.         return $this;
  2035.     }
  2036.     public function getCalibreReservaMarcha(): ?string
  2037.     {
  2038.         return $this->calibreReservaMarcha;
  2039.     }
  2040.     public function setCalibreReservaMarcha(?string $calibreReservaMarcha): static
  2041.     {
  2042.         $this->calibreReservaMarcha $calibreReservaMarcha;
  2043.         return $this;
  2044.     }
  2045.     public function getCalibreNumeroJoyas(): ?string
  2046.     {
  2047.         return $this->calibreNumeroJoyas;
  2048.     }
  2049.     public function setCalibreNumeroJoyas(?string $calibreNumeroJoyas): static
  2050.     {
  2051.         $this->calibreNumeroJoyas $calibreNumeroJoyas;
  2052.         return $this;
  2053.     }
  2054.     public function getCalibreOscilacion(): ?string
  2055.     {
  2056.         return $this->calibreOscilacion;
  2057.     }
  2058.     public function setCalibreOscilacion(?string $calibreOscilacion): static
  2059.     {
  2060.         $this->calibreOscilacion $calibreOscilacion;
  2061.         return $this;
  2062.     }
  2063.     public function getCalibreAmplitud(): ?string
  2064.     {
  2065.         return $this->calibreAmplitud;
  2066.     }
  2067.     public function setCalibreAmplitud(?string $calibreAmplitud): static
  2068.     {
  2069.         $this->calibreAmplitud $calibreAmplitud;
  2070.         return $this;
  2071.     }
  2072.     public function getCalibreMarcha(): ?string
  2073.     {
  2074.         return $this->calibreMarcha;
  2075.     }
  2076.     public function setCalibreMarcha(?string $calibreMarcha): static
  2077.     {
  2078.         $this->calibreMarcha $calibreMarcha;
  2079.         return $this;
  2080.     }
  2081.     public function getPiezasRepuesto(): ?PiezaRepuestoEnum
  2082.     {
  2083.         return $this->piezasRepuesto;
  2084.     }
  2085.     public function setPiezasRepuesto(?PiezaRepuestoEnum $piezasRepuesto): static
  2086.     {
  2087.         $this->piezasRepuesto $piezasRepuesto;
  2088.         return $this;
  2089.     }
  2090.     public function getPiezasRepuestoObservaciones(): ?string
  2091.     {
  2092.         return $this->piezasRepuestoObservaciones;
  2093.     }
  2094.     public function setPiezasRepuestoObservaciones(?string $piezasRepuestoObservaciones): static
  2095.     {
  2096.         $this->piezasRepuestoObservaciones $piezasRepuestoObservaciones;
  2097.         return $this;
  2098.     }
  2099.     public function getServicioMantenimiento(): ?ServicioMantenimientoEnum
  2100.     {
  2101.         return $this->servicioMantenimiento;
  2102.     }
  2103.     public function setServicioMantenimiento(?ServicioMantenimientoEnum $servicioMantenimiento): static
  2104.     {
  2105.         $this->servicioMantenimiento $servicioMantenimiento;
  2106.         return $this;
  2107.     }
  2108.     public function getCondiciones(): ?string
  2109.     {
  2110.         return $this->condiciones;
  2111.     }
  2112.     public function setCondiciones(?string $condiciones): static
  2113.     {
  2114.         $this->condiciones $condiciones;
  2115.         return $this;
  2116.     }
  2117.     public function getAnuncioES(): ?string
  2118.     {
  2119.         return $this->anuncioES;
  2120.     }
  2121.     public function setAnuncioES(?string $anuncioES): static
  2122.     {
  2123.         $this->anuncioES $anuncioES;
  2124.         return $this;
  2125.     }
  2126.     public function getAnuncioEN(): ?string
  2127.     {
  2128.         return $this->anuncioEN;
  2129.     }
  2130.     public function setAnuncioEN(?string $anuncioEN): static
  2131.     {
  2132.         $this->anuncioEN $anuncioEN;
  2133.         return $this;
  2134.     }
  2135.     public function getEmpresa(): ?Empresa
  2136.     {
  2137.         return $this->empresa;
  2138.     }
  2139.     public function setEmpresa(?Empresa $empresa): static
  2140.     {
  2141.         $this->empresa $empresa;
  2142.         return $this;
  2143.     }
  2144.     public function getCajaRelojMaterial(): ?Material
  2145.     {
  2146.         return $this->cajaRelojMaterial;
  2147.     }
  2148.     public function setCajaRelojMaterial(?Material $cajaRelojMaterial): static
  2149.     {
  2150.         $this->cajaRelojMaterial $cajaRelojMaterial;
  2151.         return $this;
  2152.     }
  2153.     public function getCajaRelojMaterialBisel(): ?Material
  2154.     {
  2155.         return $this->cajaRelojMaterialBisel;
  2156.     }
  2157.     public function setCajaRelojMaterialBisel(?Material $cajaRelojMaterialBisel): static
  2158.     {
  2159.         $this->cajaRelojMaterialBisel $cajaRelojMaterialBisel;
  2160.         return $this;
  2161.     }
  2162.     public function getPulseraMaterial(): ?Material
  2163.     {
  2164.         return $this->pulseraMaterial;
  2165.     }
  2166.     public function setPulseraMaterial(?Material $pulseraMaterial): static
  2167.     {
  2168.         $this->pulseraMaterial $pulseraMaterial;
  2169.         return $this;
  2170.     }
  2171.     public function getPulseraMaterialCierre(): ?Material
  2172.     {
  2173.         return $this->pulseraMaterialCierre;
  2174.     }
  2175.     public function setPulseraMaterialCierre(?Material $pulseraMaterialCierre): static
  2176.     {
  2177.         $this->pulseraMaterialCierre $pulseraMaterialCierre;
  2178.         return $this;
  2179.     }
  2180.     public function getCalibreCaracteristicas(): ?array
  2181.     {
  2182.         return $this->calibreCaracteristicas;
  2183.     }
  2184.     public function setCalibreCaracteristicas(?array $calibreCaracteristicas): static
  2185.     {
  2186.         $this->calibreCaracteristicas $calibreCaracteristicas;
  2187.         return $this;
  2188.     }
  2189.     public function getCalibreFunciones(): ?array
  2190.     {
  2191.         return $this->calibreFunciones;
  2192.     }
  2193.     public function setCalibreFunciones(?array $calibreFunciones): static
  2194.     {
  2195.         $this->calibreFunciones $calibreFunciones;
  2196.         return $this;
  2197.     }
  2198.     public function getDescripcionDetallada(): ?string
  2199.     {
  2200.         return $this->descripcionDetallada;
  2201.     }
  2202.     public function setDescripcionDetallada(?string $descripcionDetallada): static
  2203.     {
  2204.         $this->descripcionDetallada $descripcionDetallada;
  2205.         return $this;
  2206.     }
  2207.     public function getPapelesStr():string
  2208.     {
  2209.         return $this->getPapeles() ? 'reloj.con_papeles' 'reloj.sin_papeles';
  2210.     }
  2211.     public function getCajaStr():string
  2212.     {
  2213.         return $this->getCaja() ? 'reloj.con_caja' 'reloj.sin_caja';
  2214.     }
  2215.     /**
  2216.      * @return Collection<int, DetalleCompra>
  2217.      */
  2218.     public function getRelojesDerivadosDetalleCompra(): Collection
  2219.     {
  2220.         return $this->relojesDerivadosDetalleCompra;
  2221.     }
  2222.     public function addRelojesDerivadosDetalleCompra(DetalleCompra $relojesDerivadosDetalleCompra): static
  2223.     {
  2224.         if (!$this->relojesDerivadosDetalleCompra->contains($relojesDerivadosDetalleCompra)) {
  2225.             $this->relojesDerivadosDetalleCompra->add($relojesDerivadosDetalleCompra);
  2226.             $relojesDerivadosDetalleCompra->setRelojBaseCompra($this);
  2227.         }
  2228.         return $this;
  2229.     }
  2230.     public function removeRelojesDerivadosDetalleCompra(DetalleCompra $relojesDerivadosDetalleCompra): static
  2231.     {
  2232.         if ($this->relojesDerivadosDetalleCompra->removeElement($relojesDerivadosDetalleCompra)) {
  2233.             // set the owning side to null (unless already changed)
  2234.             if ($relojesDerivadosDetalleCompra->getRelojBaseCompra() === $this) {
  2235.                 $relojesDerivadosDetalleCompra->setRelojBaseCompra(null);
  2236.             }
  2237.         }
  2238.         return $this;
  2239.     }
  2240.     /**
  2241.      * @return Collection<int, ValoracionesRelojesSinStock>
  2242.      */
  2243.     public function getRelojesDerivadosValoracionSinStock(): Collection
  2244.     {
  2245.         return $this->relojesDerivadosValoracionSinStock;
  2246.     }
  2247.     public function addRelojesDerivadosValoracionSinStock(ValoracionesRelojesSinStock $relojesDerivadosValoracionSinStock): static
  2248.     {
  2249.         if (!$this->relojesDerivadosValoracionSinStock->contains($relojesDerivadosValoracionSinStock)) {
  2250.             $this->relojesDerivadosValoracionSinStock->add($relojesDerivadosValoracionSinStock);
  2251.             $relojesDerivadosValoracionSinStock->setRelojBaseSinStock($this);
  2252.         }
  2253.         return $this;
  2254.     }
  2255.     public function removeRelojesDerivadosValoracionSinStock(ValoracionesRelojesSinStock $relojesDerivadosValoracionSinStock): static
  2256.     {
  2257.         if ($this->relojesDerivadosValoracionSinStock->removeElement($relojesDerivadosValoracionSinStock)) {
  2258.             // set the owning side to null (unless already changed)
  2259.             if ($relojesDerivadosValoracionSinStock->getRelojBaseSinStock() === $this) {
  2260.                 $relojesDerivadosValoracionSinStock->setRelojBaseSinStock(null);
  2261.             }
  2262.         }
  2263.         return $this;
  2264.     }
  2265.     /**
  2266.      * @return Collection<int, Reloj>
  2267.      */
  2268.     public function getRelojesDerivados(): Collection
  2269.     {
  2270.         return $this->relojesDerivados;
  2271.     }
  2272.     public function addRelojesDerivado(Reloj $relojesDerivado): static
  2273.     {
  2274.         if (!$this->relojesDerivados->contains($relojesDerivado)) {
  2275.             $this->relojesDerivados->add($relojesDerivado);
  2276.             $relojesDerivado->setRelojBase($this);
  2277.         }
  2278.         return $this;
  2279.     }
  2280.     public function removeRelojesDerivado(Reloj $relojesDerivado): static
  2281.     {
  2282.         if ($this->relojesDerivados->removeElement($relojesDerivado)) {
  2283.             // set the owning side to null (unless already changed)
  2284.             if ($relojesDerivado->getRelojBase() === $this) {
  2285.                 $relojesDerivado->setRelojBase(null);
  2286.             }
  2287.         }
  2288.         return $this;
  2289.     }
  2290.     public function getRelojBase(): ?self
  2291.     {
  2292.         return $this->relojBase;
  2293.     }
  2294.     public function setRelojBase(?self $relojBase): static
  2295.     {
  2296.         $this->relojBase $relojBase;
  2297.         return $this;
  2298.     }
  2299.     public function isCompraDirecta(): ?bool
  2300.     {
  2301.         return $this->compraDirecta;
  2302.     }
  2303.     public function setCompraDirecta(?bool $compraDirecta): static
  2304.     {
  2305.         $this->compraDirecta $compraDirecta;
  2306.         return $this;
  2307.     }
  2308.     public function isSold():bool
  2309.     {
  2310.         return $this->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_VENDIDO;
  2311.     }
  2312.     public function isSend():bool
  2313.     {
  2314.         return $this->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_ENVIADO;
  2315.     }
  2316.     public function updateDerivedTimes()
  2317.     {
  2318.         /*$criteria = Criteria::create()
  2319.             ->orderBy([
  2320.                 'fecha' => Criteria::ASC,
  2321.                 'created_at' => Criteria::ASC,
  2322.             ]);
  2323.         $accion = $this->getPromociones()?->getAcciones()
  2324.             ->filter(fn($accion) => $accion instanceof AccionEstado && $accion->getEstado()?->getKey() === EstadoRelojEnum::ESTADO_ANUNCIO)
  2325.             ->matching($criteria)
  2326.             ->first();*/
  2327. //        $fechaAnuncio = ($accion && $accion?->getFecha()) ? clone $accion->getFecha() : null;
  2328.         $fechaAnuncio $this->getFechaAnuncio() ? clone $this->getFechaAnuncio() : null;
  2329.         if($fechaAnuncio$fechaAnuncio->setTime(0,0,0);
  2330.         $fechaVenta $this->getFechaVenta() ? clone $this->getFechaVenta() : new DateTime();
  2331.         $fechaVenta->setTime(0,0,0);
  2332.         $fechaCompra $this->getFechaCompra() ? clone $this->getFechaCompra() : new DateTime();
  2333.         $fechaCompra->setTime(0,0,0);
  2334.         $this->tiempoEnVenta = ($fechaVenta && $fechaAnuncio) ? $fechaVenta->diff($fechaAnuncio)->days null;
  2335.         $this->tiempoEnStock = ($fechaVenta && $fechaCompra) ? $fechaVenta->diff($fechaCompra)->days null;
  2336.     }
  2337. }