mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 05:49:36 +00:00
Moved VAT include info from pricedetail to orderdetail level
That makes implementing the form easier
This commit is contained in:
parent
4740b6d19e
commit
586375d921
9 changed files with 88 additions and 125 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue