src/Entity/ActividadAbstract.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\EstadoActividadEnum;
  4. use App\Enum\TipoActividadEnum;
  5. use App\Validator as PerseoAssert;
  6. use DateTime;
  7. use DateTimeInterface;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use JMS\Serializer\Annotation as JMS;
  11. use Gedmo\Mapping\Annotation as Gedmo;
  12. use Symfony\Component\HttpFoundation\File\File;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  15. /**
  16.  * @ORM\Entity(repositoryClass="App\Repository\ActividadAbstractRepository")
  17.  * @ORM\Table(name="actividad")
  18.  * @ORM\EntityListeners({
  19.  *     "App\EntityListener\Actividad\CalcularIDPerseoListener",
  20.  *     "App\EntityListener\Actividad\UpdateDatesListener",
  21.  *     "App\EntityListener\Actividad\UpdateRelojListener"
  22.  * })
  23.  * @ORM\InheritanceType("SINGLE_TABLE")
  24.  * @ORM\DiscriminatorColumn(name="type", type="string")
  25.  * @ORM\DiscriminatorMap({"compra":"App\Entity\ActividadCompra","venta":"App\Entity\ActividadVenta"})
  26.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  27.  * @Vich\Uploadable
  28.  * @PerseoAssert\ContraintsValidarEntidadCp()
  29.  */
  30. Abstract class ActividadAbstract
  31. {
  32.     /**
  33.      * @ORM\Id
  34.      * @ORM\Column(type="bigint", options={"unsigned":true})
  35.      * @ORM\GeneratedValue(strategy="AUTO")
  36.      * @JMS\Groups({
  37.      *     "api_v1_reloj_serialize"
  38.      * })
  39.      */
  40.     private $id;
  41.     /**
  42.      * @ORM\Column(type="string", nullable=true)
  43.      */
  44.     private $tipo;
  45.     /**
  46.      * @ORM\Column(type="string", length=2, nullable=true, options={"default":"es"})
  47.      */
  48.     private $idioma;
  49.     /**
  50.      * @ORM\Column(type="string", nullable=true)
  51.      */
  52.     private $IDperseo;
  53.     /**
  54.      * @ORM\Column(type="datetime", nullable=true, name="fecha")
  55.      */
  56.     private $fecha;
  57.     /**
  58.      * @ORM\Column(type="boolean", nullable=true)
  59.      */
  60.     private $exportacion;
  61.     /**
  62.      * @ORM\Column(type="string", length=4, nullable=true)
  63.      */
  64.     private $regimen;
  65.     /**
  66.      * @ORM\Column(type="boolean", nullable=true, options={"comment":"0 => particular, 1 => empresa"})
  67.      */
  68.     private $tipoCliente;
  69.     /**
  70.      * @ORM\Column(type="string", length=2, nullable=true, name="cliente_idioma")
  71.      */
  72.     private $clienteIdioma;
  73.     /**
  74.      * @ORM\Column(type="string", nullable=true, name="cliente_razon_social")
  75.      */
  76.     private $clienteRazonSocial;
  77.     /**
  78.      * @ORM\Column(
  79.      *     type="string",
  80.      *     nullable=true,
  81.      *     name="cliente_identificacion_tipo",
  82.      *     options={"comment":"DNI, Pasaporte, Licencia de Condución"}
  83.      * )
  84.      */
  85.     private $clienteIdentificacionTipo;
  86.     /**
  87.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion")
  88.      */
  89.     private $clienteIdentificacion;
  90.     /**
  91.      * @ORM\Column(type="string", nullable=true, name="cliente_direccion")
  92.      */
  93.     private $clienteDireccion;
  94.     /**
  95.      * @ORM\Column(type="string", length=12, nullable=true, name="cliente_cp")
  96.      * @Assert\Length(min = 5, max = 12)
  97.      */
  98.     private $clienteCp;
  99.     /**
  100.      * @ORM\Column(type="string", nullable=true, name="cliente_region")
  101.      */
  102.     protected $clienteRegion;
  103.     /**
  104.      * @ORM\Column(type="string", nullable=true, name="cliente_ciudad")
  105.      */
  106.     private $clienteCiudad;
  107.     /**
  108.      * @ORM\Column(type="string", nullable=true, name="cliente_provincia")
  109.      */
  110.     private $clienteProvincia;
  111.     /**
  112.      * @ORM\Column(type="string", nullable=true, name="cliente_ccaa")
  113.      */
  114.     private $clienteCcaa;
  115.     /**
  116.      * @ORM\Column(type="string", nullable=true, name="cliente_pais")
  117.      */
  118.     private $clientePais;
  119.     /**
  120.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion_frontal")
  121.      */
  122.     private $clienteIdentificacionFrontal;
  123.     /**
  124.      * @Vich\UploadableField(mapping="cliente", fileNameProperty="clienteIdentificacionFrontal")
  125.      * @var File
  126.      */
  127.     private $clienteIdentificacionFrontalFile;
  128.     /**
  129.      * @ORM\Column(type="string", nullable=true, name="cliente_identificacion_trasera")
  130.      */
  131.     private $clienteIdentificacionTrasera;
  132.     /**
  133.      * @Vich\UploadableField(mapping="cliente", fileNameProperty="clienteIdentificacionTrasera")
  134.      * @var File
  135.      */
  136.     private $clienteIdentificacionTraseraFile;
  137.     /**
  138.      * @ORM\Column(type="string", nullable=true, name="cliente_entidad_bancaria")
  139.      */
  140.     private $clienteEntidadBancaria;
  141.     /**
  142.      * @ORM\Column(type="string", nullable=true, name="cliente_swift")
  143.      */
  144.     private $clienteSwift;
  145.     /**
  146.      * @ORM\Column(type="string", nullable=true, name="cliente_iban")
  147.      */
  148.     private $clienteIban;
  149.     /**
  150.      * @ORM\Column(type="string", nullable=true, name="cliente_telefono")
  151.      */
  152.     private $clienteTelefono;
  153.     /**
  154.      * @ORM\Column(type="string", nullable=true, name="cliente_email")
  155.      */
  156.     private $clienteEmail;
  157.     /**
  158.      * @ORM\Column(type="text", nullable=true, name="cliente_observaciones")
  159.      */
  160.     private $clienteObservaciones;
  161.     /**
  162.      * @ORM\Column(type="string", nullable=true, name="reloj_foto")
  163.      */
  164.     private $relojFoto;
  165.     /**
  166.      * @Vich\UploadableField(mapping="reloj", fileNameProperty="relojFoto")
  167.      * @var File
  168.      */
  169.     protected $relojFotoFile;
  170.     /**
  171.      * @ORM\Column(type="string", nullable=true, name="reloj_marca")
  172.      */
  173.     private $relojMarcaStr;
  174.     /**
  175.      * @ORM\Column(type="string", nullable=true, name="reloj_modelo")
  176.      */
  177.     private $relojModelo1;
  178.     /**
  179.      * @ORM\Column(type="string", nullable=true)
  180.      */
  181.     private $relojModelo2;
  182.     /**
  183.      * @ORM\Column(type="string", nullable=true, name="reloj_ref")
  184.      */
  185.     private $relojRef1;
  186.     /**
  187.      * @ORM\Column(type="string", nullable=true)
  188.      */
  189.     private $relojRef2;
  190.     /**
  191.      * @ORM\Column(type="string", nullable=true, name="reloj_serie")
  192.      */
  193.     private $relojSerie;
  194.     /**
  195.      * @ORM\Column(
  196.      *     type="datetime",
  197.      *     nullable=true,
  198.      *     name="reloj_fecha",
  199.      *     options={"comment":"Fecha comprado por  primera vez"}
  200.      * )
  201.      */
  202.     private $relojFecha;
  203.     /**
  204.      * @ORM\Column(type="boolean", nullable=false, name="reloj_caja", options={"default":0})
  205.      */
  206.     private $relojCaja;
  207.     /**
  208.      * @ORM\Column(type="boolean", nullable=false, name="reloj_papeles", options={"default":0})
  209.      */
  210.     private $relojPapeles;
  211.     /**
  212.      * @ORM\Column(type="datetime", nullable=true, name="fecha_pendiente")
  213.      */
  214.     private $fechaPendiente;
  215.     /**
  216.      * @ORM\Column(type="datetime", nullable=true, name="fecha_asentada")
  217.      */
  218.     private $fechaAsentada;
  219.     /**
  220.      * @ORM\Column(type="datetime", nullable=true)
  221.      */
  222.     private $fechaConfirmada;
  223.     /**
  224.      * @ORM\Column(type="datetime", nullable=true, name="fecha_facturada")
  225.      */
  226.     private $fechaFacturada;
  227.     /**
  228.      * @ORM\Column(type="datetime", nullable=true, name="fecha_cancelada")
  229.      */
  230.     private $fechaCancelada;
  231.     /**
  232.      * @ORM\Column(type="datetime", nullable=true, name="fecha_anulada")
  233.      */
  234.     private $fechaAnulada;
  235.     /**
  236.      * @ORM\Column(type="datetime", nullable=true, name="fecha_abonada")
  237.      */
  238.     private $fechaAbonada;
  239.     /**
  240.      * @ORM\Column(type="datetime", nullable=true, name="fecha_factura")
  241.      */
  242.     private $fechaFactura;
  243.     /**
  244.      * @ORM\Column(type="string", nullable=true, name="numero_factura")
  245.      */
  246.     private $numeroFactura;
  247.     /**
  248.      * @ORM\Column(
  249.      *     type="float",
  250.      *     nullable=true,
  251.      *     name="precio_coste_total",
  252.      *     options={"comment":"Coste del reloj + Costes Asociados"}
  253.      * )
  254.      */
  255.     private $precioCosteTotal;
  256.     /**
  257.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  258.      */
  259.     private $deletedAt;
  260.     /**
  261.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  262.      * @Gedmo\Timestampable(on="update")
  263.      */
  264.     private $updatedAt;
  265.     /**
  266.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  267.      * @Gedmo\Timestampable(on="create")
  268.      */
  269.     private $createdAt;
  270.     /**
  271.      * @ORM\OneToOne(targetEntity=\App\Entity\DetalleOperacion::class, inversedBy="actividad")
  272.      * @ORM\JoinColumn(name="detalle_operacion_id", referencedColumnName="id", unique=true)
  273.      */
  274.     private $detalleOperacion;
  275.     /**
  276.      * @ORM\ManyToOne(targetEntity=\App\Entity\Cliente::class, inversedBy="actividades")
  277.      * @ORM\JoinColumn(name="cliente_id", referencedColumnName="id")
  278.      */
  279.     private $cliente;
  280.     /**
  281.      * @ORM\ManyToOne(targetEntity=\App\Entity\Marca::class, inversedBy="actividades")
  282.      * @ORM\JoinColumn(name="reloj_marca_id", referencedColumnName="id")
  283.      */
  284.     private $relojMarca;
  285.     /**
  286.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoAspecto::class, inversedBy="actividades")
  287.      * @ORM\JoinColumn(name="reloj_estado_id", referencedColumnName="id")
  288.      */
  289.     private $relojAspecto;
  290.     /**
  291.      * @ORM\ManyToOne(targetEntity=\App\Entity\UnidadNegocio::class, inversedBy="actividades")
  292.      * @ORM\JoinColumn(name="unidad_negocio_id", referencedColumnName="id")
  293.      */
  294.     private $unidadNegocio;
  295.     /**
  296.      * @ORM\ManyToOne(targetEntity=\App\Entity\Usuario::class, inversedBy="actividades")
  297.      * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id")
  298.      */
  299.     private $usuario;
  300.     /**
  301.      * @ORM\ManyToOne(targetEntity=\App\Entity\Canal::class, inversedBy="actividades")
  302.      * @ORM\JoinColumn(name="canal_id", referencedColumnName="id")
  303.      */
  304.     private $canal;
  305.     /**
  306.      * @ORM\ManyToOne(targetEntity=\App\Entity\EstadoActividad::class, inversedBy="actividades")
  307.      * @ORM\JoinColumn(name="estado_id", referencedColumnName="id")
  308.      */
  309.     private $estado;
  310.     /**
  311.      * @ORM\Column(type="datetime", nullable=true, name="fecha_compra")
  312.      */
  313.     private $fechaCompra;
  314.     /**
  315.      * @ORM\Column(type="float", nullable=true, name="precio_coste")
  316.      */
  317.     private $precioCoste;
  318.     /**
  319.      * @ORM\Column(type="float", nullable=true, name="precio_costes_compra", options={"comment":"costes asosciados"})
  320.      */
  321.     private $precioCostesCompra;
  322.     public function __toString(): string
  323.     {
  324.         return $this->IDperseo??'---';
  325.     }
  326.     public function getId(): ?string
  327.     {
  328.         return $this->id;
  329.     }
  330.     public function getIDperseo(): ?string
  331.     {
  332.         return $this->IDperseo;
  333.     }
  334.     public function setIDperseo(?string $IDperseo): static
  335.     {
  336.         $this->IDperseo $IDperseo;
  337.         return $this;
  338.     }
  339.     public function getFecha(): ?DateTimeInterface
  340.     {
  341.         return $this->fecha;
  342.     }
  343.     public function setFecha(?DateTimeInterface $fecha): static
  344.     {
  345.         $this->fecha $fecha;
  346.         $this->fechaAsentada $fecha;
  347.         return $this;
  348.     }
  349.     public function isExportacion(): ?bool
  350.     {
  351.         return $this->exportacion;
  352.     }
  353.     public function setExportacion(?bool $exportacion): static
  354.     {
  355.         $this->exportacion $exportacion;
  356.         return $this;
  357.     }
  358.     public function getRegimen(): ?string
  359.     {
  360.         return $this->regimen;
  361.     }
  362.     public function setRegimen(?string $regimen): static
  363.     {
  364.         $this->regimen $regimen;
  365.         return $this;
  366.     }
  367.     public function getClienteIdioma(): ?string
  368.     {
  369.         return $this->clienteIdioma;
  370.     }
  371.     public function setClienteIdioma(?string $clienteIdioma): static
  372.     {
  373.         $this->clienteIdioma $clienteIdioma;
  374.         return $this;
  375.     }
  376.     public function getClienteRazonSocial(): ?string
  377.     {
  378.         return $this->clienteRazonSocial;
  379.     }
  380.     public function setClienteRazonSocial(?string $clienteRazonSocial): static
  381.     {
  382.         $this->clienteRazonSocial $clienteRazonSocial;
  383.         return $this;
  384.     }
  385.     public function getClienteIdentificacionTipo(): ?string
  386.     {
  387.         return $this->clienteIdentificacionTipo;
  388.     }
  389.     public function setClienteIdentificacionTipo(?string $clienteIdentificacionTipo): static
  390.     {
  391.         $this->clienteIdentificacionTipo $clienteIdentificacionTipo;
  392.         return $this;
  393.     }
  394.     public function getClienteIdentificacion(): ?string
  395.     {
  396.         return $this->clienteIdentificacion;
  397.     }
  398.     public function setClienteIdentificacion(?string $clienteIdentificacion): static
  399.     {
  400.         $this->clienteIdentificacion $clienteIdentificacion;
  401.         return $this;
  402.     }
  403.     public function getClienteDireccion(): ?string
  404.     {
  405.         return $this->clienteDireccion;
  406.     }
  407.     public function setClienteDireccion(?string $clienteDireccion): static
  408.     {
  409.         $this->clienteDireccion $clienteDireccion;
  410.         return $this;
  411.     }
  412.     public function getClienteCp(): ?string
  413.     {
  414.         return $this->clienteCp;
  415.     }
  416.     public function setClienteCp(?string $clienteCp): static
  417.     {
  418.         $this->clienteCp $clienteCp;
  419.         return $this;
  420.     }
  421.     public function getClienteCiudad(): ?string
  422.     {
  423.         return $this->clienteCiudad;
  424.     }
  425.     public function setClienteCiudad(?string $clienteCiudad): static
  426.     {
  427.         $this->clienteCiudad $clienteCiudad;
  428.         return $this;
  429.     }
  430.     public function getClienteProvincia(): ?string
  431.     {
  432.         return $this->clienteProvincia;
  433.     }
  434.     public function setClienteProvincia(?string $clienteProvincia): static
  435.     {
  436.         $this->clienteProvincia $clienteProvincia;
  437.         return $this;
  438.     }
  439.     public function getClienteCcaa(): ?string
  440.     {
  441.         return $this->clienteCcaa;
  442.     }
  443.     public function setClienteCcaa(?string $clienteCcaa): static
  444.     {
  445.         $this->clienteCcaa $clienteCcaa;
  446.         return $this;
  447.     }
  448.     public function getClientePais(): ?string
  449.     {
  450.         return $this->clientePais;
  451.     }
  452.     public function setClientePais(?string $clientePais): static
  453.     {
  454.         $this->clientePais $clientePais;
  455.         return $this;
  456.     }
  457.     public function getClienteIdentificacionFrontal(): ?string
  458.     {
  459.         return $this->clienteIdentificacionFrontal;
  460.     }
  461.     public function setClienteIdentificacionFrontal(?string $clienteIdentificacionFrontal): static
  462.     {
  463.         $this->clienteIdentificacionFrontal $clienteIdentificacionFrontal;
  464.         return $this;
  465.     }
  466.     public function getClienteIdentificacionFrontalFile(): ?File
  467.     {
  468.         return $this->clienteIdentificacionFrontalFile;
  469.     }
  470.     public function setClienteIdentificacionFrontalFile(?File $clienteIdentificacionFrontalFile): static
  471.     {
  472.         $this->clienteIdentificacionFrontalFile $clienteIdentificacionFrontalFile;
  473.         if ($clienteIdentificacionFrontalFile) {
  474.             // if 'updatedAt' is not defined in your entity, use another property
  475.             $this->setUpdatedAt(new DateTime('now'));
  476.         }
  477.         return $this;
  478.     }
  479.     public function getClienteIdentificacionTrasera(): ?string
  480.     {
  481.         return $this->clienteIdentificacionTrasera;
  482.     }
  483.     public function setClienteIdentificacionTrasera(?string $clienteIdentificacionTrasera): static
  484.     {
  485.         $this->clienteIdentificacionTrasera $clienteIdentificacionTrasera;
  486.         return $this;
  487.     }
  488.     public function getClienteIdentificacionTraseraFile(): ?File
  489.     {
  490.         return $this->clienteIdentificacionTraseraFile;
  491.     }
  492.     public function setClienteIdentificacionTraseraFile(?File $clienteIdentificacionTraseraFile): static
  493.     {
  494.         $this->clienteIdentificacionTraseraFile $clienteIdentificacionTraseraFile;
  495.         if ($clienteIdentificacionTraseraFile) {
  496.             // if 'updatedAt' is not defined in your entity, use another property
  497.             $this->setUpdatedAt(new DateTime('now'));
  498.         }
  499.         return $this;
  500.     }
  501.     public function getClienteEntidadBancaria(): ?string
  502.     {
  503.         return $this->clienteEntidadBancaria;
  504.     }
  505.     public function setClienteEntidadBancaria(?string $clienteEntidadBancaria): static
  506.     {
  507.         $this->clienteEntidadBancaria $clienteEntidadBancaria;
  508.         return $this;
  509.     }
  510.     public function getClienteIban(): ?string
  511.     {
  512.         return $this->clienteIban;
  513.     }
  514.     public function setClienteIban(?string $clienteIban): static
  515.     {
  516.         $this->clienteIban $clienteIban;
  517.         return $this;
  518.     }
  519.     public function getClienteObservaciones(): ?string
  520.     {
  521.         return $this->clienteObservaciones;
  522.     }
  523.     public function setClienteObservaciones(?string $clienteObservaciones): static
  524.     {
  525.         $this->clienteObservaciones $clienteObservaciones;
  526.         return $this;
  527.     }
  528.     public function getDeletedAt(): ?DateTimeInterface
  529.     {
  530.         return $this->deletedAt;
  531.     }
  532.     public function setDeletedAt(?DateTimeInterface $deletedAt): static
  533.     {
  534.         $this->deletedAt $deletedAt;
  535.         return $this;
  536.     }
  537.     public function getUpdatedAt(): ?DateTimeInterface
  538.     {
  539.         return $this->updatedAt;
  540.     }
  541.     public function setUpdatedAt(DateTimeInterface $updatedAt): static
  542.     {
  543.         $this->updatedAt $updatedAt;
  544.         return $this;
  545.     }
  546.     public function getCreatedAt(): ?DateTimeInterface
  547.     {
  548.         return $this->createdAt;
  549.     }
  550.     public function setCreatedAt(DateTimeInterface $createdAt): static
  551.     {
  552.         $this->createdAt $createdAt;
  553.         return $this;
  554.     }
  555.     public function getDetalleOperacion(): ?DetalleOperacion
  556.     {
  557.         return $this->detalleOperacion;
  558.     }
  559.     public function setDetalleOperacion(?DetalleOperacion $detalleOperacion): static
  560.     {
  561.         $this->detalleOperacion $detalleOperacion;
  562.         return $this;
  563.     }
  564.     public function getCliente(): ?Cliente
  565.     {
  566.         return $this->cliente;
  567.     }
  568.     public function setCliente(?Cliente $cliente): static
  569.     {
  570.         $this->cliente $cliente;
  571.         return $this;
  572.     }
  573.     public function getExportacionStr():string
  574.     {
  575.         return $this->isExportacion() ? 'Exportacion' 'Europa';
  576.     }
  577.     public function getRelojFoto(): ?string
  578.     {
  579.         return $this->relojFoto;
  580.     }
  581.     public function setRelojFoto(?string $relojFoto): static
  582.     {
  583.         $this->relojFoto $relojFoto;
  584.         return $this;
  585.     }
  586.     public function getRelojFotoFile(): ?File
  587.     {
  588.         return $this->relojFotoFile;
  589.     }
  590.     public function setRelojFotoFile(?File $relojFotoFile): self
  591.     {
  592.         $this->relojFotoFile $relojFotoFile;
  593.         if ($relojFotoFile) {
  594.             // if 'updatedAt' is not defined in your entity, use another property
  595.             $this->setUpdatedAt(new DateTime('now'));
  596.         }
  597.         return $this;
  598.     }
  599.     public function getRelojModelo1(): ?string
  600.     {
  601.         return $this->relojModelo1;
  602.     }
  603.     public function setRelojModelo1(?string $relojModelo1): static
  604.     {
  605.         $this->relojModelo1 $relojModelo1;
  606.         return $this;
  607.     }
  608.     public function getRelojModelo2(): ?string
  609.     {
  610.         return $this->relojModelo2;
  611.     }
  612.     public function setRelojModelo2(?string $relojModelo2): static
  613.     {
  614.         $this->relojModelo2 $relojModelo2;
  615.         return $this;
  616.     }
  617.     public function getRelojRef1(): ?string
  618.     {
  619.         return $this->relojRef1;
  620.     }
  621.     public function setRelojRef1(?string $relojRef1): static
  622.     {
  623.         $this->relojRef1 $relojRef1;
  624.         return $this;
  625.     }
  626.     public function getRelojRef2(): ?string
  627.     {
  628.         return $this->relojRef2;
  629.     }
  630.     public function setRelojRef2(?string $relojRef2): static
  631.     {
  632.         $this->relojRef2 $relojRef2;
  633.         return $this;
  634.     }
  635.     public function getRelojSerie(): ?string
  636.     {
  637.         return $this->relojSerie;
  638.     }
  639.     public function setRelojSerie(?string $relojSerie): static
  640.     {
  641.         $this->relojSerie $relojSerie;
  642.         return $this;
  643.     }
  644.     public function getRelojFecha(): ?DateTimeInterface
  645.     {
  646.         return $this->relojFecha;
  647.     }
  648.     public function setRelojFecha(?DateTimeInterface $relojFecha): static
  649.     {
  650.         $this->relojFecha $relojFecha;
  651.         return $this;
  652.     }
  653.     public function isRelojCaja(): ?bool
  654.     {
  655.         return $this->relojCaja;
  656.     }
  657.     public function setRelojCaja(bool $relojCaja): static
  658.     {
  659.         $this->relojCaja $relojCaja;
  660.         return $this;
  661.     }
  662.     public function isRelojPapeles(): ?bool
  663.     {
  664.         return $this->relojPapeles;
  665.     }
  666.     public function setRelojPapeles(bool $relojPapeles): static
  667.     {
  668.         $this->relojPapeles $relojPapeles;
  669.         return $this;
  670.     }
  671.     public function getRelojAspecto(): ?EstadoAspecto
  672.     {
  673.         return $this->relojAspecto;
  674.     }
  675.     public function setRelojAspecto(?EstadoAspecto $relojAspecto): static
  676.     {
  677.         $this->relojAspecto $relojAspecto;
  678.         return $this;
  679.     }
  680.     public function getRelojMarca(): ?Marca
  681.     {
  682.         return $this->relojMarca;
  683.     }
  684.     public function setRelojMarca(?Marca $relojMarca): static
  685.     {
  686.         $this->relojMarca $relojMarca;
  687.         return $this;
  688.     }
  689.     public function getUnidadNegocio(): ?UnidadNegocio
  690.     {
  691.         return $this->unidadNegocio;
  692.     }
  693.     public function setUnidadNegocio(?UnidadNegocio $unidadNegocio): static
  694.     {
  695.         $this->unidadNegocio $unidadNegocio;
  696.         return $this;
  697.     }
  698.     public function getUsuario(): ?Usuario
  699.     {
  700.         return $this->usuario;
  701.     }
  702.     public function setUsuario(?Usuario $usuario): static
  703.     {
  704.         $this->usuario $usuario;
  705.         return $this;
  706.     }
  707.     public function getCanal(): ?Canal
  708.     {
  709.         return $this->canal;
  710.     }
  711.     public function setCanal(?Canal $canal): static
  712.     {
  713.         $this->canal $canal;
  714.         return $this;
  715.     }
  716.     public function isTipoCliente(): ?bool
  717.     {
  718.         return $this->tipoCliente;
  719.     }
  720.     public function setTipoCliente(?bool $tipoCliente): static
  721.     {
  722.         $this->tipoCliente $tipoCliente;
  723.         return $this;
  724.     }
  725.     public function getIdioma(): ?string
  726.     {
  727.         return $this->idioma;
  728.     }
  729.     public function setIdioma(?string $idioma): static
  730.     {
  731.         $this->idioma $idioma;
  732.         return $this;
  733.     }
  734.     public function getTipo(): ?string
  735.     {
  736.         return $this->tipo;
  737.     }
  738.     public function setTipo(?string $tipo): static
  739.     {
  740.         $this->tipo $tipo;
  741.         return $this;
  742.     }
  743.     public function getImporte():?float
  744.     {
  745.         return $this instanceof ActividadCompra $this->getPrecioCoste() : $this->getPrecio();
  746.     }
  747.     public function getRelojStr():string
  748.     {
  749.         return implode(', ', [$this->getRelojMarca(), $this->getRelojModelo1()]);
  750.     }
  751.     public function getFechaVenta():?DateTimeInterface
  752.     {
  753.         return $this instanceof ActividadVenta $this->getFecha() : null;
  754.     }
  755.     public function getPrecioCoste():?float
  756.     {
  757.         return $this instanceof ActividadCompra $this->getPrecioCoste() : null;
  758.     }
  759.     public function getPrecioVenta():?float
  760.     {
  761.         return $this instanceof ActividadVenta $this->getPrecioVenta() : null;
  762.     }
  763.     public function getClienteRegion(): ?string
  764.     {
  765.         return $this->clienteRegion;
  766.     }
  767.     public function setClienteRegion(?string $clienteRegion): static
  768.     {
  769.         $this->clienteRegion $clienteRegion;
  770.         return $this;
  771.     }
  772.     public function getEstado(): ?EstadoActividad
  773.     {
  774.         return $this->estado;
  775.     }
  776.     public function setEstado(?EstadoActividad $estado): static
  777.     {
  778.         $this->estado $estado;
  779.         return $this;
  780.     }
  781.     public function getFechaPendiente(): ?DateTimeInterface
  782.     {
  783.         return $this->fechaPendiente;
  784.     }
  785.     public function setFechaPendiente(?DateTimeInterface $fechaPendiente): static
  786.     {
  787.         $this->fechaAsentada $fechaPendiente;
  788.         $this->fecha $fechaPendiente;
  789.         return $this;
  790.     }
  791.     public function getFechaAsentada(): ?DateTimeInterface
  792.     {
  793.         return $this->fechaAsentada;
  794.     }
  795.     public function setFechaAsentada(?DateTimeInterface $fechaAsentada): static
  796.     {
  797.         $this->fechaAsentada $fechaAsentada;
  798.         return $this;
  799.     }
  800.     public function getFechaConfirmada(): ?DateTimeInterface
  801.     {
  802.         return $this->fechaConfirmada;
  803.     }
  804.     public function setFechaConfirmada(?DateTimeInterface $fechaConfirmada): static
  805.     {
  806.         $this->fechaConfirmada $fechaConfirmada;
  807.         return $this;
  808.     }
  809.     public function getFechaFacturada(): ?DateTimeInterface
  810.     {
  811.         return $this->fechaFacturada;
  812.     }
  813.     public function setFechaFacturada(?DateTimeInterface $fechaFacturada): static
  814.     {
  815.         $this->fechaFacturada $fechaFacturada;
  816.         return $this;
  817.     }
  818.     public function getFechaCancelada(): ?DateTimeInterface
  819.     {
  820.         return $this->fechaCancelada;
  821.     }
  822.     public function setFechaCancelada(?DateTimeInterface $fechaCancelada): static
  823.     {
  824.         $this->fechaCancelada $fechaCancelada;
  825.         return $this;
  826.     }
  827.     public function getFechaAnulada(): ?DateTimeInterface
  828.     {
  829.         return $this->fechaAnulada;
  830.     }
  831.     public function setFechaAnulada(?DateTimeInterface $fechaAnulada): static
  832.     {
  833.         $this->fechaAnulada $fechaAnulada;
  834.         return $this;
  835.     }
  836.     public function getEstadoFecha(): ?DateTimeInterface
  837.     {
  838.         switch($this->getEstado()?->getKey())
  839.         {
  840.             case EstadoActividadEnum::ESTADO_PENDIENTE:
  841.                 $fecha $this->getFechaPendiente();
  842.                 break;
  843.             case EstadoActividadEnum::ESTADO_ASENTADA:
  844.                 $fecha $this->getFechaAsentada();
  845.                 break;
  846.             case EstadoActividadEnum::ESTADO_CONFIRMADA:
  847.                 $fecha $this->getFechaConfirmada();
  848.                 break;
  849.             case EstadoActividadEnum::ESTADO_FACTURADA:
  850.                 $fecha $this->getFechaFacturada();
  851.                 break;
  852.             case EstadoActividadEnum::ESTADO_CANCELADA:
  853.                 $fecha $this->getFechaCancelada();
  854.                 break;
  855.             case EstadoActividadEnum::ESTADO_ANULADA:
  856.                 $fecha $this->getFechaAnulada();
  857.                 break;
  858.             case EstadoActividadEnum::ESTADO_ABONADA:
  859.                 $fecha $this->getFechaAbonada();
  860.                 break;
  861.             default:
  862.                 $fecha null;
  863.                 break;
  864.         }
  865.         return $fecha;
  866.     }
  867.     public function isPending():bool
  868.     {
  869.         return $this->getEstado()->getKey() === EstadoActividadEnum::ESTADO_PENDIENTE;
  870.     }
  871.     public function isSettled(): bool
  872.     {
  873.         return $this->getEstado()->getKey() === EstadoActividadEnum::ESTADO_ASENTADA;
  874.     }
  875.     public function isCancelled(): bool
  876.     {
  877.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_CANCELADA;
  878.     }
  879.     public function isAnnulled(): bool
  880.     {
  881.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_ANULADA;
  882.     }
  883.     public function isPaid(): bool
  884.     {
  885.         return $this->getEstado()?->getKey() === EstadoActividadEnum::ESTADO_ABONADA;
  886.     }
  887.     public function getRelojModelos(): ?string
  888.     {
  889.         return implode(' 'array_filter([$this->getRelojModelo1(), $this->getRelojModelo2()]));
  890.     }
  891.     public function getRelojRefs(): ?string
  892.     {
  893.         return implode(''array_filter([$this->getRelojRef1(), $this->getRelojRef2()]));
  894.     }
  895.     public function getRelojMarcaStr(): ?string
  896.     {
  897.         return $this->relojMarcaStr;
  898.     }
  899.     public function setRelojMarcaStr(?string $relojMarcaStr): static
  900.     {
  901.         $this->relojMarcaStr $relojMarcaStr;
  902.         return $this;
  903.     }
  904.     public function getFechaAbonada(): ?\DateTimeInterface
  905.     {
  906.         return $this->fechaAbonada;
  907.     }
  908.     public function setFechaAbonada(?\DateTimeInterface $fechaAbonada): static
  909.     {
  910.         $this->fechaAbonada $fechaAbonada;
  911.         return $this;
  912.     }
  913.     public function getFechaFactura(): ?\DateTimeInterface
  914.     {
  915.         return $this->fechaFactura;
  916.     }
  917.     public function setFechaFactura(?\DateTimeInterface $fechaFactura): static
  918.     {
  919.         $this->fechaFactura $fechaFactura;
  920.         return $this;
  921.     }
  922.     public function getNumeroFactura(): ?string
  923.     {
  924.         return $this->numeroFactura;
  925.     }
  926.     public function setNumeroFactura(?string $numeroFactura): static
  927.     {
  928.         $this->numeroFactura $numeroFactura;
  929.         return $this;
  930.     }
  931.     public function getPrecioCosteTotal(): ?float
  932.     {
  933.         return $this->precioCosteTotal;
  934.     }
  935.     public function setPrecioCosteTotal(?float $precioCosteTotal): static
  936.     {
  937.         $this->precioCosteTotal $precioCosteTotal;
  938.         return $this;
  939.     }
  940.     public function getFechaCompra(): ?\DateTimeInterface
  941.     {
  942.         return $this->fechaCompra;
  943.     }
  944.     public function setFechaCompra(?\DateTimeInterface $fechaCompra): static
  945.     {
  946.         $this->fechaCompra $fechaCompra;
  947.         return $this;
  948.     }
  949.     public function setPrecioCoste(?float $precioCoste): static
  950.     {
  951.         $this->precioCoste $precioCoste;
  952.         return $this;
  953.     }
  954.     public function getPrecioCostesCompra(): ?float
  955.     {
  956.         return $this->precioCostesCompra;
  957.     }
  958.     public function setPrecioCostesCompra(?float $precioCostesCompra): static
  959.     {
  960.         $this->precioCostesCompra $precioCostesCompra;
  961.         return $this;
  962.     }
  963.     public function getClienteSwift(): ?string
  964.     {
  965.         return $this->clienteSwift;
  966.     }
  967.     public function setClienteSwift(?string $clienteSwift): static
  968.     {
  969.         $this->clienteSwift $clienteSwift;
  970.         return $this;
  971.     }
  972.     public function getClienteTelefono(): ?string
  973.     {
  974.         return $this->clienteTelefono;
  975.     }
  976.     public function setClienteTelefono(?string $clienteTelefono): static
  977.     {
  978.         $this->clienteTelefono $clienteTelefono;
  979.         return $this;
  980.     }
  981.     public function getClienteEmail(): ?string
  982.     {
  983.         return $this->clienteEmail;
  984.     }
  985.     public function setClienteEmail(?string $clienteEmail): static
  986.     {
  987.         $this->clienteEmail $clienteEmail;
  988.         return $this;
  989.     }
  990.     public function isBaja(): bool
  991.     {
  992.         return $this->tipo === TipoActividadEnum::ACTIVIDAD_BAJA;
  993.     }
  994. }