src/Entity/DeliveryNote.php line 18

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