|
|
@@ -30,7 +30,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|
|
'advancepayment' => AdvancePayment::class,
|
|
|
]
|
|
|
)]
|
|
|
-abstract class AbstractBillAccounting
|
|
|
+class AbstractBillAccounting
|
|
|
{
|
|
|
#[ORM\Id]
|
|
|
#[ORM\Column]
|
|
|
@@ -41,18 +41,6 @@ abstract class AbstractBillAccounting
|
|
|
#[ORM\JoinColumn(nullable: true)]
|
|
|
protected ?Organization $organization;
|
|
|
|
|
|
- /** @var Collection<int, BillLine> */
|
|
|
- #[ORM\OneToMany(targetEntity: BillLine::class, mappedBy: 'bill', cascade: ['persist'], orphanRemoval: true)]
|
|
|
- protected Collection $billLines;
|
|
|
-
|
|
|
- /** @var Collection<int, BillCredit> */
|
|
|
- #[ORM\OneToMany(targetEntity: BillCredit::class, mappedBy: 'bill', cascade: ['persist'], orphanRemoval: true)]
|
|
|
- protected Collection $billCredits;
|
|
|
-
|
|
|
- /** @var Collection<int, BillPayment> */
|
|
|
- #[ORM\OneToMany(targetEntity: BillPayment::class, mappedBy: 'bill', cascade: ['persist'], orphanRemoval: true)]
|
|
|
- protected Collection $billPayments;
|
|
|
-
|
|
|
#[ORM\ManyToOne(inversedBy: 'billCredits')]
|
|
|
#[ORM\JoinColumn(nullable: true)]
|
|
|
protected ?Bill $bill;
|
|
|
@@ -114,9 +102,6 @@ abstract class AbstractBillAccounting
|
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
|
- $this->billLines = new ArrayCollection();
|
|
|
- $this->billCredits = new ArrayCollection();
|
|
|
- $this->billPayments = new ArrayCollection();
|
|
|
$this->billingIntangibleExcludeDates = new ArrayCollection();
|
|
|
$this->tags = new ArrayCollection();
|
|
|
}
|
|
|
@@ -138,91 +123,6 @@ abstract class AbstractBillAccounting
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @return Collection<int, BillLine>
|
|
|
- */
|
|
|
- public function getBillLines(): Collection
|
|
|
- {
|
|
|
- return $this->billLines;
|
|
|
- }
|
|
|
-
|
|
|
- public function addBillLine(BillLine $billLine): self
|
|
|
- {
|
|
|
- if (!$this->billLines->contains($billLine)) {
|
|
|
- $this->billLines[] = $billLine;
|
|
|
- $billLine->setBill($this);
|
|
|
- }
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- public function removeBillLine(BillLine $billLine): self
|
|
|
- {
|
|
|
- $this->billLines->removeElement($billLine);
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @return Collection<int, BillCredit>
|
|
|
- */
|
|
|
- public function getBillCredits(): Collection
|
|
|
- {
|
|
|
- return $this->billCredits;
|
|
|
- }
|
|
|
-
|
|
|
- public function addBillCredit(BillCredit $billCredit): self
|
|
|
- {
|
|
|
- if (!$this->billCredits->contains($billCredit)) {
|
|
|
- $this->billCredits[] = $billCredit;
|
|
|
- $billCredit->setBill($this);
|
|
|
- }
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- public function removeBillCredit(BillCredit $billCredit): self
|
|
|
- {
|
|
|
- if ($this->billCredits->removeElement($billCredit)) {
|
|
|
- // set the owning side to null (unless already changed)
|
|
|
- if ($billCredit->getBill() === $this) {
|
|
|
- $billCredit->setBill(null);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @return Collection<int, BillPayment>
|
|
|
- */
|
|
|
- public function getBillPayments(): Collection
|
|
|
- {
|
|
|
- return $this->billPayments;
|
|
|
- }
|
|
|
-
|
|
|
- public function addBillPayment(BillPayment $billPayment): self
|
|
|
- {
|
|
|
- if (!$this->billPayments->contains($billPayment)) {
|
|
|
- $this->billPayments[] = $billPayment;
|
|
|
- $billPayment->setBill($this);
|
|
|
- }
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- public function removeBillPayment(BillPayment $billPayment): self
|
|
|
- {
|
|
|
- if ($this->billPayments->removeElement($billPayment)) {
|
|
|
- // set the owning side to null (unless already changed)
|
|
|
- if ($billPayment->getBill() === $this) {
|
|
|
- $billPayment->setBill(null);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
public function getBill(): ?Bill
|
|
|
{
|
|
|
return $this->bill;
|