src/Entity/ActividadAbstract.php line 31

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