mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-20 00:33:45 +01:00
Use the information from info provider whether prices includes VAT or not
This commit is contained in:
@@ -86,7 +86,7 @@ export default class extends Controller {
|
||||
targetTable.insertAdjacentHTML('beforeend', newElementStr);
|
||||
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
|
||||
targetTable.dispatchEvent(new CustomEvent("collection:elementAdded", {bubbles: true}));
|
||||
|
||||
|
||||
@@ -94,13 +94,14 @@ final class DTOtoEntityConverter
|
||||
$entity->setPrice($dto->getPriceAsBigDecimal());
|
||||
$entity->setPriceRelatedQuantity($dto->price_related_quantity);
|
||||
|
||||
//Currency TODO
|
||||
if ($dto->currency_iso_code !== null) {
|
||||
$entity->setCurrency($this->getCurrency($dto->currency_iso_code));
|
||||
} else {
|
||||
$entity->setCurrency(null);
|
||||
}
|
||||
|
||||
$entity->setIncludesVat($dto->includes_tax);
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ class DTOtoEntityConverterTest extends WebTestCase
|
||||
|
||||
//For base currencies, the currency field is null
|
||||
$this->assertNull($entity->getCurrency());
|
||||
|
||||
$this->assertTrue($entity->getIncludesVat());
|
||||
}
|
||||
|
||||
public function testConvertPurchaseInfo(): void
|
||||
|
||||
Reference in New Issue
Block a user