<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>order_related_movement_uid_list:list</params>
SELECT 
	catalog.uid,
	catalog.path,
	movement.target_quantity,
	movement.quantity,
	movement.source_uid,
	movement.destination_uid,
	movement.start_date,
	movement.stop_date,
	movement.target_start_date,
	movement.target_stop_date,
	movement.variation_text,
	resource.relative_url,
	resource.id,
	resource.uid AS resource_uid,
	resource.Title
FROM
	catalog AS transformation_rule, 
	catalog AS resource,
	catalog,
	category AS resource_category,
	movement 
WHERE
	transformation_rule.id = "default_transformation_rule"
AND	(<dtml-in order_related_movement_uid_list>transformation_rule.parent_uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-last><dtml-else> OR </dtml-if></dtml-in>)
AND	catalog.parent_uid = transformation_rule.uid
AND	movement.uid = catalog.uid
AND	movement.resource_uid = resource.uid
AND	resource.portal_type = "Category"
AND	resource_category.uid = resource.uid
AND	resource_category.category_uid = resource.uid
AND	resource_category.base_category_uid = <dtml-var "portal_categories.operation.getUid()">