<?php
namespace App\Entity;
use App\Repository\InvoiceItemRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: InvoiceItemRepository::class)]
#[ORM\HasLifecycleCallbacks]
class InvoiceItem extends BaseEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $productName = null;
#[ORM\Column(length: 255)]
private ?string $measurement = null;
// quantity = müşteriye teslim edilen toplam miktar
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $quantity = null;
// unitPriceFob = Ürünün birim fiyatı maliyeti
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $unitPriceFob = null;
// unitPriceNavlun = Ürünün nakliye gideri birim maliyeti. Toplam maliyet = unitPriceFob + unitPriceNavlun
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $unitPriceNavlun = null;
// totalUnitPrice = Ürünün toplam maliyeti
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $totalUnitPrice = null;
// totalPurchasePrice = Ürünün müşteriye toplam satış miktarı
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $totalPurchasePrice = null;
// totalUnitPurchasePrice = Müşteriye satış birim fiyatı
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $totalUnitPurchasePrice = null;
#[ORM\ManyToOne(inversedBy: 'invoiceItems')]
private ?Invoice $invoice = null;
// tax = Vergi yüzdelik
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: '0')]
private ?string $tax = null;
// discount = Yapılan indirim yüzdelik
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: '0')]
private ?string $discount = null;
// unAllocatedQuantity = Müşteriye teslim edilmeyen ancak satılan miktar. Yani toplam satılan miktar = quantity + unAllocatedQuantity
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $unAllocatedQuantity = null;
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'invoiceItems')]
private Product $product;
#[ORM\Column(type: Types::DECIMAL, precision: 19, scale: 4)]
private ?string $baseUnitQuantity = null;
#[ORM\ManyToOne(inversedBy: 'invoiceItems')]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?MeasurementUnits $selectedUnit = null;
public function getId(): ?int
{
return $this->id;
}
public function getProductName(): ?string
{
return $this->productName;
}
public function setProductName(string $productName): static
{
$this->productName = $productName;
return $this;
}
public function getMeasurement(): ?string
{
return $this->measurement;
}
public function setMeasurement(string $measurement): static
{
$this->measurement = $measurement;
return $this;
}
public function getQuantity(): ?string
{
return $this->quantity;
}
public function setQuantity(string $quantity): static
{
$this->quantity = $quantity;
return $this;
}
public function getUnitPriceFob(): ?string
{
return $this->unitPriceFob;
}
public function setUnitPriceFob(string $unitPriceFob): static
{
$this->unitPriceFob = $unitPriceFob;
return $this;
}
public function getUnitPriceNavlun(): ?string
{
return $this->unitPriceNavlun;
}
public function setUnitPriceNavlun(string $unitPriceNavlun): static
{
$this->unitPriceNavlun = $unitPriceNavlun;
return $this;
}
public function getTotalUnitPrice(): ?string
{
return $this->totalUnitPrice;
}
public function setTotalUnitPrice(string $totalUnitPrice): static
{
$this->totalUnitPrice = $totalUnitPrice;
return $this;
}
public function getTotalPurchasePrice(): ?string
{
return $this->totalPurchasePrice;
}
public function setTotalPurchasePrice(string $totalPurchasePrice): static
{
$this->totalPurchasePrice = $totalPurchasePrice;
return $this;
}
public function getTotalUnitPurchasePrice(): ?string
{
return $this->totalUnitPurchasePrice;
}
public function setTotalUnitPurchasePrice(string $totalUnitPurchasePrice): static
{
$this->totalUnitPurchasePrice = $totalUnitPurchasePrice;
return $this;
}
public function getInvoice(): ?Invoice
{
return $this->invoice;
}
public function setInvoice(?Invoice $invoice): static
{
$this->invoice = $invoice;
return $this;
}
public function getTax(): ?string
{
return $this->tax;
}
public function setTax(string $tax): static
{
$this->tax = $tax;
return $this;
}
public function getDiscount(): ?string
{
return $this->discount;
}
public function setDiscount(string $discount): static
{
$this->discount = $discount;
return $this;
}
public function getUnAllocatedQuantity(): ?string
{
return $this->unAllocatedQuantity;
}
public function setUnAllocatedQuantity(string $unAllocatedQuantity): static
{
$this->unAllocatedQuantity = $unAllocatedQuantity;
return $this;
}
public function getProduct(): Product
{
return $this->product;
}
public function setProduct(Product $product): void
{
$this->product = $product;
}
public function getBaseUnitQuantity(): ?string
{
return $this->baseUnitQuantity;
}
public function setBaseUnitQuantity(?string $baseUnitQuantity): static
{
$this->baseUnitQuantity = $baseUnitQuantity;
return $this;
}
public function getSelectedUnit(): ?MeasurementUnits
{
return $this->selectedUnit;
}
public function setSelectedUnit(?MeasurementUnits $selectedUnit): static
{
$this->selectedUnit = $selectedUnit;
return $this;
}
}