$myrow = db_fetch_row($result);
return $myrow[0];
}
- if ($factor == 0) return 0; // auto price calculations off
+ if ($factor == 0) return 0; // auto price calculations off for current pricelist
$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