src/Entity/DeliveryNote.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\MDS\VenuesBundle\Entity\ReservationInvoice;
  4. use App\MDS\VenuesBundle\Entity\ReservationInvoiceRec;
  5. use App\Repository\DeliveryNoteRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * @ORM\Entity(repositoryClass=DeliveryNoteRepository::class)
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class DeliveryNote
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="deliveryNotes")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $client;
  26.     /**
  27.      * @ORM\Column(type="string", length=30, nullable=true)
  28.      */
  29.     private $sageDeliveryNumber// Número de albarán
  30.     /**
  31.      * @ORM\Column(type="string", length=40, nullable=true)
  32.      */
  33.     private $sageInvoiceNumber//Número de factura
  34.     /**
  35.      * @ORM\Column(type="string", length=20, nullable=true)
  36.      */
  37.     private $sageAlmacen;
  38.     /**
  39.      * @ORM\Column(type="boolean")
  40.      */
  41.     private $factured;
  42.     /**
  43.      * @ORM\Column(type="boolean")
  44.      */
  45.     private $isRectificative;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=DeliveryNote::class, inversedBy="rectificativas")
  48.      */
  49.     private $rectifies;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity=DeliveryNote::class, mappedBy="rectifies")
  52.      */
  53.     private $rectificativas;
  54.     /**
  55.      * @ORM\Column(type="boolean")
  56.      */
  57.     private $sentToSage;
  58.     /**
  59.      * @ORM\Column(type="datetime", nullable=true)
  60.      */
  61.     private $syncDate;
  62.     /**
  63.      * @ORM\Column(type="datetime", nullable=true)
  64.      */
  65.     private $facturedAt;
  66.     /**
  67.      * @ORM\Column(type="datetime_immutable")
  68.      */
  69.     private $createdAt;
  70.     /**
  71.      * @ORM\Column(type="datetime_immutable")
  72.      */
  73.     private $updatedAt;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $lastError;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity=SettingsCompany::class, inversedBy="deliveryNotes")
  80.      * @ORM\JoinColumn(nullable=false)
  81.      */
  82.     private $sageCompany;
  83.     /**
  84.      * @ORM\Column(type="string", length=5, nullable=true)
  85.      */
  86.     private $letter;
  87.     /**
  88.      * @ORM\OneToOne(targetEntity=ReservationInvoice::class, inversedBy="deliveryNote", cascade={"persist", "remove"})
  89.      * @ORM\JoinColumn(nullable=true)
  90.      */
  91.     private $reservationInvoice;
  92.     /**
  93.      * @ORM\OneToOne(targetEntity=ReservationInvoiceRec::class, inversedBy="deliveryNote", cascade={"persist", "remove"})
  94.      */
  95.     private $reservationInvoiceRec;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $pdf// Letra de la Factura. Indica la serie de la factura
  100.     public function __construct()
  101.     {
  102.         $this->rectificativas = new ArrayCollection();
  103.     }
  104.     public function getId(): ?int
  105.     {
  106.         return $this->id;
  107.     }
  108.     public function getClient(): ?Client
  109.     {
  110.         return $this->client;
  111.     }
  112.     public function setClient(?Client $client): self
  113.     {
  114.         $this->client $client;
  115.         return $this;
  116.     }
  117.     public function getSageDeliveryNumber(): ?string
  118.     {
  119.         return $this->sageDeliveryNumber;
  120.     }
  121.     public function setSageDeliveryNumber(?string $sageDeliveryNumber): self
  122.     {
  123.         $this->sageDeliveryNumber $sageDeliveryNumber;
  124.         return $this;
  125.     }
  126.     public function getSageInvoiceNumber(): ?string
  127.     {
  128.         return $this->sageInvoiceNumber;
  129.     }
  130.     public function setSageInvoiceNumber(?string $sageInvoiceNumber): self
  131.     {
  132.         $this->sageInvoiceNumber $sageInvoiceNumber;
  133.         return $this;
  134.     }
  135.     public function getSageAlmacen(): ?string
  136.     {
  137.         return $this->sageAlmacen;
  138.     }
  139.     public function setSageAlmacen(?string $sageAlmacen): self
  140.     {
  141.         $this->sageAlmacen $sageAlmacen;
  142.         return $this;
  143.     }
  144.     public function isFactured(): ?bool
  145.     {
  146.         return $this->factured;
  147.     }
  148.     public function setFactured(bool $factured): self
  149.     {
  150.         $this->factured $factured;
  151.         return $this;
  152.     }
  153.     public function isIsRectificative(): ?bool
  154.     {
  155.         return $this->isRectificative;
  156.     }
  157.     public function setIsRectificative(bool $isRectificative): self
  158.     {
  159.         $this->isRectificative $isRectificative;
  160.         return $this;
  161.     }
  162.     public function getRectifies(): ?self
  163.     {
  164.         return $this->rectifies;
  165.     }
  166.     public function setRectifies(?self $rectifies): self
  167.     {
  168.         $this->rectifies $rectifies;
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return Collection<int, self>
  173.      */
  174.     public function getRectivicativas(): Collection
  175.     {
  176.         return $this->rectificativas;
  177.     }
  178.     public function addRectivicativa(self $rectificativas): self
  179.     {
  180.         if (!$this->rectificativas->contains($rectificativas)) {
  181.             $this->rectificativas[] = $rectificativas;
  182.             $rectificativas->setRectifies($this);
  183.         }
  184.         return $this;
  185.     }
  186.     public function removeRectivicativa(self $rectificativas): self
  187.     {
  188.         if ($this->rectificativas->removeElement($rectificativas)) {
  189.             // set the owning side to null (unless already changed)
  190.             if ($rectificativas->getRectifies() === $this) {
  191.                 $rectificativas->setRectifies(null);
  192.             }
  193.         }
  194.         return $this;
  195.     }
  196.     public function isSentToSage(): ?bool
  197.     {
  198.         return $this->sentToSage;
  199.     }
  200.     public function setSentToSage(bool $sentToSage): self
  201.     {
  202.         $this->sentToSage $sentToSage;
  203.         return $this;
  204.     }
  205.     public function getSyncDate(): ?\DateTimeInterface
  206.     {
  207.         return $this->syncDate;
  208.     }
  209.     public function setSyncDate(?\DateTimeInterface $syncDate): self
  210.     {
  211.         $this->syncDate $syncDate;
  212.         return $this;
  213.     }
  214.     public function getFacturedAt(): ?\DateTimeInterface
  215.     {
  216.         return $this->facturedAt;
  217.     }
  218.     public function setFacturedAt(?\DateTimeInterface $facturedAt): self
  219.     {
  220.         $this->facturedAt $facturedAt;
  221.         return $this;
  222.     }
  223.     public function getCreatedAt(): ?\DateTimeImmutable
  224.     {
  225.         return $this->createdAt;
  226.     }
  227.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  228.     {
  229.         $this->createdAt $createdAt;
  230.         return $this;
  231.     }
  232.     public function getUpdatedAt(): ?\DateTimeImmutable
  233.     {
  234.         return $this->updatedAt;
  235.     }
  236.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  237.     {
  238.         $this->updatedAt $updatedAt;
  239.         return $this;
  240.     }
  241.     public function getLastError(): ?string
  242.     {
  243.         return $this->lastError;
  244.     }
  245.     public function setLastError(?string $lastError): self
  246.     {
  247.         $this->lastError $lastError;
  248.         return $this;
  249.     }
  250.     /**
  251.      * @ORM\PrePersist
  252.      */
  253.     public function prePersist(): void
  254.     {
  255.         $this->createdAt = new \DateTimeImmutable();
  256.         $this->updatedAt = new \DateTimeImmutable();
  257.     }
  258.     /**
  259.      * @ORM\PreUpdate
  260.      */
  261.     public function preUpdate(): void
  262.     {
  263.         $this->updatedAt = new \DateTimeImmutable();
  264.     }
  265.     public function getSageCompany(): ?SettingsCompany
  266.     {
  267.         return $this->sageCompany;
  268.     }
  269.     public function setSageCompany(?SettingsCompany $sageCompany): self
  270.     {
  271.         $this->sageCompany $sageCompany;
  272.         return $this;
  273.     }
  274.     public function getLetter(): ?string
  275.     {
  276.         return $this->letter;
  277.     }
  278.     public function setLetter(?string $letter): self
  279.     {
  280.         $this->letter $letter;
  281.         return $this;
  282.     }
  283.     public function getReservationInvoice(): ?ReservationInvoice
  284.     {
  285.         return $this->reservationInvoice;
  286.     }
  287.     public function setReservationInvoice(ReservationInvoice $reservationInvoice): self
  288.     {
  289.         $this->reservationInvoice $reservationInvoice;
  290.         return $this;
  291.     }
  292.     public function getReservationInvoiceRec(): ?ReservationInvoiceRec
  293.     {
  294.         return $this->reservationInvoiceRec;
  295.     }
  296.     public function setReservationInvoiceRec(?ReservationInvoiceRec $reservationInvoiceRec): self
  297.     {
  298.         $this->reservationInvoiceRec $reservationInvoiceRec;
  299.         return $this;
  300.     }
  301.     public function getPdf(): ?string
  302.     {
  303.         return $this->pdf;
  304.     }
  305.     public function setPdf(?string $pdf): self
  306.     {
  307.         $this->pdf $pdf;
  308.         return $this;
  309.     }
  310. }