<?php
namespace App\Entity;
use App\Repository\StockRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StockRepository::class)]
class Stock extends BaseEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'float')]
private $quantity;
#[ORM\ManyToOne(targetEntity: Warehouse::class, inversedBy: 'stocks')]
#[ORM\JoinColumn(nullable: false)]
private $warehouse;
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'stocks')]
private $product;
#[ORM\Column(name: 'invoice_number', type: 'string', nullable: true)]
private $invoiceNumber;
#[ORM\Column(name: 'container_number', type: 'string', nullable: true)]
private $containerNumber;
#[ORM\Column(name: 'konsimento', type: 'string', nullable: true)]
private $konsimento;
#[ORM\Column(name: 'price_fob', type: 'decimal', precision: 19, scale: 4)]
private $priceFob;
#[ORM\Column(name: 'price_navlun', type: 'decimal', precision: 19, scale: 4, nullable: true)]
private $priceNavlun;
#[ORM\Column(name: 'total_unit_price', type: 'decimal', precision: 19, scale: 4)]
private $totalUnitPrice;
#[ORM\Column(name: 'purchase_total_amount', type: 'decimal', precision: 19, scale: 4)]
private $purchaseTotalAmount;
#[ORM\Column(name: 'buying_company', type: 'string')]
private $buyingCompany;
#[ORM\Column(name: 'buying_date', type: 'date_immutable', nullable: false)]
private $buyingDate;
#[ORM\Column(name: 'warehouse_arrival_date', type: 'date_immutable', nullable: true)]
private $warehouseArrivalDate;
#[ORM\ManyToOne(targetEntity: StockTransfer::class, inversedBy: 'stock')]
private $stockTransfer;
#[ORM\ManyToOne(targetEntity: NewStockTransfer::class)]
private $newStockTransfer;
public function __toString(): string
{
return $this->getProduct() . ' ( Stock : ' . $this->getQuantity() . ' )';
}
/**
* @return mixed
*/
public function getNewStockTransfer()
{
return $this->newStockTransfer;
}
/**
* @param mixed $newStockTransfer
*/
public function setNewStockTransfer($newStockTransfer): void
{
$this->newStockTransfer = $newStockTransfer;
}
public function getId(): ?int
{
return $this->id;
}
public function getQuantity(): ?float
{
return $this->quantity;
}
public function setQuantity(float $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getWarehouse(): ?Warehouse
{
return $this->warehouse;
}
public function setWarehouse(?Warehouse $warehouse): self
{
$this->warehouse = $warehouse;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getInvoiceNumber(): ?string
{
return $this->invoiceNumber;
}
public function setInvoiceNumber(?string $invoiceNumber): self
{
$this->invoiceNumber = $invoiceNumber;
return $this;
}
public function getContainerNumber(): ?string
{
return $this->containerNumber;
}
public function setContainerNumber(?string $containerNumber): self
{
$this->containerNumber = $containerNumber;
return $this;
}
public function getKonsimento(): ?string
{
return $this->konsimento;
}
public function setKonsimento(?string $konsimento): self
{
$this->konsimento = $konsimento;
return $this;
}
public function getPriceFob(): ?float
{
return $this->priceFob;
}
public function setPriceFob(float $priceFob): self
{
$this->priceFob = $priceFob;
return $this;
}
public function getPriceNavlun(): ?float
{
return $this->priceNavlun;
}
public function setPriceNavlun(?float $priceNavlun): self
{
$this->priceNavlun = $priceNavlun;
return $this;
}
public function getTotalUnitPrice(): ?float
{
return $this->totalUnitPrice;
}
public function setTotalUnitPrice(float $totalUnitPrice): self
{
$this->totalUnitPrice = $totalUnitPrice;
return $this;
}
public function getPurchaseTotalAmount(): ?float
{
return $this->purchaseTotalAmount;
}
public function setPurchaseTotalAmount(float $purchaseTotalAmount): self
{
$this->purchaseTotalAmount = $purchaseTotalAmount;
return $this;
}
public function getBuyingCompany(): ?string
{
return $this->buyingCompany;
}
public function setBuyingCompany(string $buyingCompany): self
{
$this->buyingCompany = $buyingCompany;
return $this;
}
public function getBuyingDate(): \DateTimeImmutable|\DateTime|null
{
return $this->buyingDate;
}
public function setBuyingDate(\DateTimeImmutable|\DateTime $buyingDate): self
{
$this->buyingDate = $buyingDate;
return $this;
}
public function getWarehouseArrivalDate(): \DateTimeImmutable|\DateTime|null
{
return $this->warehouseArrivalDate;
}
public function setWarehouseArrivalDate(\DateTimeImmutable|\DateTime $warehouseArrivalDate): self
{
$this->warehouseArrivalDate = $warehouseArrivalDate;
return $this;
}
public function getStockTransfer(): ?StockTransfer
{
return $this->stockTransfer;
}
public function setStockTransfer(?StockTransfer $stockTransfer): self
{
$this->stockTransfer = $stockTransfer;
return $this;
}
}