Merge remote-tracking branch 'd-buchmann/d-buchmann-patch-1'

This commit is contained in:
Jan Böhmer 2023-10-26 17:38:10 +02:00
commit e233940f1f
2 changed files with 5 additions and 3 deletions

View file

@ -41,6 +41,8 @@ class PriceDTO
public readonly ?string $currency_iso_code, public readonly ?string $currency_iso_code,
/** @var bool If the price includes tax */ /** @var bool If the price includes tax */
public readonly ?bool $includes_tax = true, 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); $this->price_as_big_decimal = BigDecimal::of($this->price);
@ -54,4 +56,4 @@ class PriceDTO
{ {
return $this->price_as_big_decimal; return $this->price_as_big_decimal;
} }
} }

View file

@ -87,6 +87,7 @@ final class DTOtoEntityConverter
{ {
$entity->setMinDiscountQuantity($dto->minimum_discount_amount); $entity->setMinDiscountQuantity($dto->minimum_discount_amount);
$entity->setPrice($dto->getPriceAsBigDecimal()); $entity->setPrice($dto->getPriceAsBigDecimal());
$entity->setPriceRelatedQuantity($dto->price_related_quantity);
//Currency TODO //Currency TODO
if ($dto->currency_iso_code !== null) { if ($dto->currency_iso_code !== null) {
@ -95,7 +96,6 @@ final class DTOtoEntityConverter
$entity->setCurrency(null); $entity->setCurrency(null);
} }
return $entity; return $entity;
} }
@ -289,7 +289,7 @@ final class DTOtoEntityConverter
//If the entity was newly created, set the file filter //If the entity was newly created, set the file filter
if ($tmp->getID() === null) { if ($tmp->getID() === null) {
$tmp->setFiletypeFilter('image/*'); $tmp->setFiletypeFilter('image/*');
$tmp->setAlternativeNames(self::TYPE_DATASHEETS_NAME); $tmp->setAlternativeNames(self::TYPE_IMAGE_NAME);
} }
return $tmp; return $tmp;