mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-15 14:09:36 +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);
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue