src/Entity/System/IncomingStock.php line 26

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table(name="ps_stock_venideros",
  7. * uniqueConstraints={
  8. *
  9. * @ORM\UniqueConstraint(name="uk_product__product_attribute__purchase_line", columns={"id_product_attribute", "id_product", "id_purcharse_line"})
  10. * },
  11. * indexes={
  12. *
  13. * @ORM\Index(name="id_product_attribute", columns={"id_product_attribute"}),
  14. * @ORM\Index(name="date_next", columns={"date_next"}),
  15. * @ORM\Index(name="FK_ps_product_id_product", columns={"id_product"}),
  16. * @ORM\Index(name="id_purcharse_line", columns={"id_purcharse_line"}),
  17. * @ORM\Index(name="active_stock", columns={"active_stock"})
  18. * })
  19. *
  20. * @ORM\Entity(repositoryClass="App\Repository\System\IncomingStockRepository")
  21. */
  22. class IncomingStock
  23. {
  24. public const COURTESY_DAYS = 5;
  25. /**
  26. * @ORM\Column(name="id_stock_venideros", type="integer")
  27. *
  28. * @ORM\Id
  29. *
  30. * @ORM\GeneratedValue(strategy="AUTO")
  31. */
  32. private int $id;
  33. /**
  34. * @ORM\Column(type="datetime" ,nullable=true)
  35. */
  36. private ?\DateTime $dateNext;
  37. /**
  38. * @ORM\Column(type="integer", nullable=false, options={"default" : 0})
  39. */
  40. private int $quantity;
  41. /**
  42. * @ORM\Column(type="integer",name="id_purcharse_line", nullable=true)
  43. */
  44. private ?int $purchaseLineId;
  45. /**
  46. * @var ProductAttribute|null
  47. *
  48. * @ORM\ManyToOne(targetEntity="ProductAttribute", inversedBy="incommingStocks")
  49. *
  50. * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", nullable=true)
  51. */
  52. private $productAttribute;
  53. /**
  54. * @var Product
  55. *
  56. * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="incommingStocks")
  57. *
  58. * @ORM\JoinColumn(referencedColumnName="id_product", name="id_product", nullable=false)
  59. */
  60. private $product;
  61. /**
  62. * @ORM\Column(type="string" , length=50)
  63. */
  64. private string $purchaseOrder;
  65. /**
  66. * @ORM\Column(type="boolean" , nullable=true, options={"default" : 0})
  67. */
  68. private ?bool $purchaseConfirmed;
  69. /**
  70. * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  71. */
  72. private bool $activeStock;
  73. /**
  74. * @ORM\Column(type="datetime" ,nullable=false, options={"default":"CURRENT_TIMESTAMP"})
  75. */
  76. private \DateTime $date;
  77. public function getId(): int
  78. {
  79. return $this->id;
  80. }
  81. public function getDateNext(): ?\DateTime
  82. {
  83. return $this->dateNext;
  84. }
  85. public function setDateNext(?\DateTime $dateNext): IncomingStock
  86. {
  87. $this->dateNext = $dateNext;
  88. return $this;
  89. }
  90. public function getQuantity(): int
  91. {
  92. return $this->quantity;
  93. }
  94. public function setQuantity(int $quantity): IncomingStock
  95. {
  96. $this->quantity = $quantity;
  97. return $this;
  98. }
  99. public function getPurchaseLineId(): ?int
  100. {
  101. return $this->purchaseLineId;
  102. }
  103. public function setPurchaseLineId(?int $purchaseLineId): IncomingStock
  104. {
  105. $this->purchaseLineId = $purchaseLineId;
  106. return $this;
  107. }
  108. public function getProduct(): Product
  109. {
  110. return $this->product;
  111. }
  112. public function setProduct(Product $product): IncomingStock
  113. {
  114. $this->product = $product;
  115. return $this;
  116. }
  117. public function getProductAttribute(): ?ProductAttribute
  118. {
  119. return $this->productAttribute;
  120. }
  121. public function setProductAttribute(?ProductAttribute $productAttribute = null): IncomingStock
  122. {
  123. $this->productAttribute = $productAttribute;
  124. return $this;
  125. }
  126. public function getPurchaseOrder(): string
  127. {
  128. return $this->purchaseOrder;
  129. }
  130. public function setPurchaseOrder(string $purchaseOrder): IncomingStock
  131. {
  132. $this->purchaseOrder = $purchaseOrder;
  133. return $this;
  134. }
  135. public function getPurchaseConfirmed(): ?bool
  136. {
  137. return $this->purchaseConfirmed;
  138. }
  139. public function setPurchaseConfirmed(?bool $purchaseConfirmed): IncomingStock
  140. {
  141. $this->purchaseConfirmed = $purchaseConfirmed;
  142. return $this;
  143. }
  144. public function getActiveStock(): ?bool
  145. {
  146. return $this->activeStock;
  147. }
  148. public function setActiveStock(?bool $activeStock): IncomingStock
  149. {
  150. $this->activeStock = $activeStock;
  151. return $this;
  152. }
  153. public function getDate(): \DateTime
  154. {
  155. return $this->date;
  156. }
  157. public function setDate(\DateTime $date): IncomingStock
  158. {
  159. $this->date = $date;
  160. return $this;
  161. }
  162. }