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_marca")
  155.      */
  156.     private $relojMarcaStr;
  157.     /**
  158.      * @ORM\Column(type="string", nullable=true, name="reloj_modelo")
  159.      */
  160.     private $relojModelo1;
  161.     /**
  162.      * @ORM\Column(type="string", nullable=true)
  163.      */
  164.     private $relojModelo2;
  165.     /**
  166.      * @ORM\Column(type="string", nullable=true, name="reloj_ref")
  167.      */
  168.     private $relojRef1;
  169.     /**
  170.      * @ORM\Column(type="string", nullable=true)
  171.      */
  172.     private $relojRef2;
  173.     /**
  174.      * @ORM\Column(type="string", nullable=true, name="reloj_serie")
  175.      */
  176.     private $relojSerie;
  177.     /**
  178.      * @ORM\Column(
  179.      *     type="datetime",
  180.      *     nullable=true,
  181.      *     name="reloj_fecha",
  182.      *     options={"comment":"Fecha comprado por  primera vez"}
  183.      * )
  184.      */
  185.     private $relojFecha;
  186.     /**
  187.      * @ORM\Column(type="boolean", nullable=false, name="reloj_caja", options={"default":0})
  188.      */
  189.     private $relojCaja;
  190.     /**
  191.      * @ORM\Column(type="boolean", nullable=false, name="reloj_papeles", options={"default":0})
  192.      */
  193.     private $relojPapeles;
  194.     /**
  195.      * @ORM\Column(type="datetime", nullable=true, name="fecha_pendiente")
  196.      */
  197.     private $fechaPendiente;
  198.     /**
  199.      * @ORM\Column(type="datetime", nullable=true, name="fecha_asentada")
  200.      */
  201.     private $fechaAsentada;
  202.     /**
  203.      * @ORM\Column(type="datetime", nullable=true)
  204.      */
  205.     private $fechaConfirmada;
  206.     /**
  207.      * @ORM\Column(type="datetime", nullable=true, name="fecha_facturada")
  208.      */
  209.     private $fechaFacturada;
  210.     /**
  211.      * @ORM\Column(type="datetime", nullable=true, name="fecha_cancelada")
  212.      */
  213.     private $fechaCancelada;
  214.     /**
  215.      * @ORM\Column(type="datetime", nullable=true, name="fecha_anulada")
  216.      */
  217.     private $fechaAnulada;
  218.     /**
  219.      * @ORM\Column(type="datetime", nullable=true, name="fecha_abonada")
  220.      */
  221.     private $fechaAbonada;
  222.     /**
  223.      * @ORM\Column(type="datetime", nullable=true, name="fecha_factura")
  224.      */
  225.     private $fechaFactura;
  226.     /**
  227.      * @ORM\Column(type="string", nullable=true, name="numero_factura")
  228.      */
  229.     private $numeroFactura;
  230.     /**
  231.      * @ORM\Column(
  232.      *     type="float",
  233.      *     nullable=true,
  234.      *     name="precio_coste_total",
  235.      *     options={"comment":"Coste del reloj + Costes Asociados"}
  236.      * )
  237.      */
  238.     private $precioCosteTotal;
  239.     /**
  240.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  241.      */
  242.     private $deletedAt;
  243.     /**
  244.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  245.      * @Gedmo\Timestampable(on="update")
  246.      */
  247.     private $updatedAt;
  248.     /**
  249.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  250.      * @Gedmo\Timestampable(on="create")
  251.      */
  252.     private $createdAt;
  253.     /**
  254.      * @ORM\OneToOne(targetEntity=\App\Entity\DetalleOperacion::class, inversedBy="actividad")
  255.      * @ORM\JoinColumn(name="detalle_operacion_id", referencedColumnName="id", unique=true)
  256.      */
  257.     private $detalleOperacion;
  258.     /**
  259.      * @ORM\ManyToOne(targetEntity=\App\Entity\Cliente::class, inversedBy="actividades")
  260.      * @ORM\JoinColumn(name="cliente_id", referencedColumnName="id")
  261.      */
  262.     private $cliente;
  263.     /**
  264.      * @ORM\ManyToOne(targetEntity=\App\Entity\Marca::class, inversedBy="actividades")
  265.      * @ORM\JoinColumn(name="reloj_marca_id", referencedColumnName="id")
  266.      */
  267.     private $relojMarca;
  268.     /**
  269.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoAspecto::class, inversedBy="actividades")
  270.      * @ORM\JoinColumn(name="reloj_estado_id", referencedColumnName="id")
  271.      */
  272.     private $relojAspecto;
  273.     /**
  274.      * @ORM\ManyToOne(targetEntity=\App\Entity\UnidadNegocio::class, inversedBy="actividades")
  275.      * @ORM\JoinColumn(name="unidad_negocio_id", referencedColumnName="id")
  276.      */
  277.     private $unidadNegocio;
  278.     /**
  279.      * @ORM\ManyToOne(targetEntity=\App\Entity\Usuario::class, inversedBy="actividades")
  280.      * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id")
  281.      */
  282.     private $usuario;
  283.     /**
  284.      * @ORM\ManyToOne(targetEntity=\App\Entity\Canal::class, inversedBy="actividades")
  285.      * @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
  286.      */
  287.     private $canal;
  288.     /**
  289.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoActividad::class, inversedBy="actividades")
  290.      * @ORM\JoinColumn(name="estado_id", referencedColumnName="id")
  291.      */
  292.     private $estado;
  293.     /**
  294.      * @ORM\Column(type="datetime", nullable=true, name="fecha_compra")
  295.      */
  296.     private $fechaCompra;
  297.     /**
  298.      * @ORM\Column(type="float", nullable=true, name="precio_coste")
  299.      */
  300.     private $precioCoste;
  301.     /**
  302.      * @ORM\Column(type="float", nullable=true, name="precio_costes_compra", options={"comment":"costes asosciados"})
  303.      */
  304.     private $precioCostesCompra;
  305.     public function __toString(): string
  306.     {
  307.         return $this->IDperseo??'---';
  308.     }
  309.     public function getId(): ?string
  310.     {
  311.         return $this->id;
  312.     }
  313.     public function getIDperseo(): ?string
  314.     {
  315.         return $this->IDperseo;
  316.     }
  317.     public function setIDperseo(?string $IDperseo): static
  318.     {
  319.         $this->IDperseo $IDperseo;
  320.         return $this;
  321.     }
  322.     public function getFecha(): ?DateTimeInterface
  323.     {
  324.         return $this->fecha;
  325.     }
  326.     public function setFecha(?DateTimeInterface $fecha): static
  327.     {
  328.         $this->fecha $fecha;
  329.         $this->fechaAsentada $fecha;
  330.         return $this;
  331.     }
  332.     public function isExportacion(): ?bool
  333.     {
  334.         return $this->exportacion;
  335.     }
  336.     public function setExportacion(?bool $exportacion): static
  337.     {
  338.         $this->exportacion $exportacion;
  339.         return $this;
  340.     }
  341.     public function getRegimen(): ?string
  342.     {
  343.         return $this->regimen;
  344.     }
  345.     public function setRegimen(?string $regimen): static
  346.     {
  347.         $this->regimen $regimen;
  348.         return $this;
  349.     }
  350.     public function getClienteIdioma(): ?string
  351.     {
  352.         return $this->clienteIdioma;
  353.     }
  354.     public function setClienteIdioma(?string $clienteIdioma): static
  355.     {
  356.         $this->clienteIdioma $clienteIdioma;
  357.         return $this;
  358.     }
  359.     public function getClienteRazonSocial(): ?string
  360.     {
  361.         return $this->clienteRazonSocial;
  362.     }
  363.     public function setClienteRazonSocial(?string $clienteRazonSocial): static
  364.     {
  365.         $this->clienteRazonSocial $clienteRazonSocial;
  366.         return $this;
  367.     }
  368.     public function getClienteIdentificacionTipo(): ?string
  369.     {
  370.         return $this->clienteIdentificacionTipo;
  371.     }
  372.     public function setClienteIdentificacionTipo(?string $clienteIdentificacionTipo): static
  373.     {
  374.         $this->clienteIdentificacionTipo $clienteIdentificacionTipo;
  375.         return $this;
  376.     }
  377.     public function getClienteIdentificacion(): ?string
  378.     {
  379.         return $this->clienteIdentificacion;
  380.     }
  381.     public function setClienteIdentificacion(?string $clienteIdentificacion): static
  382.     {
  383.         $this->clienteIdentificacion $clienteIdentificacion;
  384.         return $this;
  385.     }
  386.     public function getClienteDireccion(): ?string
  387.     {
  388.         return $this->clienteDireccion;
  389.     }
  390.     public function setClienteDireccion(?string $clienteDireccion): static
  391.     {
  392.         $this->clienteDireccion $clienteDireccion;
  393.         return $this;
  394.     }
  395.     public function getClienteCp(): ?string
  396.     {
  397.         return $this->clienteCp;
  398.     }
  399.     public function setClienteCp(?string $clienteCp): static
  400.     {
  401.         $this->clienteCp $clienteCp;
  402.         return $this;
  403.     }
  404.     public function getClienteCiudad(): ?string
  405.     {
  406.         return $this->clienteCiudad;
  407.     }
  408.     public function setClienteCiudad(?string $clienteCiudad): static
  409.     {
  410.         $this->clienteCiudad $clienteCiudad;
  411.         return $this;
  412.     }
  413.     public function getClienteProvincia(): ?string
  414.     {
  415.         return $this->clienteProvincia;
  416.     }
  417.     public function setClienteProvincia(?string $clienteProvincia): static
  418.     {
  419.         $this->clienteProvincia $clienteProvincia;
  420.         return $this;
  421.     }
  422.     public function getClienteCcaa(): ?string
  423.     {
  424.         return $this->clienteCcaa;
  425.     }
  426.     public function setClienteCcaa(?string $clienteCcaa): static
  427.     {
  428.         $this->clienteCcaa $clienteCcaa;
  429.         return $this;
  430.     }
  431.     public function getClientePais(): ?string
  432.     {
  433.         return $this->clientePais;
  434.     }
  435.     public function setClientePais(?string $clientePais): static
  436.     {
  437.         $this->clientePais $clientePais;
  438.         return $this;
  439.     }
  440.     public function getClienteIdentificacionFrontal(): ?string
  441.     {
  442.         return $this->clienteIdentificacionFrontal;
  443.     }
  444.     public function setClienteIdentificacionFrontal(?string $clienteIdentificacionFrontal): static
  445.     {
  446.         $this->clienteIdentificacionFrontal $clienteIdentificacionFrontal;
  447.         return $this;
  448.     }
  449.     public function getClienteIdentificacionFrontalFile(): ?File
  450.     {
  451.         return $this->clienteIdentificacionFrontalFile;
  452.     }
  453.     public function setClienteIdentificacionFrontalFile(?File $clienteIdentificacionFrontalFile): static
  454.     {
  455.         $this->clienteIdentificacionFrontalFile $clienteIdentificacionFrontalFile;
  456.         if ($clienteIdentificacionFrontalFile) {
  457.             // if 'updatedAt' is not defined in your entity, use another property
  458.             $this->setUpdatedAt(new DateTime('now'));
  459.         }
  460.         return $this;
  461.     }
  462.     public function getClienteIdentificacionTrasera(): ?string
  463.     {
  464.         return $this->clienteIdentificacionTrasera;
  465.     }
  466.     public function setClienteIdentificacionTrasera(?string $clienteIdentificacionTrasera): static
  467.     {
  468.         $this->clienteIdentificacionTrasera $clienteIdentificacionTrasera;
  469.         return $this;
  470.     }
  471.     public function getClienteIdentificacionTraseraFile(): ?File
  472.     {
  473.         return $this->clienteIdentificacionTraseraFile;
  474.     }
  475.     public function setClienteIdentificacionTraseraFile(?File $clienteIdentificacionTraseraFile): static
  476.     {
  477.         $this->clienteIdentificacionTraseraFile $clienteIdentificacionTraseraFile;
  478.         if ($clienteIdentificacionTraseraFile) {
  479.             // if 'updatedAt' is not defined in your entity, use another property
  480.             $this->setUpdatedAt(new DateTime('now'));
  481.         }
  482.         return $this;
  483.     }
  484.     public function getClienteEntidadBancaria(): ?string
  485.     {
  486.         return $this->clienteEntidadBancaria;
  487.     }
  488.     public function setClienteEntidadBancaria(?string $clienteEntidadBancaria): static
  489.     {
  490.         $this->clienteEntidadBancaria $clienteEntidadBancaria;
  491.         return $this;
  492.     }
  493.     public function getClienteIban(): ?string
  494.     {
  495.         return $this->clienteIban;
  496.     }
  497.     public function setClienteIban(?string $clienteIban): static
  498.     {
  499.         $this->clienteIban $clienteIban;
  500.         return $this;
  501.     }
  502.     public function getClienteObservaciones(): ?string
  503.     {
  504.         return $this->clienteObservaciones;
  505.     }
  506.     public function setClienteObservaciones(?string $clienteObservaciones): static
  507.     {
  508.         $this->clienteObservaciones $clienteObservaciones;
  509.         return $this;
  510.     }
  511.     public function getDeletedAt(): ?DateTimeInterface
  512.     {
  513.         return $this->deletedAt;
  514.     }
  515.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  516.     {
  517.         $this->deletedAt $deletedAt;
  518.         return $this;
  519.     }
  520.     public function getUpdatedAt(): ?DateTimeInterface
  521.     {
  522.         return $this->updatedAt;
  523.     }
  524.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  525.     {
  526.         $this->updatedAt $updatedAt;
  527.         return $this;
  528.     }
  529.     public function getCreatedAt(): ?DateTimeInterface
  530.     {
  531.         return $this->createdAt;
  532.     }
  533.     public function setCreatedAt(DateTimeInterface $createdAt): static
  534.     {
  535.         $this->createdAt $createdAt;
  536.         return $this;
  537.     }
  538.     public function getDetalleOperacion(): ?DetalleOperacion
  539.     {
  540.         return $this->detalleOperacion;
  541.     }
  542.     public function setDetalleOperacion(?DetalleOperacion $detalleOperacion): static
  543.     {
  544.         $this->detalleOperacion $detalleOperacion;
  545.         return $this;
  546.     }
  547.     public function getCliente(): ?Cliente
  548.     {
  549.         return $this->cliente;
  550.     }
  551.     public function setCliente(?Cliente $cliente): static
  552.     {
  553.         $this->cliente $cliente;
  554.         return $this;
  555.     }
  556.     public function getExportacionStr():string
  557.     {
  558.         return $this->isExportacion() ? 'Exportacion' 'Europa';
  559.     }
  560.     public function getRelojFoto(): ?string
  561.     {
  562.         return $this->relojFoto;
  563.     }
  564.     public function setRelojFoto(?string $relojFoto): static
  565.     {
  566.         $this->relojFoto $relojFoto;
  567.         return $this;
  568.     }
  569.     public function getRelojFotoFile(): ?File
  570.     {
  571.         return $this->relojFotoFile;
  572.     }
  573.     public function setRelojFotoFile(?File $relojFotoFile): self
  574.     {
  575.         $this->relojFotoFile $relojFotoFile;
  576.         if ($relojFotoFile) {
  577.             // if 'updatedAt' is not defined in your entity, use another property
  578.             $this->setUpdatedAt(new DateTime('now'));
  579.         }
  580.         return $this;
  581.     }
  582.     public function getRelojModelo1(): ?string
  583.     {
  584.         return $this->relojModelo1;
  585.     }
  586.     public function setRelojModelo1(?string $relojModelo1): static
  587.     {
  588.         $this->relojModelo1 $relojModelo1;
  589.         return $this;
  590.     }
  591.     public function getRelojModelo2(): ?string
  592.     {
  593.         return $this->relojModelo2;
  594.     }
  595.     public function setRelojModelo2(?string $relojModelo2): static
  596.     {
  597.         $this->relojModelo2 $relojModelo2;
  598.         return $this;
  599.     }
  600.     public function getRelojRef1(): ?string
  601.     {
  602.         return $this->relojRef1;
  603.     }
  604.     public function setRelojRef1(?string $relojRef1): static
  605.     {
  606.         $this->relojRef1 $relojRef1;
  607.         return $this;
  608.     }
  609.     public function getRelojRef2(): ?string
  610.     {
  611.         return $this->relojRef2;
  612.     }
  613.     public function setRelojRef2(?string $relojRef2): static
  614.     {
  615.         $this->relojRef2 $relojRef2;
  616.         return $this;
  617.     }
  618.     public function getRelojSerie(): ?string
  619.     {
  620.         return $this->relojSerie;
  621.     }
  622.     public function setRelojSerie(?string $relojSerie): static
  623.     {
  624.         $this->relojSerie $relojSerie;
  625.         return $this;
  626.     }
  627.     public function getRelojFecha(): ?DateTimeInterface
  628.     {
  629.         return $this->relojFecha;
  630.     }
  631.     public function setRelojFecha(?DateTimeInterface $relojFecha): static
  632.     {
  633.         $this->relojFecha $relojFecha;
  634.         return $this;
  635.     }
  636.     public function isRelojCaja(): ?bool
  637.     {
  638.         return $this->relojCaja;
  639.     }
  640.     public function setRelojCaja(bool $relojCaja): static
  641.     {
  642.         $this->relojCaja $relojCaja;
  643.         return $this;
  644.     }
  645.     public function isRelojPapeles(): ?bool
  646.     {
  647.         return $this->relojPapeles;
  648.     }
  649.     public function setRelojPapeles(bool $relojPapeles): static
  650.     {
  651.         $this->relojPapeles $relojPapeles;
  652.         return $this;
  653.     }
  654.     public function getRelojAspecto(): ?EstadoAspecto
  655.     {
  656.         return $this->relojAspecto;
  657.     }
  658.     public function setRelojAspecto(?EstadoAspecto $relojAspecto): static
  659.     {
  660.         $this->relojAspecto $relojAspecto;
  661.         return $this;
  662.     }
  663.     public function getRelojMarca(): ?Marca
  664.     {
  665.         return $this->relojMarca;
  666.     }
  667.     public function setRelojMarca(?Marca $relojMarca): static
  668.     {
  669.         $this->relojMarca $relojMarca;
  670.         return $this;
  671.     }
  672.     public function getUnidadNegocio(): ?UnidadNegocio
  673.     {
  674.         return $this->unidadNegocio;
  675.     }
  676.     public function setUnidadNegocio(?UnidadNegocio $unidadNegocio): static
  677.     {
  678.         $this->unidadNegocio $unidadNegocio;
  679.         return $this;
  680.     }
  681.     public function getUsuario(): ?Usuario
  682.     {
  683.         return $this->usuario;
  684.     }
  685.     public function setUsuario(?Usuario $usuario): static
  686.     {
  687.         $this->usuario $usuario;
  688.         return $this;
  689.     }
  690.     public function getCanal(): ?Canal
  691.     {
  692.         return $this->canal;
  693.     }
  694.     public function setCanal(?Canal $canal): static
  695.     {
  696.         $this->canal $canal;
  697.         return $this;
  698.     }
  699.     public function isTipoCliente(): ?bool
  700.     {
  701.         return $this->tipoCliente;
  702.     }
  703.     public function setTipoCliente(?bool $tipoCliente): static
  704.     {
  705.         $this->tipoCliente $tipoCliente;
  706.         return $this;
  707.     }
  708.     public function getIdioma(): ?string
  709.     {
  710.         return $this->idioma;
  711.     }
  712.     public function setIdioma(?string $idioma): static
  713.     {
  714.         $this->idioma $idioma;
  715.         return $this;
  716.     }
  717.     public function getTipo(): ?string
  718.     {
  719.         return $this->tipo;
  720.     }
  721.     public function setTipo(?string $tipo): static
  722.     {
  723.         $this->tipo $tipo;
  724.         return $this;
  725.     }
  726.     public function getImporte():?float
  727.     {
  728.         return $this instanceof ActividadCompra $this->getPrecioCoste() : $this->getPrecio();
  729.     }
  730.     public function getRelojStr():string
  731.     {
  732.         return implode(', ', [$this->getRelojMarca(), $this->getRelojModelo1()]);
  733.     }
  734.     public function getFechaVenta():?DateTimeInterface
  735.     {
  736.         return $this instanceof ActividadVenta $this->getFecha() : null;
  737.     }
  738.     public function getPrecioCoste():?float
  739.     {
  740.         return $this instanceof ActividadCompra $this->getPrecioCoste() : null;
  741.     }
  742.     public function getPrecioVenta():?float
  743.     {
  744.         return $this instanceof ActividadVenta $this->getPrecioVenta() : null;
  745.     }
  746.     public function getClienteRegion(): ?string
  747.     {
  748.         return $this->clienteRegion;
  749.     }
  750.     public function setClienteRegion(?string $clienteRegion): static
  751.     {
  752.         $this->clienteRegion $clienteRegion;
  753.         return $this;
  754.     }
  755.     public function getEstado(): ?EstadoActividad
  756.     {
  757.         return $this->estado;
  758.     }
  759.     public function setEstado(?EstadoActividad $estado): static
  760.     {
  761.         $this->estado $estado;
  762.         return $this;
  763.     }
  764.     public function getFechaPendiente(): ?DateTimeInterface
  765.     {
  766.         return $this->fechaPendiente;
  767.     }
  768.     public function setFechaPendiente(?DateTimeInterface $fechaPendiente): static
  769.     {
  770.         $this->fechaAsentada $fechaPendiente;
  771.         $this->fecha $fechaPendiente;
  772.         return $this;
  773.     }
  774.     public function getFechaAsentada(): ?DateTimeInterface
  775.     {
  776.         return $this->fechaAsentada;
  777.     }
  778.     public function setFechaAsentada(?DateTimeInterface $fechaAsentada): static
  779.     {
  780.         $this->fechaAsentada $fechaAsentada;
  781.         return $this;
  782.     }
  783.     public function getFechaConfirmada(): ?DateTimeInterface
  784.     {
  785.         return $this->fechaConfirmada;
  786.     }
  787.     public function setFechaConfirmada(?DateTimeInterface $fechaConfirmada): static
  788.     {
  789.         $this->fechaConfirmada $fechaConfirmada;
  790.         return $this;
  791.     }
  792.     public function getFechaFacturada(): ?DateTimeInterface
  793.     {
  794.         return $this->fechaFacturada;
  795.     }
  796.     public function setFechaFacturada(?DateTimeInterface $fechaFacturada): static
  797.     {
  798.         $this->fechaFacturada $fechaFacturada;
  799.         return $this;
  800.     }
  801.     public function getFechaCancelada(): ?DateTimeInterface
  802.     {
  803.         return $this->fechaCancelada;
  804.     }
  805.     public function setFechaCancelada(?DateTimeInterface $fechaCancelada): static
  806.     {
  807.         $this->fechaCancelada $fechaCancelada;
  808.         return $this;
  809.     }
  810.     public function getFechaAnulada(): ?DateTimeInterface
  811.     {
  812.         return $this->fechaAnulada;
  813.     }
  814.     public function setFechaAnulada(?DateTimeInterface $fechaAnulada): static
  815.     {
  816.         $this->fechaAnulada $fechaAnulada;
  817.         return $this;
  818.     }
  819.     public function getEstadoFecha(): ?DateTimeInterface
  820.     {
  821.         switch($this->getEstado()?->getKey())
  822.         {
  823.             case EstadoActividadEnum::ESTADO_PENDIENTE:
  824.                 $fecha $this->getFechaPendiente();
  825.                 break;
  826.             case EstadoActividadEnum::ESTADO_ASENTADA:
  827.                 $fecha $this->getFechaAsentada();
  828.                 break;
  829.             case EstadoActividadEnum::ESTADO_CONFIRMADA:
  830.                 $fecha $this->getFechaConfirmada();
  831.                 break;
  832.             case EstadoActividadEnum::ESTADO_FACTURADA:
  833.                 $fecha $this->getFechaFacturada();
  834.                 break;
  835.             case EstadoActividadEnum::ESTADO_CANCELADA:
  836.                 $fecha $this->getFechaCancelada();
  837.                 break;
  838.             case EstadoActividadEnum::ESTADO_ANULADA:
  839.                 $fecha $this->getFechaAnulada();
  840.                 break;
  841.             case EstadoActividadEnum::ESTADO_ABONADA:
  842.                 $fecha $this->getFechaAbonada();
  843.                 break;
  844.             default:
  845.                 $fecha null;
  846.                 break;
  847.         }
  848.         return $fecha;
  849.     }
  850.     public function isPending():bool
  851.     {
  852.         return $this->getEstado()->getKey() === EstadoActividadEnum::ESTADO_PENDIENTE;
  853.     }
  854.     public function isSettled(): bool
  855.     {
  856.         return $this->getEstado()->getKey() === EstadoActividadEnum::ESTADO_ASENTADA;
  857.     }
  858.     public function isCancelled(): bool
  859.     {
  860.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_CANCELADA;
  861.     }
  862.     public function isAnnulled(): bool
  863.     {
  864.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_ANULADA;
  865.     }
  866.     public function isPaid(): bool
  867.     {
  868.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_ABONADA;
  869.     }
  870.     public function getRelojModelos(): ?string
  871.     {
  872.         return implode(' 'array_filter([$this->getRelojModelo1(), $this->getRelojModelo2()]));
  873.     }
  874.     public function getRelojRefs(): ?string
  875.     {
  876.         return implode(''array_filter([$this->getRelojRef1(), $this->getRelojRef2()]));
  877.     }
  878.     public function getRelojMarcaStr(): ?string
  879.     {
  880.         return $this->relojMarcaStr;
  881.     }
  882.     public function setRelojMarcaStr(?string $relojMarcaStr): static
  883.     {
  884.         $this->relojMarcaStr $relojMarcaStr;
  885.         return $this;
  886.     }
  887.     public function getFechaAbonada(): ?\DateTimeInterface
  888.     {
  889.         return $this->fechaAbonada;
  890.     }
  891.     public function setFechaAbonada(?\DateTimeInterface $fechaAbonada): static
  892.     {
  893.         $this->fechaAbonada $fechaAbonada;
  894.         return $this;
  895.     }
  896.     public function getFechaFactura(): ?\DateTimeInterface
  897.     {
  898.         return $this->fechaFactura;
  899.     }
  900.     public function setFechaFactura(?\DateTimeInterface $fechaFactura): static
  901.     {
  902.         $this->fechaFactura $fechaFactura;
  903.         return $this;
  904.     }
  905.     public function getNumeroFactura(): ?string
  906.     {
  907.         return $this->numeroFactura;
  908.     }
  909.     public function setNumeroFactura(?string $numeroFactura): static
  910.     {
  911.         $this->numeroFactura $numeroFactura;
  912.         return $this;
  913.     }
  914.     public function getPrecioCosteTotal(): ?float
  915.     {
  916.         return $this->precioCosteTotal;
  917.     }
  918.     public function setPrecioCosteTotal(?float $precioCosteTotal): static
  919.     {
  920.         $this->precioCosteTotal $precioCosteTotal;
  921.         return $this;
  922.     }
  923.     public function getFechaCompra(): ?\DateTimeInterface
  924.     {
  925.         return $this->fechaCompra;
  926.     }
  927.     public function setFechaCompra(?\DateTimeInterface $fechaCompra): static
  928.     {
  929.         $this->fechaCompra $fechaCompra;
  930.         return $this;
  931.     }
  932.     public function setPrecioCoste(?float $precioCoste): static
  933.     {
  934.         $this->precioCoste $precioCoste;
  935.         return $this;
  936.     }
  937.     public function getPrecioCostesCompra(): ?float
  938.     {
  939.         return $this->precioCostesCompra;
  940.     }
  941.     public function setPrecioCostesCompra(?float $precioCostesCompra): static
  942.     {
  943.         $this->precioCostesCompra $precioCostesCompra;
  944.         return $this;
  945.     }
  946. }