+
+ $rate = round(get_exchange_rate_from_home_currency($currency, $date),
+ user_exrate_dec());
+ $price = false;
+
+ if (isset($prices[$sales_type_id][$home_curr]))
+ {
+ $price = $prices[$sales_type_id][$home_curr] / $rate;
+ }
+ elseif (isset($prices[$base_id][$currency]))
+ {
+ $price = $prices[$base_id][$currency] * $factor;
+ }
+ elseif (isset($prices[$base_id][$home_curr]))
+ {
+ $price = $prices[$base_id][$home_curr] * $factor / $rate;
+ }
+
+ return $price === false ? false : round($price, user_price_dec());
+}
+//----------------------------------------------------------------------------------------
+//
+// Get price for given item or kit.
+// When $std==true price is calculated as a sum of all included stock items,
+// otherwise all prices set for kits and items are accepted.
+//
+function get_kit_price($item_code, $currency, $sales_type_id, $factor=null,
+ $date=null, $std = false)
+{
+ $kit_price = 0.00;
+ if (!$std) {
+ $kit_price = get_price( $item_code, $currency, $sales_type_id,
+ $factor, $date);