When buying a service item from a supplier, the delivery produced
[fa-stable.git] / purchasing / includes / db / grn_db.inc
index b055c1f94eb8b14a955b9f8afa302d9eaf04303a..0a491a6f144588cafe5f23cb857bbe34d66be268 100644 (file)
@@ -18,10 +18,11 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date,
        else
                $currency = null;
        $dec = user_price_dec();
-       $price = price_decimal_format($price, $dec);
+       price_decimal_format($price, $dec);
+       $price = round2($price, $dec);
        if ($currency != null)
        {
-               $ex_rate = get_exchange_rate_to_home_currency($currency, $date_);
+               $ex_rate = get_exchange_rate_to_home_currency($currency, $date);
                $price_in_home_currency = $price / $ex_rate;
                //$price_in_home_currency = to_home_currency($price, $currency, $date);
        }