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