<?php
namespace App\Entity;
use App\Repository\ProductsSoldRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProductsSoldRepository::class)]
#[ORM\HasLifecycleCallbacks]
class ProductsSold extends BaseEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $productName;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $measurement;
#[ORM\Column(type: 'float')]
private $quantity;
#[ORM\Column(type: 'float')]
private $baseUnitQuantity;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $unitPriceFob;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $unitPriceNavlun;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $totalUnitPrice;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $totalPrice;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $totalPuchasePrice;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $totalUnitPurchasePrice;
#[ORM\ManyToOne(targetEntity: Sales::class, inversedBy: 'productsSolds')]
#[ORM\JoinColumn(nullable: false)]
private $sales;
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'productsSolds')]
private $product;
#[ORM\Column(type: 'float')]
private $tax;
#[ORM\Column(type: 'float', length: 10)]
private $discount;
#[ORM\Column(type: 'decimal', precision: 20, scale: 2, nullable: true)]
private $unAllocatedQuantity;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\ManyToOne(inversedBy: 'productsSolds')]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?MeasurementUnits $selectedUnit = null;
public function __construct()
{
$this->stock = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getProductName(): ?string
{
return $this->productName;
}
public function setProductName(string $productName): self
{
$this->productName = $productName;
return $this;
}
/**
* @return mixed
*/
public function getMeasurement()
{
return $this->measurement;
}
/**
* @param mixed $measurement
*/
public function setMeasurement($measurement): void
{
$this->measurement = $measurement;
}
public function getQuantity(): ?float
{
return $this->quantity;
}
public function setQuantity(float $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getUnitPriceFob(): ?float
{
return $this->unitPriceFob;
}
public function setUnitPriceFob(float $unitPriceFob): self
{
$this->unitPriceFob = $unitPriceFob;
return $this;
}
public function getUnitPriceNavlun(): ?float
{
return $this->unitPriceNavlun;
}
public function setUnitPriceNavlun(float $unitPriceNavlun): self
{
$this->unitPriceNavlun = $unitPriceNavlun;
return $this;
}
public function getTotalUnitPrice(): ?float
{
return $this->totalUnitPrice;
}
public function setTotalUnitPrice(float $totalUnitPrice): self
{
$this->totalUnitPrice = $totalUnitPrice;
return $this;
}
public function getTotalPrice(): ?float
{
return $this->totalPrice;
}
public function setTotalPrice(float $totalPrice): self
{
$this->totalPrice = $totalPrice;
return $this;
}
public function getTotalPuchasePrice(): ?float
{
return $this->totalPuchasePrice;
}
public function setTotalPuchasePrice(float $totalPuchasePrice): self
{
$this->totalPuchasePrice = $totalPuchasePrice;
return $this;
}
public function getSales(): ?Sales
{
return $this->sales;
}
public function setSales(?Sales $sales): self
{
$this->sales = $sales;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
/**
* @return mixed
*/
public function getTotalUnitPurchasePrice()
{
return $this->totalUnitPurchasePrice;
}
/**
* @param mixed $totalUnitPurchasePrice
*/
public function setTotalUnitPurchasePrice($totalUnitPurchasePrice): void
{
$this->totalUnitPurchasePrice = $totalUnitPurchasePrice;
}
/**
* @return mixed
*/
public function getTax()
{
return $this->tax;
}
/**
* @param mixed $tax
*/
public function setTax($tax): void
{
$this->tax = $tax;
}
/**
* @return mixed
*/
public function getDiscount()
{
return $this->discount;
}
/**
* @param mixed $discount
*/
public function setDiscount($discount): void
{
$this->discount = $discount;
}
public function getUnAllocatedQuantity(): ?string
{
return $this->unAllocatedQuantity;
}
public function setUnAllocatedQuantity(?string $unAllocatedQuantity): self
{
$this->unAllocatedQuantity = $unAllocatedQuantity;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getSelectedUnit(): ?MeasurementUnits
{
return $this->selectedUnit;
}
public function setSelectedUnit(?MeasurementUnits $selectedUnit): static
{
$this->selectedUnit = $selectedUnit;
return $this;
}
/**
* @return mixed
*/
public function getBaseUnitQuantity()
{
return $this->baseUnitQuantity;
}
/**
* @param mixed $baseUnitQuantity
*/
public function setBaseUnitQuantity($baseUnitQuantity): void
{
$this->baseUnitQuantity = $baseUnitQuantity;
}
}