src/Entity/ActividadAbstract.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\EstadoActividadEnum;
  4. use App\Validator as PerseoAssert;
  5. use DateTime;
  6. use DateTimeInterface;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  13. /**
  14.  * @ORM\Entity(repositoryClass="App\Repository\ActividadAbstractRepository")
  15.  * @ORM\Table(name="actividad", schema="perseo")
  16.  * @ORM\EntityListeners({
  17.  *     "App\EntityListener\Actividad\CalcularIDPerseoListener",
  18.  *     "App\EntityListener\Actividad\UpdateDatesListener"
  19.  * })
  20.  * @ORM\InheritanceType("SINGLE_TABLE")
  21.  * @ORM\DiscriminatorColumn(name="type", type="string")
  22.  * @ORM\DiscriminatorMap({"compra":"App\Entity\ActividadCompra","venta":"App\Entity\ActividadVenta"})
  23.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  24.  * @Vich\Uploadable
  25.  * @PerseoAssert\ContraintsValidarEntidadCp()
  26.  */
  27. Abstract class ActividadAbstract
  28. {
  29.     /**
  30.      * @ORM\Id
  31.      * @ORM\Column(type="bigint", options={"unsigned":true})
  32.      * @ORM\GeneratedValue(strategy="AUTO")
  33.      */
  34.     private $id;
  35.     /**
  36.      * @ORM\Column(type="string", nullable=true)
  37.      */
  38.     private $tipo;
  39.     /**
  40.      * @ORM\Column(type="string", length=2, nullable=true, options={"default":"es"})
  41.      */
  42.     private $idioma;
  43.     /**
  44.      * @ORM\Column(type="string", nullable=true)
  45.      */
  46.     private $IDperseo;
  47.     /**
  48.      * @ORM\Column(type="datetime", nullable=true, name="fecha")
  49.      */
  50.     private $fecha;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=true)
  53.      */
  54.     private $exportacion;
  55.     /**
  56.      * @ORM\Column(type="string", length=4, nullable=true)
  57.      */
  58.     private $regimen;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=true, options={"comment":"0 => particular, 1 => empresa"})
  61.      */
  62.     private $tipoCliente;
  63.     /**
  64.      * @ORM\Column(type="string", length=2, nullable=true, name="cliente_idioma")
  65.      */
  66.     private $clienteIdioma;
  67.     /**
  68.      * @ORM\Column(type="string", nullable=true, name="cliente_razon_social")
  69.      */
  70.     private $clienteRazonSocial;
  71.     /**
  72.      * @ORM\Column(
  73.      *     type="string",
  74.      *     nullable=true,
  75.      *     name="cliente_identificacion_tipo",
  76.      *     options={"comment":"DNI, Pasaporte, Licencia de Condución"}
  77.      * )
  78.      */
  79.     private $clienteIdentificacionTipo;
  80.     /**
  81.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion")
  82.      */
  83.     private $clienteIdentificacion;
  84.     /**
  85.      * @ORM\Column(type="string", nullable=true, name="cliente_direccion")
  86.      */
  87.     private $clienteDireccion;
  88.     /**
  89.      * @ORM\Column(type="string", length=12, nullable=true, name="cliente_cp")
  90.      * @Assert\Length(min = 5, max = 12)
  91.      */
  92.     private $clienteCp;
  93.     /**
  94.      * @ORM\Column(type="string", nullable=true, name="cliente_region")
  95.      */
  96.     protected $clienteRegion;
  97.     /**
  98.      * @ORM\Column(type="string", nullable=true, name="cliente_ciudad")
  99.      */
  100.     private $clienteCiudad;
  101.     /**
  102.      * @ORM\Column(type="string", nullable=true, name="cliente_provincia")
  103.      */
  104.     private $clienteProvincia;
  105.     /**
  106.      * @ORM\Column(type="string", nullable=true, name="cliente_ccaa")
  107.      */
  108.     private $clienteCcaa;
  109.     /**
  110.      * @ORM\Column(type="string", nullable=true, name="cliente_pais")
  111.      */
  112.     private $clientePais;
  113.     /**
  114.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion_frontal")
  115.      */
  116.     private $clienteIdentificacionFrontal;
  117.     /**
  118.      * @Vich\UploadableField(mapping="cliente", fileNameProperty="clienteIdentificacionFrontal")
  119.      * @var File
  120.      */
  121.     private $clienteIdentificacionFrontalFile;
  122.     /**
  123.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion_trasera")
  124.      */
  125.     private $clienteIdentificacionTrasera;
  126.     /**
  127.      * @Vich\UploadableField(mapping="cliente", fileNameProperty="clienteIdentificacionTrasera")
  128.      * @var File
  129.      */
  130.     private $clienteIdentificacionTraseraFile;
  131.     /**
  132.      * @ORM\Column(type="string", nullable=true, name="cliente_entidad_bancaria")
  133.      */
  134.     private $clienteEntidadBancaria;
  135.     /**
  136.      * @ORM\Column(type="string", nullable=true, name="cliente_iban")
  137.      */
  138.     private $clienteIban;
  139.     /**
  140.      * @ORM\Column(type="text", nullable=true, name="cliente_observaciones")
  141.      */
  142.     private $clienteObservaciones;
  143.     /**
  144.      * @ORM\Column(type="string", nullable=true, name="reloj_foto")
  145.      */
  146.     private $relojFoto;
  147.     /**
  148.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="relojFoto")
  149.      * @var File
  150.      */
  151.     protected $relojFotoFile;
  152.     /**
  153.      * @ORM\Column(type="string", nullable=true, name="reloj_modelo")
  154.      */
  155.     private $relojModelo1;
  156.     /**
  157.      * @ORM\Column(type="string", nullable=true)
  158.      */
  159.     private $relojModelo2;
  160.     /**
  161.      * @ORM\Column(type="string", nullable=true, name="reloj_ref")
  162.      */
  163.     private $relojRef1;
  164.     /**
  165.      * @ORM\Column(type="string", nullable=true)
  166.      */
  167.     private $relojRef2;
  168.     /**
  169.      * @ORM\Column(type="string", nullable=true, name="reloj_serie")
  170.      */
  171.     private $relojSerie;
  172.     /**
  173.      * @ORM\Column(
  174.      *     type="datetime",
  175.      *     nullable=true,
  176.      *     name="reloj_fecha",
  177.      *     options={"comment":"Fecha comprado por  primera vez"}
  178.      * )
  179.      */
  180.     private $relojFecha;
  181.     /**
  182.      * @ORM\Column(type="boolean", nullable=false, name="reloj_caja", options={"default":0})
  183.      */
  184.     private $relojCaja;
  185.     /**
  186.      * @ORM\Column(type="boolean", nullable=false, name="reloj_papeles", options={"default":0})
  187.      */
  188.     private $relojPapeles;
  189.     /**
  190.      * @ORM\Column(type="datetime", nullable=true, name="fecha_asentada")
  191.      */
  192.     private $fechaAsentada;
  193.     /**
  194.      * @ORM\Column(type="datetime", nullable=true)
  195.      */
  196.     private $fechaConfirmada;
  197.     /**
  198.      * @ORM\Column(type="datetime", nullable=true, name="fecha_facturada")
  199.      */
  200.     private $fechaFacturada;
  201.     /**
  202.      * @ORM\Column(type="datetime", nullable=true, name="fecha_cancelada")
  203.      */
  204.     private $fechaCancelada;
  205.     /**
  206.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  207.      */
  208.     private $deletedAt;
  209.     /**
  210.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  211.      * @Gedmo\Timestampable(on="update")
  212.      */
  213.     private $updatedAt;
  214.     /**
  215.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  216.      * @Gedmo\Timestampable(on="create")
  217.      */
  218.     private $createdAt;
  219.     /**
  220.      * @ORM\OneToOne(targetEntity=\App\Entity\DetalleOperacion::class, inversedBy="actividad")
  221.      * @ORM\JoinColumn(name="detalle_operacion_id", referencedColumnName="id", unique=true)
  222.      */
  223.     private $detalleOperacion;
  224.     /**
  225.      * @ORM\ManyToOne(targetEntity=\App\Entity\Cliente::class, inversedBy="actividades")
  226.      * @ORM\JoinColumn(name="cliente_id", referencedColumnName="id")
  227.      */
  228.     private $cliente;
  229.     /**
  230.      * @ORM\ManyToOne(targetEntity=\App\Entity\Marca::class, inversedBy="actividades")
  231.      * @ORM\JoinColumn(name="reloj_marca_id", referencedColumnName="id")
  232.      */
  233.     private $relojMarca;
  234.     /**
  235.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoAspecto::class, inversedBy="actividades")
  236.      * @ORM\JoinColumn(name="reloj_estado_id", referencedColumnName="id")
  237.      */
  238.     private $relojAspecto;
  239.     /**
  240.      * @ORM\ManyToOne(targetEntity=\App\Entity\UnidadNegocio::class, inversedBy="actividades")
  241.      * @ORM\JoinColumn(name="unidad_negocio_id", referencedColumnName="id")
  242.      */
  243.     private $unidadNegocio;
  244.     /**
  245.      * @ORM\ManyToOne(targetEntity=\App\Entity\Usuario::class, inversedBy="actividades")
  246.      * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id")
  247.      */
  248.     private $usuario;
  249.     /**
  250.      * @ORM\ManyToOne(targetEntity=\App\Entity\Canal::class, inversedBy="actividades")
  251.      * @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
  252.      */
  253.     private $canal;
  254.     /**
  255.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoActividad::class, inversedBy="actividades")
  256.      * @ORM\JoinColumn(name="estado_id", referencedColumnName="id")
  257.      */
  258.     private $estado;
  259.     public function __toString(): string
  260.     {
  261.         return $this->IDperseo??'---';
  262.     }
  263.     public function getId(): ?string
  264.     {
  265.         return $this->id;
  266.     }
  267.     public function getIDperseo(): ?string
  268.     {
  269.         return $this->IDperseo;
  270.     }
  271.     public function setIDperseo(?string $IDperseo): static
  272.     {
  273.         $this->IDperseo $IDperseo;
  274.         return $this;
  275.     }
  276.     public function getFecha(): ?DateTimeInterface
  277.     {
  278.         return $this->fecha;
  279.     }
  280.     public function setFecha(?DateTimeInterface $fecha): static
  281.     {
  282.         $this->fecha $fecha;
  283.         return $this;
  284.     }
  285.     public function isExportacion(): ?bool
  286.     {
  287.         return $this->exportacion;
  288.     }
  289.     public function setExportacion(?bool $exportacion): static
  290.     {
  291.         $this->exportacion $exportacion;
  292.         return $this;
  293.     }
  294.     public function getRegimen(): ?string
  295.     {
  296.         return $this->regimen;
  297.     }
  298.     public function setRegimen(?string $regimen): static
  299.     {
  300.         $this->regimen $regimen;
  301.         return $this;
  302.     }
  303.     public function getClienteIdioma(): ?string
  304.     {
  305.         return $this->clienteIdioma;
  306.     }
  307.     public function setClienteIdioma(?string $clienteIdioma): static
  308.     {
  309.         $this->clienteIdioma $clienteIdioma;
  310.         return $this;
  311.     }
  312.     public function getClienteRazonSocial(): ?string
  313.     {
  314.         return $this->clienteRazonSocial;
  315.     }
  316.     public function setClienteRazonSocial(?string $clienteRazonSocial): static
  317.     {
  318.         $this->clienteRazonSocial $clienteRazonSocial;
  319.         return $this;
  320.     }
  321.     public function getClienteIdentificacionTipo(): ?string
  322.     {
  323.         return $this->clienteIdentificacionTipo;
  324.     }
  325.     public function setClienteIdentificacionTipo(?string $clienteIdentificacionTipo): static
  326.     {
  327.         $this->clienteIdentificacionTipo $clienteIdentificacionTipo;
  328.         return $this;
  329.     }
  330.     public function getClienteIdentificacion(): ?string
  331.     {
  332.         return $this->clienteIdentificacion;
  333.     }
  334.     public function setClienteIdentificacion(?string $clienteIdentificacion): static
  335.     {
  336.         $this->clienteIdentificacion $clienteIdentificacion;
  337.         return $this;
  338.     }
  339.     public function getClienteDireccion(): ?string
  340.     {
  341.         return $this->clienteDireccion;
  342.     }
  343.     public function setClienteDireccion(?string $clienteDireccion): static
  344.     {
  345.         $this->clienteDireccion $clienteDireccion;
  346.         return $this;
  347.     }
  348.     public function getClienteCp(): ?string
  349.     {
  350.         return $this->clienteCp;
  351.     }
  352.     public function setClienteCp(?string $clienteCp): static
  353.     {
  354.         $this->clienteCp $clienteCp;
  355.         return $this;
  356.     }
  357.     public function getClienteCiudad(): ?string
  358.     {
  359.         return $this->clienteCiudad;
  360.     }
  361.     public function setClienteCiudad(?string $clienteCiudad): static
  362.     {
  363.         $this->clienteCiudad $clienteCiudad;
  364.         return $this;
  365.     }
  366.     public function getClienteProvincia(): ?string
  367.     {
  368.         return $this->clienteProvincia;
  369.     }
  370.     public function setClienteProvincia(?string $clienteProvincia): static
  371.     {
  372.         $this->clienteProvincia $clienteProvincia;
  373.         return $this;
  374.     }
  375.     public function getClienteCcaa(): ?string
  376.     {
  377.         return $this->clienteCcaa;
  378.     }
  379.     public function setClienteCcaa(?string $clienteCcaa): static
  380.     {
  381.         $this->clienteCcaa $clienteCcaa;
  382.         return $this;
  383.     }
  384.     public function getClientePais(): ?string
  385.     {
  386.         return $this->clientePais;
  387.     }
  388.     public function setClientePais(?string $clientePais): static
  389.     {
  390.         $this->clientePais $clientePais;
  391.         return $this;
  392.     }
  393.     public function getClienteIdentificacionFrontal(): ?string
  394.     {
  395.         return $this->clienteIdentificacionFrontal;
  396.     }
  397.     public function setClienteIdentificacionFrontal(?string $clienteIdentificacionFrontal): static
  398.     {
  399.         $this->clienteIdentificacionFrontal $clienteIdentificacionFrontal;
  400.         return $this;
  401.     }
  402.     public function getClienteIdentificacionFrontalFile(): ?File
  403.     {
  404.         return $this->clienteIdentificacionFrontalFile;
  405.     }
  406.     public function setClienteIdentificacionFrontalFile(?File $clienteIdentificacionFrontalFile): static
  407.     {
  408.         $this->clienteIdentificacionFrontalFile $clienteIdentificacionFrontalFile;
  409.         if ($clienteIdentificacionFrontalFile) {
  410.             // if 'updatedAt' is not defined in your entity, use another property
  411.             $this->setUpdatedAt(new DateTime('now'));
  412.         }
  413.         return $this;
  414.     }
  415.     public function getClienteIdentificacionTrasera(): ?string
  416.     {
  417.         return $this->clienteIdentificacionTrasera;
  418.     }
  419.     public function setClienteIdentificacionTrasera(?string $clienteIdentificacionTrasera): static
  420.     {
  421.         $this->clienteIdentificacionTrasera $clienteIdentificacionTrasera;
  422.         return $this;
  423.     }
  424.     public function getClienteIdentificacionTraseraFile(): ?File
  425.     {
  426.         return $this->clienteIdentificacionTraseraFile;
  427.     }
  428.     public function setClienteIdentificacionTraseraFile(?File $clienteIdentificacionTraseraFile): static
  429.     {
  430.         $this->clienteIdentificacionTraseraFile $clienteIdentificacionTraseraFile;
  431.         if ($clienteIdentificacionTraseraFile) {
  432.             // if 'updatedAt' is not defined in your entity, use another property
  433.             $this->setUpdatedAt(new DateTime('now'));
  434.         }
  435.         return $this;
  436.     }
  437.     public function getClienteEntidadBancaria(): ?string
  438.     {
  439.         return $this->clienteEntidadBancaria;
  440.     }
  441.     public function setClienteEntidadBancaria(?string $clienteEntidadBancaria): static
  442.     {
  443.         $this->clienteEntidadBancaria $clienteEntidadBancaria;
  444.         return $this;
  445.     }
  446.     public function getClienteIban(): ?string
  447.     {
  448.         return $this->clienteIban;
  449.     }
  450.     public function setClienteIban(?string $clienteIban): static
  451.     {
  452.         $this->clienteIban $clienteIban;
  453.         return $this;
  454.     }
  455.     public function getClienteObservaciones(): ?string
  456.     {
  457.         return $this->clienteObservaciones;
  458.     }
  459.     public function setClienteObservaciones(?string $clienteObservaciones): static
  460.     {
  461.         $this->clienteObservaciones $clienteObservaciones;
  462.         return $this;
  463.     }
  464.     public function getDeletedAt(): ?DateTimeInterface
  465.     {
  466.         return $this->deletedAt;
  467.     }
  468.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  469.     {
  470.         $this->deletedAt $deletedAt;
  471.         return $this;
  472.     }
  473.     public function getUpdatedAt(): ?DateTimeInterface
  474.     {
  475.         return $this->updatedAt;
  476.     }
  477.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  478.     {
  479.         $this->updatedAt $updatedAt;
  480.         return $this;
  481.     }
  482.     public function getCreatedAt(): ?DateTimeInterface
  483.     {
  484.         return $this->createdAt;
  485.     }
  486.     public function setCreatedAt(DateTimeInterface $createdAt): static
  487.     {
  488.         $this->createdAt $createdAt;
  489.         return $this;
  490.     }
  491.     public function getDetalleOperacion(): ?DetalleOperacion
  492.     {
  493.         return $this->detalleOperacion;
  494.     }
  495.     public function setDetalleOperacion(?DetalleOperacion $detalleOperacion): static
  496.     {
  497.         $this->detalleOperacion $detalleOperacion;
  498.         return $this;
  499.     }
  500.     public function getCliente(): ?Cliente
  501.     {
  502.         return $this->cliente;
  503.     }
  504.     public function setCliente(?Cliente $cliente): static
  505.     {
  506.         $this->cliente $cliente;
  507.         return $this;
  508.     }
  509.     public function getExportacionStr():string
  510.     {
  511.         return $this->isExportacion() ? 'Exportacion' 'Europa';
  512.     }
  513.     public function getRelojFoto(): ?string
  514.     {
  515.         return $this->relojFoto;
  516.     }
  517.     public function setRelojFoto(?string $relojFoto): static
  518.     {
  519.         $this->relojFoto $relojFoto;
  520.         return $this;
  521.     }
  522.     public function getRelojFotoFile(): ?File
  523.     {
  524.         return $this->relojFotoFile;
  525.     }
  526.     public function setRelojFotoFile(?File $relojFotoFile): self
  527.     {
  528.         $this->relojFotoFile $relojFotoFile;
  529.         if ($relojFotoFile) {
  530.             // if 'updatedAt' is not defined in your entity, use another property
  531.             $this->setUpdatedAt(new DateTime('now'));
  532.         }
  533.         return $this;
  534.     }
  535.     public function getRelojModelo1(): ?string
  536.     {
  537.         return $this->relojModelo1;
  538.     }
  539.     public function setRelojModelo1(?string $relojModelo1): static
  540.     {
  541.         $this->relojModelo1 $relojModelo1;
  542.         return $this;
  543.     }
  544.     public function getRelojModelo2(): ?string
  545.     {
  546.         return $this->relojModelo2;
  547.     }
  548.     public function setRelojModelo2(?string $relojModelo2): static
  549.     {
  550.         $this->relojModelo2 $relojModelo2;
  551.         return $this;
  552.     }
  553.     public function getRelojRef1(): ?string
  554.     {
  555.         return $this->relojRef1;
  556.     }
  557.     public function setRelojRef1(?string $relojRef1): static
  558.     {
  559.         $this->relojRef1 $relojRef1;
  560.         return $this;
  561.     }
  562.     public function getRelojRef2(): ?string
  563.     {
  564.         return $this->relojRef2;
  565.     }
  566.     public function setRelojRef2(?string $relojRef2): static
  567.     {
  568.         $this->relojRef2 $relojRef2;
  569.         return $this;
  570.     }
  571.     public function getRelojSerie(): ?string
  572.     {
  573.         return $this->relojSerie;
  574.     }
  575.     public function setRelojSerie(?string $relojSerie): static
  576.     {
  577.         $this->relojSerie $relojSerie;
  578.         return $this;
  579.     }
  580.     public function getRelojFecha(): ?DateTimeInterface
  581.     {
  582.         return $this->relojFecha;
  583.     }
  584.     public function setRelojFecha(?DateTimeInterface $relojFecha): static
  585.     {
  586.         $this->relojFecha $relojFecha;
  587.         return $this;
  588.     }
  589.     public function isRelojCaja(): ?bool
  590.     {
  591.         return $this->relojCaja;
  592.     }
  593.     public function setRelojCaja(bool $relojCaja): static
  594.     {
  595.         $this->relojCaja $relojCaja;
  596.         return $this;
  597.     }
  598.     public function isRelojPapeles(): ?bool
  599.     {
  600.         return $this->relojPapeles;
  601.     }
  602.     public function setRelojPapeles(bool $relojPapeles): static
  603.     {
  604.         $this->relojPapeles $relojPapeles;
  605.         return $this;
  606.     }
  607.     public function getRelojAspecto(): ?EstadoAspecto
  608.     {
  609.         return $this->relojAspecto;
  610.     }
  611.     public function setRelojAspecto(?EstadoAspecto $relojAspecto): static
  612.     {
  613.         $this->relojAspecto $relojAspecto;
  614.         return $this;
  615.     }
  616.     public function getRelojMarca(): ?Marca
  617.     {
  618.         return $this->relojMarca;
  619.     }
  620.     public function setRelojMarca(?Marca $relojMarca): static
  621.     {
  622.         $this->relojMarca $relojMarca;
  623.         return $this;
  624.     }
  625.     public function getUnidadNegocio(): ?UnidadNegocio
  626.     {
  627.         return $this->unidadNegocio;
  628.     }
  629.     public function setUnidadNegocio(?UnidadNegocio $unidadNegocio): static
  630.     {
  631.         $this->unidadNegocio $unidadNegocio;
  632.         return $this;
  633.     }
  634.     public function getUsuario(): ?Usuario
  635.     {
  636.         return $this->usuario;
  637.     }
  638.     public function setUsuario(?Usuario $usuario): static
  639.     {
  640.         $this->usuario $usuario;
  641.         return $this;
  642.     }
  643.     public function getCanal(): ?Canal
  644.     {
  645.         return $this->canal;
  646.     }
  647.     public function setCanal(?Canal $canal): static
  648.     {
  649.         $this->canal $canal;
  650.         return $this;
  651.     }
  652.     public function isTipoCliente(): ?bool
  653.     {
  654.         return $this->tipoCliente;
  655.     }
  656.     public function setTipoCliente(?bool $tipoCliente): static
  657.     {
  658.         $this->tipoCliente $tipoCliente;
  659.         return $this;
  660.     }
  661.     public function getIdioma(): ?string
  662.     {
  663.         return $this->idioma;
  664.     }
  665.     public function setIdioma(?string $idioma): static
  666.     {
  667.         $this->idioma $idioma;
  668.         return $this;
  669.     }
  670.     public function getTipo(): ?string
  671.     {
  672.         return $this->tipo;
  673.     }
  674.     public function setTipo(?string $tipo): static
  675.     {
  676.         $this->tipo $tipo;
  677.         return $this;
  678.     }
  679.     public function getImporte():?float
  680.     {
  681.         return $this instanceof ActividadCompra $this->getPrecioCoste() : $this->getPrecio();
  682.     }
  683.     public function getRelojStr():string
  684.     {
  685.         return implode(', ', [$this->getRelojMarca(), $this->getRelojModelo1()]);
  686.     }
  687.     public function getFechaVenta():?DateTimeInterface
  688.     {
  689.         return $this instanceof ActividadVenta $this->getFecha() : null;
  690.     }
  691.     public function getPrecioCoste():?float
  692.     {
  693.         return $this instanceof ActividadCompra $this->getPrecioCoste() : null;
  694.     }
  695.     public function getPrecioVenta():?float
  696.     {
  697.         return $this instanceof ActividadVenta $this->getPrecioVenta() : null;
  698.     }
  699.     public function getClienteRegion(): ?string
  700.     {
  701.         return $this->clienteRegion;
  702.     }
  703.     public function setClienteRegion(?string $clienteRegion): static
  704.     {
  705.         $this->clienteRegion $clienteRegion;
  706.         return $this;
  707.     }
  708.     public function getEstado(): ?EstadoActividad
  709.     {
  710.         return $this->estado;
  711.     }
  712.     public function setEstado(?EstadoActividad $estado): static
  713.     {
  714.         $this->estado $estado;
  715.         return $this;
  716.     }
  717.     public function getFechaAsentada(): ?\DateTimeInterface
  718.     {
  719.         return $this->fechaAsentada;
  720.     }
  721.     public function setFechaAsentada(?\DateTimeInterface $fechaAsentada): static
  722.     {
  723.         $this->fechaAsentada $fechaAsentada;
  724.         return $this;
  725.     }
  726.     public function getFechaConfirmada(): ?\DateTimeInterface
  727.     {
  728.         return $this->fechaConfirmada;
  729.     }
  730.     public function setFechaConfirmada(?\DateTimeInterface $fechaConfirmada): static
  731.     {
  732.         $this->fechaConfirmada $fechaConfirmada;
  733.         return $this;
  734.     }
  735.     public function getFechaFacturada(): ?\DateTimeInterface
  736.     {
  737.         return $this->fechaFacturada;
  738.     }
  739.     public function setFechaFacturada(?\DateTimeInterface $fechaFacturada): static
  740.     {
  741.         $this->fechaFacturada $fechaFacturada;
  742.         return $this;
  743.     }
  744.     public function getFechaCancelada(): ?\DateTimeInterface
  745.     {
  746.         return $this->fechaCancelada;
  747.     }
  748.     public function setFechaCancelada(?\DateTimeInterface $fechaCancelada): static
  749.     {
  750.         $this->fechaCancelada $fechaCancelada;
  751.         return $this;
  752.     }
  753.     public function getEstadoFecha(): ?DateTimeInterface
  754.     {
  755.         switch($this->getEstado()?->getKey())
  756.         {
  757.             case EstadoActividadEnum::ESTADO_ASENTADA:
  758.                 $fecha $this->getFechaAsentada();
  759.                 break;
  760.             case EstadoActividadEnum::ESTADO_CONFIRMADA:
  761.                 $fecha $this->getFechaConfirmada();
  762.                 break;
  763.             case EstadoActividadEnum::ESTADO_FACTURADA:
  764.                 $fecha $this->getFechaFacturada();
  765.                 break;
  766.             case EstadoActividadEnum::ESTADO_CANCELADA:
  767.                 $fecha $this->getFechaCancelada();
  768.                 break;
  769.             default:
  770.                 $fecha null;
  771.                 break;
  772.         }
  773.         return $fecha;
  774.     }
  775. }