src/Entity/Reloj.php line 35

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