mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
Merge remote-tracking branch 'd-buchmann/d-buchmann-patch-1'
This commit is contained in:
commit
e233940f1f
2 changed files with 5 additions and 3 deletions
|
@ -41,6 +41,8 @@ class PriceDTO
|
|||
public readonly ?string $currency_iso_code,
|
||||
/** @var bool If the price includes tax */
|
||||
public readonly ?bool $includes_tax = true,
|
||||
/** @var float the price related quantity */
|
||||
public readonly ?float $price_related_quantity = 1.0,
|
||||
)
|
||||
{
|
||||
$this->price_as_big_decimal = BigDecimal::of($this->price);
|
||||
|
@ -54,4 +56,4 @@ class PriceDTO
|
|||
{
|
||||
return $this->price_as_big_decimal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ final class DTOtoEntityConverter
|
|||
{
|
||||
$entity->setMinDiscountQuantity($dto->minimum_discount_amount);
|
||||
$entity->setPrice($dto->getPriceAsBigDecimal());
|
||||
$entity->setPriceRelatedQuantity($dto->price_related_quantity);
|
||||
|
||||
//Currency TODO
|
||||
if ($dto->currency_iso_code !== null) {
|
||||
|
@ -95,7 +96,6 @@ final class DTOtoEntityConverter
|
|||
$entity->setCurrency(null);
|
||||
}
|
||||
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ final class DTOtoEntityConverter
|
|||
//If the entity was newly created, set the file filter
|
||||
if ($tmp->getID() === null) {
|
||||
$tmp->setFiletypeFilter('image/*');
|
||||
$tmp->setAlternativeNames(self::TYPE_DATASHEETS_NAME);
|
||||
$tmp->setAlternativeNames(self::TYPE_IMAGE_NAME);
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue