src/Entity/SriInfo.php line 19
<?php/** @author Guerby Duval <info@tranzaksyon.com>* @link https://tranzaksyon.com* @copyright You are not allowed to remove this author "Guerby Duval <info@tranzaksyon.com>", the link "https://tranzaksyon.com" neither this copyright.*/namespace App\Entity;use App\Repository\SriInfoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints\Length;use Symfony\Component\Validator\Constraints\NotBlank;#[ORM\Entity(repositoryClass: SriInfoRepository::class)]class SriInfo{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 150)]#[NotBlank(message: 'No se pudo recuperar la razón social del SRI.')]#[Length(min: 3)]private ?string $razonSocial = null;#[ORM\Column(length: 20)]#[Length(min: 6, max: 10)]#[NotBlank(message: 'Por favor ingrese el RUC de la empresa o el Ruc es invalido.')]private ?string $ruc = null;#[ORM\Column(length: 150, nullable: true)]// #[NotBlank]// #[Length(min: 3)]private ?string $direction = null;#[ORM\Column(length: 60, nullable: true)]// #[NotBlank]// #[Length(min: 3)]// #[Email]private ?string $email = null;#[ORM\Column(length: 3, nullable: true)]// #[NotBlank]// #[Length(min: 3, max: 3)]private ?string $serie1 = null;#[ORM\Column(length: 3, nullable: true)]// #[NotBlank]// #[Length(min: 3, max: 3)]private ?string $serie2 = null;#[ORM\ManyToOne(cascade: ['remove'], inversedBy: 'sriInfos')]#[ORM\JoinColumn(nullable: false)]private ?User $user = null;#[ORM\Column(nullable: true)]// #[NotNull(message: 'No se pudo recuperar si es obligado llevar contabilidad del SRI.')]private ?bool $obligadoContabilidad = null;#[ORM\ManyToOne(cascade: ['remove'], fetch: 'LAZY', inversedBy: 'sriInfos')]private ?Certificate $certificate = null;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: Sequence::class, cascade: ['persist'], orphanRemoval: true)]private Collection $sequences;#[ORM\Column(length: 255, nullable: true)]private ?string $logo = null;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: Invoice::class, orphanRemoval: true)]private Collection $invoices;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: Tax::class, orphanRemoval: true)]private Collection $taxes;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: Product::class, orphanRemoval: true)]private Collection $products;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: Client::class, orphanRemoval: true)]private Collection $clients;#[ORM\OneToOne(mappedBy: 'SriInfo', cascade: ['persist', 'remove'])]private ?EmailConfiguration $emailConfiguration = null;#[ORM\Column(nullable: true)]private ?int $agenteRetencion = null;#[ORM\Column(nullable: true)]private ?bool $contribuyenteRimpe = null;#[ORM\Column(length: 20, nullable: true)]private ?string $contribuyenteEspecial = null;#[ORM\OneToOne(mappedBy: 'company', cascade: ['persist', 'remove'])]private ?SaasConfiguration $limits = null;#[ORM\OneToMany(mappedBy: 'company', targetEntity: Sucursal::class, orphanRemoval: true)]private Collection $sucursals;#[ORM\ManyToOne(inversedBy: 'disableCompanies')]private ?User $disabledBy = null;#[ORM\Column(length: 255, nullable: true)]private ?string $contribuyenteRimpeText = null;#[ORM\Column(length: 15, nullable: true)]private ?string $phone = null;#[ORM\OneToOne(mappedBy: 'company', cascade: ['persist', 'remove'])]private ?AppConfig $appConfig = null;#[ORM\Column(length: 255, nullable: true)]private ?string $leyenda = null;#[ORM\Column(length: 255, nullable: true)]private ?string $commercialName = null;#[ORM\Column(nullable: true, options: ['default' => '0'])]private ?bool $useCommercialName = null;#[ORM\OneToOne(inversedBy: 'sriInfo', cascade: ['persist', 'remove'])]private ?Company $company = null;#[ORM\Column(length: 5, nullable: true)]#[NotBlank]#[Length(exactly: 4, exactMessage: 'Tiene que ser 4 dÃgitos. Usar 0 como prefijo. Ejemplo: 0001')]private ?string $idCSC = null;#[ORM\Column(length: 150, nullable: true)]#[NotBlank]private ?string $csc = null;#[ORM\Column(length: 60)]#[NotBlank]private ?string $timbrado = null;#[ORM\Column(type: Types::DATE_MUTABLE)]#[NotBlank]private ?\DateTimeInterface $fechaTimbrado = null;#[ORM\Column(length: 10)]#[NotBlank]private ?string $tipoContribuyente = null;#[ORM\Column(length: 10)]#[NotBlank]private ?string $tipoRegimen = null;#[ORM\OneToMany(mappedBy: 'sriInfo', targetEntity: ActividadEconomica::class, orphanRemoval: true)]private Collection $actividadEconomicas;#[ORM\OneToMany(mappedBy: 'company', targetEntity: SriPayment::class)]private Collection $sriPayments;#[ORM\OneToMany(mappedBy: 'company', targetEntity: PaymentCredit::class, orphanRemoval: true)]private Collection $paymentCredits;#[ORM\Column(nullable: true)]private ?bool $demo = null;public function __construct(){$this->sequences = new ArrayCollection();$this->invoices = new ArrayCollection();$this->taxes = new ArrayCollection();$this->products = new ArrayCollection();$this->clients = new ArrayCollection();$this->sucursals = new ArrayCollection();$this->actividadEconomicas = new ArrayCollection();$this->sriPayments = new ArrayCollection();$this->paymentCredits = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getRazonSocial(): ?string{return $this->razonSocial;}public function setRazonSocial(string $razonSocial): self{$this->razonSocial = $razonSocial;return $this;}public function getRuc(): ?string{return $this->ruc;}public function setRuc(string $ruc): self{$this->ruc = $ruc;return $this;}public function getDirection(): ?string{return $this->direction;}public function setDirection(string $direction): self{$this->direction = $direction;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(?string $email): self{$this->email = $email;return $this;}public function getSerie1(): ?string{return $this->serie1;}public function setSerie1(string $serie1): self{$this->serie1 = $serie1;return $this;}public function getSerie2(): ?string{return $this->serie2;}public function setSerie2(string $serie2): self{$this->serie2 = $serie2;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): self{$this->user = $user;return $this;}public function isObligadoContabilidad(): ?bool{return $this->obligadoContabilidad;}public function setObligadoContabilidad(bool $obligadoContabilidad): self{$this->obligadoContabilidad = $obligadoContabilidad;return $this;}public function getCertificate(): ?Certificate{return $this->certificate;}public function setCertificate(?Certificate $certificate): self{$this->certificate = $certificate;return $this;}/*** @return Collection<int, Sequence>*/public function getSequences(): Collection{return $this->sequences;}public function addSequence(Sequence $sequence): self{if (!$this->sequences->contains($sequence)) {$this->sequences->add($sequence);$sequence->setSriInfo($this);}return $this;}public function removeSequence(Sequence $sequence): self{if ($this->sequences->removeElement($sequence)) {// set the owning side to null (unless already changed)if ($sequence->getSriInfo() === $this) {$sequence->setSriInfo(null);}}return $this;}public function getLogo(): ?string{return $this->logo;}public function setLogo(?string $logo): self{$this->logo = $logo;return $this;}/*** @return Collection<int, Invoice>*/public function getInvoices(): Collection{return $this->invoices;}public function addInvoice(Invoice $invoice): self{if (!$this->invoices->contains($invoice)) {$this->invoices->add($invoice);$invoice->setSriInfo($this);}return $this;}public function removeInvoice(Invoice $invoice): self{if ($this->invoices->removeElement($invoice)) {// set the owning side to null (unless already changed)if ($invoice->getSriInfo() === $this) {$invoice->setSriInfo(null);}}return $this;}/*** @return Collection<int, Tax>*/public function getTaxes(): Collection{return $this->taxes;}public function addTax(Tax $tax): self{if (!$this->taxes->contains($tax)) {$this->taxes->add($tax);$tax->setSriInfo($this);}return $this;}public function removeTax(Tax $tax): self{if ($this->taxes->removeElement($tax)) {// set the owning side to null (unless already changed)if ($tax->getSriInfo() === $this) {$tax->setSriInfo(null);}}return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): self{if (!$this->products->contains($product)) {$this->products->add($product);$product->setSriInfo($this);}return $this;}public function removeProduct(Product $product): self{if ($this->products->removeElement($product)) {// set the owning side to null (unless already changed)if ($product->getSriInfo() === $this) {$product->setSriInfo(null);}}return $this;}/*** @return Collection<int, Client>*/public function getClients(): Collection{return $this->clients;}public function addClient(Client $client): self{if (!$this->clients->contains($client)) {$this->clients->add($client);$client->setSriInfo($this);}return $this;}public function removeClient(Client $client): self{if ($this->clients->removeElement($client)) {// set the owning side to null (unless already changed)if ($client->getSriInfo() === $this) {$client->setSriInfo(null);}}return $this;}public function getEmailConfiguration(): ?EmailConfiguration{return $this->emailConfiguration;}public function setEmailConfiguration(EmailConfiguration $emailConfiguration): self{// set the owning side of the relation if necessaryif ($emailConfiguration->getSriInfo() !== $this) {$emailConfiguration->setSriInfo($this);}$this->emailConfiguration = $emailConfiguration;return $this;}public function getAgenteRetencion(): ?int{return $this->agenteRetencion;}public function setAgenteRetencion(?int $agenteRetencion): self{$this->agenteRetencion = $agenteRetencion;return $this;}public function isContribuyenteRimpe(): ?bool{return $this->contribuyenteRimpe;}public function setContribuyenteRimpe(?bool $contribuyenteRimpe): self{$this->contribuyenteRimpe = $contribuyenteRimpe;return $this;}public function getContribuyenteEspecial(): ?string{return $this->contribuyenteEspecial;}public function setContribuyenteEspecial(?string $contribuyenteEspecial): self{$this->contribuyenteEspecial = $contribuyenteEspecial;return $this;}public function getLimits(): ?SaasConfiguration{return $this->limits;}public function setLimits(SaasConfiguration $limits): self{// set the owning side of the relation if necessaryif ($limits->getCompany() !== $this) {$limits->setCompany($this);}$this->limits = $limits;return $this;}/*** @return Collection<int, Sucursal>*/public function getSucursals(): Collection{return $this->sucursals;}public function addSucursal(Sucursal $sucursal): self{if (!$this->sucursals->contains($sucursal)) {$this->sucursals->add($sucursal);$sucursal->setCompany($this);}return $this;}public function removeSucursal(Sucursal $sucursal): self{if ($this->sucursals->removeElement($sucursal)) {// set the owning side to null (unless already changed)if ($sucursal->getCompany() === $this) {$sucursal->setCompany(null);}}return $this;}public function getDisabledBy(): ?User{return $this->disabledBy;}public function setDisabledBy(?User $disabledBy): self{$this->disabledBy = $disabledBy;return $this;}public function getContribuyenteRimpeText(): ?string{return $this->contribuyenteRimpeText;}public function setContribuyenteRimpeText(?string $contribuyenteRimpeText): self{$this->contribuyenteRimpeText = $contribuyenteRimpeText;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): self{$this->phone = $phone;return $this;}public function getAppConfig(): ?AppConfig{return $this->appConfig;}public function setAppConfig(AppConfig $appConfig): self{// set the owning side of the relation if necessaryif ($appConfig->getCompany() !== $this) {$appConfig->setCompany($this);}$this->appConfig = $appConfig;return $this;}public function getLeyenda(): ?string{return $this->leyenda;}public function setLeyenda(?string $leyenda): self{$this->leyenda = $leyenda;return $this;}public function getCommercialName(): ?string{return $this->commercialName;}public function setCommercialName(?string $commercialName): static{$this->commercialName = $commercialName;return $this;}public function isUseCommercialName(): ?bool{return $this->useCommercialName;}public function setUseCommercialName(bool $useCommercialName): static{$this->useCommercialName = $useCommercialName;return $this;}public function getCompany(): ?Company{return $this->company;}public function setCompany(?Company $company): static{$this->company = $company;return $this;}public function __toString(): string{return $this->getRazonSocial() . ' - ' . $this->getRuc();}public function getIdCSC(): ?string{return $this->idCSC;}public function setIdCSC(?string $idCSC): static{$this->idCSC = $idCSC;return $this;}public function getCsc(): ?string{return $this->csc;}public function setCsc(?string $csc): static{$this->csc = $csc;return $this;}public function getTimbrado(): ?string{return $this->timbrado;}public function setTimbrado(?string $timbrado): static{$this->timbrado = $timbrado;return $this;}public function getFechaTimbrado(): ?\DateTimeInterface{return $this->fechaTimbrado;}public function setFechaTimbrado(?\DateTimeInterface $fechaTimbrado): static{$this->fechaTimbrado = $fechaTimbrado;return $this;}public function getTipoContribuyente(): ?string{return $this->tipoContribuyente;}public function setTipoContribuyente(?string $tipoContribuyente): static{$this->tipoContribuyente = $tipoContribuyente;return $this;}public function getTipoRegimen(): ?string{return $this->tipoRegimen;}public function setTipoRegimen(?string $tipoRegimen): static{$this->tipoRegimen = $tipoRegimen;return $this;}/*** @return Collection<int, ActividadEconomica>*/public function getActividadEconomicas(): Collection{return $this->actividadEconomicas;}public function addActividadEconomica(ActividadEconomica $actividadEconomica): static{if (!$this->actividadEconomicas->contains($actividadEconomica)) {$this->actividadEconomicas->add($actividadEconomica);$actividadEconomica->setSriInfo($this);}return $this;}public function removeActividadEconomica(ActividadEconomica $actividadEconomica): static{if ($this->actividadEconomicas->removeElement($actividadEconomica)) {// set the owning side to null (unless already changed)if ($actividadEconomica->getSriInfo() === $this) {$actividadEconomica->setSriInfo(null);}}return $this;}/*** @return Collection<int, SriPayment>*/public function getSriPayments(): Collection{return $this->sriPayments;}public function addSriPayment(SriPayment $sriPayment): static{if (!$this->sriPayments->contains($sriPayment)) {$this->sriPayments->add($sriPayment);$sriPayment->setCompany($this);}return $this;}public function removeSriPayment(SriPayment $sriPayment): static{if ($this->sriPayments->removeElement($sriPayment)) {// set the owning side to null (unless already changed)if ($sriPayment->getCompany() === $this) {$sriPayment->setCompany(null);}}return $this;}/*** @return Collection<int, PaymentCredit>*/public function getPaymentCredits(): Collection{return $this->paymentCredits;}public function addPaymentCredit(PaymentCredit $paymentCredit): static{if (!$this->paymentCredits->contains($paymentCredit)) {$this->paymentCredits->add($paymentCredit);$paymentCredit->setCompany($this);}return $this;}public function removePaymentCredit(PaymentCredit $paymentCredit): static{if ($this->paymentCredits->removeElement($paymentCredit)) {// set the owning side to null (unless already changed)if ($paymentCredit->getCompany() === $this) {$paymentCredit->setCompany(null);}}return $this;}public function isDemo(): ?bool{return $this->demo;}public function setDemo(?bool $demo): static{$this->demo = $demo;return $this;}}