<?php
namespace App\Entity;
use App\Repository\HtInvoiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HtInvoiceRepository::class)
*/
class HtInvoice
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer")
* Número identificador de la factura
*/
private $idNum;
/**
* @ORM\Column(type="string", length=3, nullable=true)
* Prefijo para la línea de facturación
*/
private $prefix;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $dateAt;
/**
* @ORM\Column(type="string", length=50)
*/
private $type;
/**
* @ORM\Column(type="float")
*/
private $totalNet;
/**
* @ORM\Column(type="string", length=255)
*/
private $vatTotalGroup;
/**
* @ORM\Column(type="float")
*/
private $total;
/**
* @ORM\Column(type="string", length=255)
*/
private $clientName;
/**
* @ORM\Column(type="string", length=255)
*/
private $clientAddress;
/**
* @ORM\Column(type="string", length=50)
*/
private $clientDocument;
/**
* @ORM\Column(type="string", length=50)
*/
private $clientType;
/**
* @ORM\Column(type="float")
*/
private $benefit;
/**
* @ORM\OneToMany(targetEntity=HtInvoiceItems::class, mappedBy="invoice", orphanRemoval=true)
*/
private $htInvoiceItems;
/**
* @ORM\ManyToOne(targetEntity=HtFile::class, inversedBy="htInvoices")
* @ORM\JoinColumn(nullable=false)
*/
private $htFile;
/**
* @ORM\Column(type="string", length=20, nullable=true)
* Id en la tabla de la factura que rectifica.
*/
private $invoiceToRec;
public function __construct()
{
$this->htInvoiceItems = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdNum(): ?int
{
return $this->idNum;
}
public function setIdNum(int $idNum): self
{
$this->idNum = $idNum;
return $this;
}
public function getPrefix(): ?string
{
return $this->prefix;
}
public function setPrefix(?string $prefix): self
{
$this->prefix = $prefix;
return $this;
}
public function getDateAt(): ?\DateTimeImmutable
{
return $this->dateAt;
}
public function setDateAt(\DateTimeImmutable $dateAt): self
{
$this->dateAt = $dateAt;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getTotalNet(): ?float
{
return $this->totalNet;
}
public function setTotalNet(float $totalNet): self
{
$this->totalNet = $totalNet;
return $this;
}
// public function getVatTotalGroup(): ?array
// {
// return $this->vatTotalGroup;
// }
//
// public function setVatTotalGroup(array $vatTotalGroup): self
// {
// $this->vatTotalGroup = $vatTotalGroup;
//
// return $this;
// }
public function getVatTotalGroup(): ?string
{
return $this->vatTotalGroup;
}
public function setVatTotalGroup(string $vatTotalGroup): self
{
$this->vatTotalGroup = $vatTotalGroup;
return $this;
}
public function getTotal(): ?float
{
return $this->total;
}
public function setTotal(float $total): self
{
$this->total = $total;
return $this;
}
public function getClientName(): ?string
{
return $this->clientName;
}
public function setClientName(string $clientName): self
{
$this->clientName = $clientName;
return $this;
}
public function getClientAddress(): ?string
{
return $this->clientAddress;
}
public function setClientAddress(string $clientAddress): self
{
$this->clientAddress = $clientAddress;
return $this;
}
public function getClientDocument(): ?string
{
return $this->clientDocument;
}
public function setClientDocument(string $clientDocument): self
{
$this->clientDocument = $clientDocument;
return $this;
}
public function getClientType(): ?string
{
return $this->clientType;
}
public function setClientType(string $clientType): self
{
$this->clientType = $clientType;
return $this;
}
public function getBenefit(): ?float
{
return $this->benefit;
}
public function setBenefit(float $benefit): self
{
$this->benefit = $benefit;
return $this;
}
/**
* @return Collection<int, HtInvoiceItems>
*/
public function getHtInvoiceItems(): Collection
{
return $this->htInvoiceItems;
}
public function addHtInvoiceItem(HtInvoiceItems $htInvoiceItem): self
{
if (!$this->htInvoiceItems->contains($htInvoiceItem)) {
$this->htInvoiceItems[] = $htInvoiceItem;
$htInvoiceItem->setInvoice($this);
}
return $this;
}
public function removeHtInvoiceItem(HtInvoiceItems $htInvoiceItem): self
{
if ($this->htInvoiceItems->removeElement($htInvoiceItem)) {
// set the owning side to null (unless already changed)
if ($htInvoiceItem->getInvoice() === $this) {
$htInvoiceItem->setInvoice(null);
}
}
return $this;
}
public function getHtFile(): ?HtFile
{
return $this->htFile;
}
public function setHtFile(?HtFile $htFile): self
{
$this->htFile = $htFile;
return $this;
}
public function getInvoiceToRec(): ?string
{
return $this->invoiceToRec;
}
public function setInvoiceToRec(?string $invoiceToRec): self
{
$this->invoiceToRec = $invoiceToRec;
return $this;
}
}