src/Entity/ActividadAbstract.php line 32

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