src/Entity/InvoicePositions.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoicePositionsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8.  * @ORM\Entity(repositoryClass=InvoicePositionsRepository::class)
  9.  * @UniqueEntity(
  10.  *     fields={"invoice", "project_order", "order_billing"},
  11.  *     message="Invoice position already registered|Invoice position with combination -> Invoice-Nr:%s Order-Nr:%s Billing:%s already registered"
  12.  * )
  13.  */
  14. class InvoicePositions
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      * @Groups({
  21.      *     "invoice_position@core",
  22.      *     "invoice_position@base"
  23.      * })
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=Invoices::class, inversedBy="invoice_positions")
  28.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  29.      * @Groups({
  30.      *      "invoice_position@invoice"
  31.      *  })
  32.      */
  33.     private $invoice;
  34.     /**
  35.      * @ORM\Column(type="string", length=64, nullable=true)
  36.      * @Groups({
  37.      *      "invoice_position@core",
  38.      *      "invoice_position@base"
  39.      *  })
  40.      */
  41.     private $alias;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=ProjectOrders::class, inversedBy="invoice_positions")
  44.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  45.      * @Groups({
  46.      *      "invoice_position@project_order"
  47.      *  })
  48.      */
  49.     private $project_order;
  50.     /**
  51.      * @ORM\Column(type="float", nullable=true)
  52.      * @Groups({
  53.      *     "invoice_position@core",
  54.      *     "invoice_position@base",
  55.      * })
  56.      */
  57.     private $position_amount;
  58.     /**
  59.      * Asagidaki aciklama eski, Yeni bit position olustur Billing Silinirse Invoice Positionun anlami klamaz silmelisin!!!
  60.      * NULL Olabilir sebebi Eger bir invoice silinirse ona bagli billing bosa ciksin belki baska bi invoice baglanti kurabilir
  61.      * @ORM\ManyToOne(targetEntity=ProjectOrderBillings::class, inversedBy="invoice_position", cascade={"persist"})
  62.      * @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
  63.      * @Groups({
  64.      *      "invoice_position@order_billing"
  65.      *  })
  66.      */
  67.     private $order_billing;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=InvoicePaymentStatus::class, inversedBy="invoice_positions")
  70.      * @Groups({
  71.      *     "invoice_position@payment_status"
  72.      * })
  73.      */
  74.     private $payment_status;
  75.     /**
  76.      * @ORM\Column(type="datetime_immutable", nullable=true)
  77.      */
  78.     private $created_at;
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getInvoice(): ?Invoices
  84.     {
  85.         return $this->invoice;
  86.     }
  87.     public function setInvoice(?Invoices $invoice): self
  88.     {
  89.         $this->invoice $invoice;
  90.         return $this;
  91.     }
  92.     public function getAlias(): ?string
  93.     {
  94.         return $this->alias;
  95.     }
  96.     public function setAlias(?string $alias): self
  97.     {
  98.         $this->alias $alias;
  99.         return $this;
  100.     }
  101.     public function getProjectOrder(): ?ProjectOrders
  102.     {
  103.         return $this->project_order;
  104.     }
  105.     public function setProjectOrder(?ProjectOrders $project_order): self
  106.     {
  107.         $this->project_order $project_order;
  108.         return $this;
  109.     }
  110.     public function getPositionAmount(): ?float
  111.     {
  112.         return $this->position_amount;
  113.     }
  114.     public function setPositionAmount(?float $position_amount): self
  115.     {
  116.         $this->position_amount $position_amount;
  117.         return $this;
  118.     }
  119.     public function getOrderBilling(): ?ProjectOrderBillings
  120.     {
  121.         return $this->order_billing;
  122.     }
  123.     public function setOrderBilling(?ProjectOrderBillings $order_billing): self
  124.     {
  125.         $this->order_billing $order_billing;
  126.         return $this;
  127.     }
  128.     public function getPaymentStatus(): ?InvoicePaymentStatus
  129.     {
  130.         return $this->payment_status;
  131.     }
  132.     public function setPaymentStatus(?InvoicePaymentStatus $payment_status): self
  133.     {
  134.         $this->payment_status $payment_status;
  135.         return $this;
  136.     }
  137.     public function getCreatedAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->created_at;
  140.     }
  141.     public function setCreatedAt(?\DateTimeImmutable $created_at): self
  142.     {
  143.         $this->created_at $created_at;
  144.         return $this;
  145.     }
  146. }