<dtml-comment>
title:
connection_id:MySQL
max_rows:1000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT
	movement_c.*
FROM
	catalog, catalog AS resource, movement, catalog AS movement_c
WHERE
	movement.delivery_uid = catalog.uid
AND	catalog.portal_type = "Sales Packing List"
AND	resource.uid = movement.resource_uid
AND	resource.portal_type = "Assortiment"
AND	(movement.quantity is NULL OR movement.quantity = 0.0)
AND	(movement.target_quantity is NULL OR movement.target_quantity = 0.0)
AND	movement_c.uid = movement.uid
AND	movement_c.portal_type = "Sales Packing List Line"