Moved VAT include info from pricedetail to orderdetail level

That makes implementing the form easier
This commit is contained in:
Jan Böhmer 2026-02-10 16:53:41 +01:00
parent 4740b6d19e
commit 586375d921
9 changed files with 88 additions and 125 deletions

View file

@ -121,12 +121,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
#[Groups(['pricedetail:read:standalone', 'pricedetail:write'])]
protected ?Orderdetail $orderdetail = null;
/**
* @var bool|null Whether the price includes VAT or not. Null means, that it is not specified, if the price includes VAT or not.
*/
#[ORM\Column(name: "include_vat", type: Types::BOOLEAN, nullable: true)]
#[Groups(['extended', 'full', 'import', 'pricedetail:read', 'pricedetail:write'])]
protected ?bool $includes_vat = null;
public function __construct()
{
@ -277,7 +272,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
*/
public function getIncludesVat(): ?bool
{
return $this->includes_vat;
return $this->orderdetail?->getPricesIncludesVAT();
}
/********************************************************************************
@ -376,15 +371,4 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
return $this;
}
/**
* Set whether the price includes VAT or not. Null means, that it is not specified, if the price includes VAT or not.
* @param bool|null $includes_vat
* @return $this
*/
public function setIncludesVat(?bool $includes_vat): self
{
$this->includes_vat = $includes_vat;
return $this;
}
}