src/Entity/StockTransactions.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockTransactionsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7.  * @ORM\Entity(repositoryClass=StockTransactionsRepository::class)
  8.  */
  9. class StockTransactions
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      * @Groups({
  16.      *     "transaction.core", "stock_transaction@core"
  17.      * })
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Stocks::class, inversedBy="stockTransactions")
  22.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  23.      * @Groups({
  24.      *       "stock_transaction@stock"
  25.      *   })
  26.      */
  27.     private $stock;
  28.     /**
  29.      * @ORM\Column(type="datetime_immutable", nullable=true)
  30.      * @Groups({
  31.      *      "transaction.core", "stock_transaction@core"
  32.      *  })
  33.      */
  34.     private $transaction_at;
  35.     /**
  36.      * @ORM\Column(type="stock_transaction_type")
  37.      * @Groups({
  38.      *      "transaction.core", "stock_transaction@core"
  39.      *  })
  40.      */
  41.     private $transaction_type;
  42.     /**
  43.      * @ORM\Column(type="float")
  44.      * @Groups({
  45.      *      "transaction.core", "stock_transaction@core"
  46.      *  })
  47.      */
  48.     private $quantity;
  49.     /**
  50.      * @ORM\Column(type="datetime_immutable", nullable=true)
  51.      */
  52.     private $moved_at;
  53.     /**
  54.      * @ORM\Column(type="float", nullable=true)
  55.      * @Groups({
  56.      *       "stock_transaction@core"
  57.      *   })
  58.      */
  59.     private $buying_price;
  60.     /**
  61.      * @ORM\Column(type="float", nullable=true)
  62.      * @Groups({
  63.      *        "stock_transaction@core"
  64.      *    })
  65.      */
  66.     private $sales_price;
  67.     /**
  68.      * @ORM\Column(type="float", nullable=true)
  69.      * @Groups({
  70.      *        "stock_transaction@core"
  71.      *    })
  72.      */
  73.     private $sales_margin;
  74.     /**
  75.      * // Bu Kisim Stock daki urun kimden kime verilmis bilsilini tutar
  76.      * @ORM\OneToOne(targetEntity=StockIssuePositions::class, mappedBy="stock_transaction", cascade={"persist", "remove"})
  77.      * @Groups({
  78.      *     "stock_transaction@stock_issue_position"
  79.      * })
  80.      */
  81.     private $stock_issue_position;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity=ProjectOrders::class, inversedBy="stock_transactions")
  84.      * @ORM\JoinColumn(onDelete="CASCADE")
  85.      * @Groups({
  86.      *         "stock_transaction@project_order"
  87.      *     })
  88.      */
  89.     private $project_order;
  90. //    /**
  91. //     * @ORM\ManyToOne(targetEntity=Stocks::class)
  92. //     * @Groups({
  93. //     *         "transaction.move"
  94. //     *     })
  95. //     */
  96. //    private $moved_from;
  97. //    /**
  98. //     * @ORM\ManyToOne(targetEntity=Stocks::class)
  99. //     * @Groups({
  100. //     *         "transaction.move"
  101. //     *     })
  102. //     */
  103. //    private $move_to;
  104. //    /**
  105. //     * @ORM\ManyToOne(targetEntity=Locations::class, inversedBy="stockTransactions")
  106. //     * @Groups({
  107. //     *        "transaction.location"
  108. //     *    })
  109. //     */
  110. //    private $location;
  111.     public function getId(): ?int
  112.     {
  113.         return $this->id;
  114.     }
  115.     public function getStock(): ?Stocks
  116.     {
  117.         return $this->stock;
  118.     }
  119.     public function setStock(?Stocks $stock): self
  120.     {
  121.         $this->stock $stock;
  122.         return $this;
  123.     }
  124.     public function getTransactionAt(): ?\DateTimeImmutable
  125.     {
  126.         return $this->transaction_at;
  127.     }
  128.     public function setTransactionAt(?\DateTimeImmutable $transaction_at): self
  129.     {
  130.         $this->transaction_at $transaction_at;
  131.         return $this;
  132.     }
  133.     public function getTransactionType()
  134.     {
  135.         return $this->transaction_type;
  136.     }
  137.     public function setTransactionType($transaction_type): self
  138.     {
  139.         $this->transaction_type $transaction_type;
  140.         return $this;
  141.     }
  142.     public function getQuantity(): ?float
  143.     {
  144.         return $this->quantity;
  145.     }
  146.     public function setQuantity(float $quantity): self
  147.     {
  148.         $this->quantity $quantity;
  149.         return $this;
  150.     }
  151.     public function getBuyingPrice(): ?float
  152.     {
  153.         return $this->buying_price;
  154.     }
  155.     public function setBuyingPrice(?float $buying_price): self
  156.     {
  157.         $this->buying_price $buying_price;
  158.         return $this;
  159.     }
  160.     public function getMovedAt(): ?\DateTimeImmutable
  161.     {
  162.         return $this->moved_at;
  163.     }
  164.     public function setMovedAt(?\DateTimeImmutable $moved_at): self
  165.     {
  166.         $this->moved_at $moved_at;
  167.         return $this;
  168.     }
  169.     public function getMovedFrom(): ?Locations
  170.     {
  171.         return $this->moved_from;
  172.     }
  173.     public function setMovedFrom(?Stocks $stock): self
  174.     {
  175.         $this->moved_from $stock;
  176.         return $this;
  177.     }
  178.     public function getMoveTo(): ?Stocks
  179.     {
  180.         return $this->move_to;
  181.     }
  182.     public function setMoveTo(?Stocks $move_to): self
  183.     {
  184.         $this->move_to $move_to;
  185.         return $this;
  186.     }
  187.     public function getSalesPrice(): ?float
  188.     {
  189.         return $this->sales_price;
  190.     }
  191.     public function setSalesPrice(?float $sales_price): self
  192.     {
  193.         $this->sales_price $sales_price;
  194.         return $this;
  195.     }
  196.     public function getSalesMargin(): ?float
  197.     {
  198.         return $this->sales_margin;
  199.     }
  200.     public function setSalesMargin(?float $sales_margin): self
  201.     {
  202.         $this->sales_margin $sales_margin;
  203.         return $this;
  204.     }
  205.     public function getStockIssuePosition(): ?StockIssuePositions
  206.     {
  207.         return $this->stock_issue_position;
  208.     }
  209.     public function setStockIssuePosition(?StockIssuePositions $stock_issue_position): self
  210.     {
  211.         // unset the owning side of the relation if necessary
  212.         if ($stock_issue_position === null && $this->stock_issue_position !== null) {
  213.             $this->stock_issue_position->setStockTransaction(null);
  214.         }
  215.         // set the owning side of the relation if necessary
  216.         if ($stock_issue_position !== null && $stock_issue_position->getStockTransaction() !== $this) {
  217.             $stock_issue_position->setStockTransaction($this);
  218.         }
  219.         $this->stock_issue_position $stock_issue_position;
  220.         return $this;
  221.     }
  222.     public function getProjectOrder(): ?ProjectOrders
  223.     {
  224.         return $this->project_order;
  225.     }
  226.     public function setProjectOrder(?ProjectOrders $project_order): self
  227.     {
  228.         $this->project_order $project_order;
  229.         return $this;
  230.     }
  231. }