<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
SELECT 
	SUM(quantity) AS total_quantity, 
	SUM(total_price) AS total_price, 
	SUM(target_quantity) AS target_total_quantity, 
	SUM(target_total_price) AS target_total_price, 
	AVG(price) AS average_price
FROM catalog, movement
WHERE 
	catalog.parent_uid = <dtml-sqlvar uid type="int">
AND	
	catalog.uid = movement.uid
