src/Entity/Reloj.php line 36

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