mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-29 05:00:08 +02:00
Fixed an exception when a pricedetail has a currency without exchange rate.
Fixes issue #37
This commit is contained in:
parent
da83314d69
commit
887ac83f83
1 changed files with 6 additions and 2 deletions
|
@ -174,8 +174,12 @@ class PricedetailHelper
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$avg = bcadd($avg, $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency), Pricedetail::PRICE_PRECISION);
|
$converted = $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency);
|
||||||
++$count;
|
//Ignore price informations that can not be converted to base currency.
|
||||||
|
if ($converted !== null) {
|
||||||
|
$avg = bcadd($avg, $converted, Pricedetail::PRICE_PRECISION);
|
||||||
|
++$count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue