src/Entity/SaleOrderInvoice.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SaleOrderInvoiceRepository;
  4. use App\Traits\DateTrait;
  5. use DateTimeImmutable;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=SaleOrderInvoiceRepository::class)
  9. */
  10. class SaleOrderInvoice
  11. {
  12. use DateTrait;
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. */
  18. private ?int $id = NULL;
  19. /**
  20. * Numéro de la facture
  21. *
  22. * @ORM\Column(type="string", length=10)
  23. */
  24. private ?string $reference = NULL;
  25. /**
  26. * @ORM\Column(type="string", length=255)
  27. */
  28. private ?string $name = NULL;
  29. /**
  30. * @ORM\Column(type="string", length=255)
  31. */
  32. private ?string $file = NULL;
  33. /**
  34. * Date de la facture
  35. *
  36. * @ORM\Column(type="datetime_immutable")
  37. */
  38. private ?DateTimeImmutable $invoiceDate = NULL;
  39. /**
  40. * Commande rattachée
  41. *
  42. * @ORM\OneToOne(targetEntity=SaleOrder::class, mappedBy="invoice", cascade={"persist"})
  43. */
  44. private ?SaleOrder $saleOrder = NULL;
  45. /**
  46. * @ORM\OneToOne(targetEntity=SaleOrderAddress::class, cascade={"persist", "remove"})
  47. */
  48. private ?SaleOrderAddress $overrideShippingAddress = NULL;
  49. /**
  50. * @ORM\OneToOne(targetEntity=SaleOrderAddress::class, cascade={"persist", "remove"})
  51. */
  52. private ?SaleOrderAddress $overrideBillingAddress = NULL;
  53. /**
  54. * @ORM\Column(type="float", nullable=true)
  55. */
  56. private ?float $overrideShippingPrice = NULL;
  57. /**
  58. * @ORM\Column(type="float", nullable=true)
  59. */
  60. private ?float $overrideLogisticFeesOrder = NULL;
  61. /**
  62. * @ORM\Column(type="json", nullable=true)
  63. */
  64. private ?array $overrideItems = NULL;
  65. public function getId(): ?int
  66. {
  67. return $this->id;
  68. }
  69. public function getName(): ?string
  70. {
  71. return $this->name;
  72. }
  73. public function setName( string $name ): self
  74. {
  75. $this->name = $name;
  76. return $this;
  77. }
  78. public function getFile(): ?string
  79. {
  80. return $this->file;
  81. }
  82. public function setFile( string $file ): self
  83. {
  84. $this->file = $file;
  85. return $this;
  86. }
  87. public function getInvoiceDate(): ?DateTimeImmutable
  88. {
  89. return $this->invoiceDate;
  90. }
  91. public function setInvoiceDate( DateTimeImmutable $invoiceDate ): self
  92. {
  93. $this->invoiceDate = $invoiceDate;
  94. return $this;
  95. }
  96. public function getSaleOrder(): ?SaleOrder
  97. {
  98. return $this->saleOrder;
  99. }
  100. public function setSaleOrder( ?SaleOrder $saleOrder ): self
  101. {
  102. // unset the owning side of the relation if necessary
  103. if ( $saleOrder === NULL && $this->saleOrder !== NULL ) {
  104. $this->saleOrder->setInvoice( NULL );
  105. }
  106. // set the owning side of the relation if necessary
  107. if ( $saleOrder !== NULL && $saleOrder->getInvoice() !== $this ) {
  108. $saleOrder->setInvoice( $this );
  109. }
  110. $this->saleOrder = $saleOrder;
  111. return $this;
  112. }
  113. public function getReference(): ?string
  114. {
  115. return $this->reference;
  116. }
  117. public function setReference( string $reference ): self
  118. {
  119. $this->reference = $reference;
  120. return $this;
  121. }
  122. public function getOverrideShippingAddress(): ?SaleOrderAddress
  123. {
  124. return $this->overrideShippingAddress;
  125. }
  126. public function setOverrideShippingAddress( ?SaleOrderAddress $overrideShippingAddress ): self
  127. {
  128. $this->overrideShippingAddress = $overrideShippingAddress;
  129. return $this;
  130. }
  131. public function getOverrideBillingAddress(): ?SaleOrderAddress
  132. {
  133. return $this->overrideBillingAddress;
  134. }
  135. public function setOverrideBillingAddress( ?SaleOrderAddress $overrideBillingAddress ): self
  136. {
  137. $this->overrideBillingAddress = $overrideBillingAddress;
  138. return $this;
  139. }
  140. public function getOverrideShippingPrice(): ?float
  141. {
  142. return $this->overrideShippingPrice;
  143. }
  144. public function setOverrideShippingPrice( ?float $overrideShippingPrice ): self
  145. {
  146. $this->overrideShippingPrice = $overrideShippingPrice;
  147. return $this;
  148. }
  149. public function getOverrideLogisticFeesOrder(): ?float
  150. {
  151. return $this->overrideLogisticFeesOrder;
  152. }
  153. public function setOverrideLogisticFeesOrder( ?float $overrideLogisticFeesOrder ): self
  154. {
  155. $this->overrideLogisticFeesOrder = $overrideLogisticFeesOrder;
  156. return $this;
  157. }
  158. public function getOverrideItems(): ?array
  159. {
  160. return $this->overrideItems;
  161. }
  162. public function setOverrideItems( ?array $overrideItems ): self
  163. {
  164. $this->overrideItems = $overrideItems;
  165. return $this;
  166. }
  167. }