<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:DeliveryListBrain
class_file:InventoryBrain.py
</dtml-comment>
<params>order_related_movement_uid_list:list</params>
SELECT
	catalog.*
FROM
	catalog AS transformation_rule,
	catalog AS consumed,
	catalog AS transformation_sourcing_rule,
	catalog AS resource,
	catalog,
	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-end><dtml-else> OR </dtml-if></dtml-in>)
AND	consumed.parent_uid = transformation_rule.uid
AND	transformation_sourcing_rule.parent_uid = consumed.uid
AND	catalog.parent_uid = transformation_sourcing_rule.uid
AND	movement.uid = catalog.uid
AND	movement.resource_uid = resource.uid
AND	(resource.portal_type = "Composant" OR resource.portal_type = "Tissu")
