mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 20:50:06 +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;
|
||||
}
|
||||
|
||||
$avg = bcadd($avg, $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency), Pricedetail::PRICE_PRECISION);
|
||||
++$count;
|
||||
$converted = $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency);
|
||||
//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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue