mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-15 22:19:35 +00:00
Use the information from info provider whether prices includes VAT or not
This commit is contained in:
parent
3bff5fa8bd
commit
5a47b15c97
3 changed files with 5 additions and 2 deletions
|
|
@ -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}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue