Fixed automatic price calculations always on.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 25 Nov 2008 15:10:18 +0000 (15:10 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 25 Nov 2008 15:10:18 +0000 (15:10 +0000)
sales/includes/sales_db.inc

index 338f2d0098a18981a477a8fe0c743131e7c93429..579bbb9a8e0f65d5da31653694256d4a82c54c6f 100644 (file)
@@ -72,10 +72,12 @@ function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=nu
                $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