<?php
namespace App\Entity;
use App\Repository\PaymentRepository;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\SalesReturn;
#[ORM\Entity(repositoryClass: PaymentRepository::class)]
class Payment extends BaseEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Customer::class, inversedBy: 'payments')]
#[ORM\JoinColumn(nullable: false)]
private $customer;
#[ORM\Column(type: 'date')]
private $paymentDate;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private $amount;
#[ORM\Column(type: 'string', length: 255)]
private $paymentStatus;
#[ORM\Column(type: 'date', nullable: true)]
private $dueDate;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $description;
#[ORM\ManyToOne(targetEntity: PaymentMethod::class, inversedBy: 'payments')]
#[ORM\JoinColumn(nullable: false)]
private $paymentMethod;
#[ORM\ManyToOne(targetEntity: Sales::class, inversedBy: 'payments')]
#[ORM\JoinColumn(nullable: false)]
private $sales;
#[ORM\ManyToOne(inversedBy: 'payments')]
private ?Invoice $invoice = null;
#[ORM\ManyToOne(targetEntity: SalesReturn::class)]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?SalesReturn $salesReturn = null;
public function getId(): ?int
{
return $this->id;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
public function getPaymentDate(): ?\DateTimeInterface
{
return $this->paymentDate;
}
public function setPaymentDate(\DateTimeInterface $paymentDate): self
{
$this->paymentDate = $paymentDate;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getPaymentStatus(): ?string
{
return $this->paymentStatus;
}
public function setPaymentStatus(string $paymentStatus): self
{
$this->paymentStatus = $paymentStatus;
return $this;
}
public function getDueDate(): ?\DateTimeInterface
{
return $this->dueDate;
}
public function setDueDate(?\DateTimeInterface $dueDate): self
{
$this->dueDate = $dueDate;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getPaymentMethod(): ?PaymentMethod
{
return $this->paymentMethod;
}
public function setPaymentMethod(?PaymentMethod $paymentMethod): self
{
$this->paymentMethod = $paymentMethod;
return $this;
}
public function getSales(): ?Sales
{
return $this->sales;
}
public function setSales(?Sales $sales): self
{
$this->sales = $sales;
return $this;
}
public function getInvoice(): ?Invoice
{
return $this->invoice;
}
public function setInvoice(?Invoice $invoice): static
{
$this->invoice = $invoice;
return $this;
}
public function getSalesReturn(): ?SalesReturn
{
return $this->salesReturn;
}
public function setSalesReturn(?SalesReturn $salesReturn): self
{
$this->salesReturn = $salesReturn;
return $this;
}
}