Use the information from info provider whether prices includes VAT or not

This commit is contained in:
Jan Böhmer 2026-02-08 21:58:14 +01:00
parent 3bff5fa8bd
commit 5a47b15c97
3 changed files with 5 additions and 2 deletions

View file

@ -86,7 +86,7 @@ export default class extends Controller {
targetTable.insertAdjacentHTML('beforeend', newElementStr); targetTable.insertAdjacentHTML('beforeend', newElementStr);
ret = targetTable.lastElementChild; ret = targetTable.lastElementChild;
} }
//Trigger an event to notify other components that a new element has been created, so they can for example initialize select2 on it //Trigger an event to notify other components that a new element has been created, so they can for example initialize select2 on it
targetTable.dispatchEvent(new CustomEvent("collection:elementAdded", {bubbles: true})); targetTable.dispatchEvent(new CustomEvent("collection:elementAdded", {bubbles: true}));

View file

@ -94,13 +94,14 @@ final class DTOtoEntityConverter
$entity->setPrice($dto->getPriceAsBigDecimal()); $entity->setPrice($dto->getPriceAsBigDecimal());
$entity->setPriceRelatedQuantity($dto->price_related_quantity); $entity->setPriceRelatedQuantity($dto->price_related_quantity);
//Currency TODO
if ($dto->currency_iso_code !== null) { if ($dto->currency_iso_code !== null) {
$entity->setCurrency($this->getCurrency($dto->currency_iso_code)); $entity->setCurrency($this->getCurrency($dto->currency_iso_code));
} else { } else {
$entity->setCurrency(null); $entity->setCurrency(null);
} }
$entity->setIncludesVat($dto->includes_tax);
return $entity; return $entity;
} }

View file

@ -101,6 +101,8 @@ class DTOtoEntityConverterTest extends WebTestCase
//For base currencies, the currency field is null //For base currencies, the currency field is null
$this->assertNull($entity->getCurrency()); $this->assertNull($entity->getCurrency());
$this->assertTrue($entity->getIncludesVat());
} }
public function testConvertPurchaseInfo(): void public function testConvertPurchaseInfo(): void