Merged changes form stabel branch up to the current state (2.3.22+).
[fa-stable.git] / inventory / includes / db / items_prices_db.inc
index 9b670d2499fb55dbf7ed68ceb5df4a6515bcb48c..bcf734b8baa1342632bcfc826ab3f653eecc3c08 100644 (file)
@@ -53,4 +53,14 @@ function get_stock_price($price_id)
        return db_fetch($result);
 }
 
+function get_stock_price_type_currency($stock_id, $type, $currency)
+{
+       $sql = "SELECT * FROM ".TB_PREF."prices WHERE stock_id=".db_escape($stock_id)."
+               AND sales_type_id=".db_escape($type)."
+               AND curr_abrev=".db_escape($currency);
+       
+       $result = db_query($sql,"price could not be retreived");
+       
+       return db_fetch($result);
+}
 ?>
\ No newline at end of file