exception 'Exception' with message 'mysql error: 
QUERY: 
  	SELECT 	my_hl.haveitem_id as my_haveitem_id, 
			my_hl.in_trade AS my_in_trade, 
			my_hl.is_for_trade AS my_is_for_trade,
			p.*, 
			img.image_id, 
			pl.platform_name, 
			c.category_name, 
			fn_calculate_price(p.min_used_sale_price, p.min_new_sale_price, p.max_sale_price, p.retail_price, NULL, p.imported_from) AS calc_average_sale_price, 
			CASE WHEN my_wl.wantitem_id IS NULL THEN 0 ELSE 1 END AS i_want_it, 
			CASE WHEN my_hl.haveitem_id IS NULL THEN 0 ELSE 1 END AS i_have_it, 
			CASE WHEN my_hl_they_want.haveitem_id IS NULL THEN 0 ELSE 1 end AS they_want_i_have, 
			MIN(COALESCE(fn_calculate_distance(they_hl_location.latitude, they_hl_location.longitude, my_hl_they_want_location.latitude, my_hl_they_want_location.longitude), 9999999999)) AS min_distance_to_my_hl_they_want, 
			MIN(COALESCE(fn_calculate_distance(they_hl_location.latitude, they_hl_location.longitude, my_location.latitude, my_location.longitude), 9999999999)) AS min_distance_to_me,
			COUNT(DISTINCT their_hl.haveitem_id) AS total_suggests, 
			COUNT(DISTINCT their_hl.user_id) AS total_suggests_users 
FROM products p
INNER JOIN platforms AS pl ON p.platform_id = pl.platform_id 
INNER JOIN categories AS c ON c.category_id = p.category_id
LEFT JOIN product_statistics ps on p.product_id = ps.product_id
LEFT JOIN ( have_list their_hl
INNER JOIN users AS u ON u.user_id = their_hl.user_id and u.status > 1 AND u.is_bot = 0
) ON their_hl.product_id = p.product_id 
	AND their_hl.deleted = 0 AND their_hl.is_for_trade=1 AND their_hl.in_trade = 0
LEFT JOIN want_list AS their_wl ON u.user_id = their_wl.user_id AND their_wl.deleted = 0 
LEFT JOIN have_list AS my_hl_they_want ON my_hl_they_want.product_id = their_wl.product_id 
	AND my_hl_they_want.deleted = 0 AND my_hl_they_want.is_for_trade = 1 AND my_hl_they_want.in_trade = 0
	AND their_hl.haveitem_id != my_hl_they_want.haveitem_id AND my_hl_they_want.user_id = 0 
LEFT JOIN addresses my_hl_they_want_location ON my_hl_they_want_location.address_id = my_hl_they_want.location_address_id
LEFT JOIN addresses they_hl_location ON they_hl_location.address_id = their_hl.location_address_id
left join user_addresses my_user_addresses on my_user_addresses.user_id = 0 and my_user_addresses.is_primary = 1
left join addresses my_location on my_location.address_id = my_user_addresses.address_id
LEFT JOIN have_list my_hl ON my_hl.product_id = p.product_id AND my_hl.deleted = 0 AND my_hl.user_id = 0
LEFT JOIN want_list my_wl ON my_wl.product_id = p.product_id AND my_wl.deleted = 0 AND my_wl.user_id = 0
LEFT JOIN products_images img ON img.product_id = p.product_id AND img.is_primary = 1 
		 
		 where  their_hl.haveitem_id IS NOT NULL AND their_wl.product_id = 18530
GROUP BY p.product_id
 having  i_have_it = 0  
 order by case when COUNT(DISTINCT their_hl.haveitem_id) > 0 then 0 else 1 end, i_want_it DESC, they_want_i_have DESC, calc_average_sale_price desc 
  
ERROR: (#1305) FUNCTION swapmygames.fn_calculate_price does not exist

' in /home/virtuman/www.swapmygames.com/www.swapmygames.com/_includes/_lib/DB.php:179
Stack trace:
#0 /home/virtuman/www.swapmygames.com/www.swapmygames.com/_includes/_lib/DB.php(93): DB::__debug('??  ?SELECT ?my...')
#1 /home/virtuman/www.swapmygames.com/www.swapmygames.com/_includes/models/Item.php(384): DB::query('??  ?SELECT ?my...')
#2 /home/virtuman/www.swapmygames.com/www.swapmygames.com/_includes/controllers/IndexController.php(63): Item->whatICanGetForProduct(18530)
#3 /home/virtuman/www.swapmygames.com/www.swapmygames.com/_includes/_lib/Kernel.php(24): IndexController->indexAction()
#4 /home/virtuman/www.swapmygames.com/www.swapmygames.com/public_html/index.php(9): Kernel::Run(Array)
#5 {main}

KERNEL PANIC!!