<?php
namespace App\Entity;
use App\Repository\RFInventarioDocumentalComexRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Table(name: 'rf_inventario_documental_comex')]
#[ORM\Entity(repositoryClass: RFInventarioDocumentalComexRepository::class)]
#[UniqueEntity(fields: ['numeroDO'], errorPath: 'numeroDO', message: 'El DO indicado ya esta registrado')]
#[UniqueEntity(fields: ['numeroDOAsociado'], errorPath: 'numeroDOAsociado', message: 'El DO indicado ya esta registrado')]
class RFInventarioDocumentalComex {
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, unique: true)]
private ?string $numeroDO = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?TerEmpresaCliente $cliente = null;
#[ORM\Column(length: 255, unique: true, nullable: true)]
private ?string $numeroDOAsociado = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?TerAsociado $asociadoNegocio = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?TerSedeEmpresa $sede = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?ParTipoOperacion $tipoOperacion = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $fechaLevante = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $fechaVencimientoIMPEXP = null;
#[ORM\Column]
private ?float $tomo = null;
#[ORM\Column(type: Types::JSON, nullable: true)]
private array $folio = [];
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $observacion = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?RFFUID $FUID = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?ParEstado $estado = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createAt = null;
#[ORM\Column(length: 50)]
private ?string $createUser = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $updateAt = null;
#[ORM\Column(length: 50)]
private ?string $updateUser = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?ParTipoUbicacion $tipoUbicacion = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $numeroPosicion = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $archivo = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComex')]
private ?DocDocumento $documento = null;
#[ORM\ManyToOne(inversedBy: 'inventarioDocumentalComexDisponibilidad')]
private ?ParEstado $disponibilidad = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $fechaVencimiento = null;
#[ORM\OneToMany(mappedBy: 'do', targetEntity: JurOperacionSospechosa::class)]
private Collection $operacionSospechosa;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $fechaAperturaDO = null;
public function __construct()
{
$this->operacionSospechosa = new ArrayCollection();
}
public function __toString() {
return $this->getDocumento()->getNombre() . " " . $this->getNumeroDO();
}
public function getId(): ?int {
return $this->id;
}
public function getNumeroDO(): ?string {
return $this->numeroDO;
}
public function setNumeroDO(string $numeroDO): static {
$this->numeroDO = $numeroDO;
return $this;
}
public function getCliente(): ?TerEmpresaCliente {
return $this->cliente;
}
public function setCliente(?TerEmpresaCliente $cliente): static {
$this->cliente = $cliente;
return $this;
}
public function getNumeroDOAsociado(): ?string {
return $this->numeroDOAsociado;
}
public function setNumeroDOAsociado(string $numeroDOAsociado): static {
$this->numeroDOAsociado = $numeroDOAsociado;
return $this;
}
public function getAsociadoNegocio(): ?TerAsociado {
return $this->asociadoNegocio;
}
public function setAsociadoNegocio(?TerAsociado $asociadoNegocio): static {
$this->asociadoNegocio = $asociadoNegocio;
return $this;
}
public function getSede(): ?TerSedeEmpresa {
return $this->sede;
}
public function setSede(?TerSedeEmpresa $sede): static {
$this->sede = $sede;
return $this;
}
public function getTipoOperacion(): ?ParTipoOperacion {
return $this->tipoOperacion;
}
public function setTipoOperacion(?ParTipoOperacion $tipoOperacion): static {
$this->tipoOperacion = $tipoOperacion;
return $this;
}
public function getFechaLevante(): ?\DateTimeInterface {
return $this->fechaLevante;
}
public function setFechaLevante(\DateTimeInterface $fechaLevante): static {
$this->fechaLevante = $fechaLevante;
return $this;
}
public function getFechaVencimientoIMPEXP(): ?\DateTimeInterface {
return $this->fechaVencimientoIMPEXP;
}
public function setFechaVencimientoIMPEXP(?\DateTimeInterface $fechaVencimientoIMPEXP): static {
$this->fechaVencimientoIMPEXP = $fechaVencimientoIMPEXP;
return $this;
}
public function getTomo(): ?float {
return $this->tomo;
}
public function setTomo(float $tomo): static {
$this->tomo = $tomo;
return $this;
}
public function getFolio(): array
{
return $this->folio ?? [];
}
public function setFolio(array $folio): static
{
$this->folio = $folio;
return $this;
}
public function getObservacion(): ?string {
return $this->observacion;
}
public function setObservacion(?string $observacion): static {
$this->observacion = $observacion;
return $this;
}
public function getFUID(): ?RFFUID {
return $this->FUID;
}
public function setFUID(?RFFUID $FUID): static {
$this->FUID = $FUID;
return $this;
}
public function getEstado(): ?ParEstado {
return $this->estado;
}
public function setEstado(?ParEstado $estado): static {
$this->estado = $estado;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface {
return $this->createAt;
}
public function setCreateAt(\DateTimeInterface $createAt): static {
$this->createAt = $createAt;
return $this;
}
public function getCreateUser(): ?string {
return $this->createUser;
}
public function setCreateUser(string $createUser): static {
$this->createUser = $createUser;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface {
return $this->updateAt;
}
public function setUpdateAt(\DateTimeInterface $updateAt): static {
$this->updateAt = $updateAt;
return $this;
}
public function getUpdateUser(): ?string {
return $this->updateUser;
}
public function setUpdateUser(string $updateUser): static {
$this->updateUser = $updateUser;
return $this;
}
public function getTipoUbicacion(): ?ParTipoUbicacion {
return $this->tipoUbicacion;
}
public function setTipoUbicacion(?ParTipoUbicacion $tipoUbicacion): static {
$this->tipoUbicacion = $tipoUbicacion;
return $this;
}
public function getNumeroPosicion(): ?string {
return $this->numeroPosicion;
}
public function setNumeroPosicion(?string $numeroPosicion): static {
$this->numeroPosicion = $numeroPosicion;
return $this;
}
public function getArchivo(): ?string {
return $this->archivo;
}
public function setArchivo(?string $archivo): static {
$this->archivo = $archivo;
return $this;
}
public function getDocumento(): ?DocDocumento {
return $this->documento;
}
public function setDocumento(?DocDocumento $documento): static {
$this->documento = $documento;
return $this;
}
public function getDisponibilidad(): ?ParEstado {
return $this->disponibilidad;
}
public function setDisponibilidad(?ParEstado $disponibilidad): static {
$this->disponibilidad = $disponibilidad;
return $this;
}
public function getFechaVencimiento(): ?\DateTimeInterface {
return $this->fechaVencimiento;
}
public function setFechaVencimiento(?\DateTimeInterface $fechaVencimiento): static {
$this->fechaVencimiento = $fechaVencimiento;
return $this;
}
/**
* @return Collection<int, JurOperacionSospechosa>
*/
public function getOperacionSospechosa(): Collection
{
return $this->operacionSospechosa;
}
public function addOperacionSospechosa(JurOperacionSospechosa $operacionSospechosa): static
{
if (!$this->operacionSospechosa->contains($operacionSospechosa)) {
$this->operacionSospechosa->add($operacionSospechosa);
$operacionSospechosa->setDo($this);
}
return $this;
}
public function removeOperacionSospechosa(JurOperacionSospechosa $operacionSospechosa): static
{
if ($this->operacionSospechosa->removeElement($operacionSospechosa)) {
// set the owning side to null (unless already changed)
if ($operacionSospechosa->getDo() === $this) {
$operacionSospechosa->setDo(null);
}
}
return $this;
}
public function getFechaAperturaDO(): ?\DateTimeInterface
{
return $this->fechaAperturaDO;
}
public function setFechaAperturaDO(?\DateTimeInterface $fechaAperturaDO): static
{
$this->fechaAperturaDO = $fechaAperturaDO;
return $this;
}
}