Merged changes in main trunk up to 2.0.6 (see CHANGELOG)
[fa-stable.git] / sales / includes / sales_db.inc
index a537894bb7c8bd0929a8fb8eec08e5f41f75e36d..ab35dc81ab2a957f5b7ec9ecbbd0e9a5a5070c38 100644 (file)
@@ -76,7 +76,9 @@ function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=nu
        if ($factor == 0) return false; // auto price calculations off
 
        $base_id = get_base_sales_type();
-        $home_curr = get_company_currency();
+       if ($base_id <= 0) return 0; // auto price calculations off
+       
+    $home_curr = get_company_currency();
 
     // get all prices which we can use to guess the price.
     // alternative is make up to 2 additional sql queries